CLion CMakeLists.txt add argv arguments to configu

2019-07-12 17:59发布

I have configuration in CMAkeLists.txt

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

So I can launch client.cpp in CLion (Shift + F10). But if I need to launch client.cpp with argv parameter (it has one integer as parameter) I must change configuration in CLion adding program arguments.

Maybe I can add some parameters using CMakeLists.txt?

1条回答
甜甜的少女心
2楼-- · 2019-07-12 18:27

CMakeList is only responsible for configuring your program, it does so by generating a Makefile, which then will build your program binary. Clion then launch the binary using the arguments you specified.

查看更多
登录 后发表回答