【问题标题】:CLion CMakeLists.txt add argv arguments to configurationCLion CMakeLists.txt 将 argv 参数添加到配置
【发布时间】:2015-06-04 13:52:06
【问题描述】:

我在 CMAkeLists.txt 中有配置

set(SOURCE_FILES client/client.cpp)
add_executable(Client ${SOURCE_FILES} client/client.cpp)

所以我可以在 CLion (Shift + F10) 中启动 client.cpp。但是如果我需要使用 argv 参数启动 client.cpp(它有一个整数作为参数),我必须在 CLion 中更改配置,添加程序参数。

也许我可以使用 CMakeLists.txt 添加一些参数?

【问题讨论】:

    标签: c++ cmake argv clion


    【解决方案1】:

    CMakeList 只负责配置你的程序,它通过生成一个 Makefile 来完成,然后它将构建你的程序二进制文件。 然后 Clion 使用您指定的参数启动二进制文件。

    【讨论】:

      猜你喜欢
      • 2016-11-12
      • 2011-11-30
      • 2020-03-06
      • 1970-01-01
      • 1970-01-01
      • 2020-05-29
      • 1970-01-01
      • 2019-01-01
      • 1970-01-01
      相关资源
      最近更新 更多