CLion CMakeLists.txt add argv arguments to configuration

别来无恙 提交于 2019-12-24 04:43:06

问题


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:


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.



来源:https://stackoverflow.com/questions/30645667/clion-cmakelists-txt-add-argv-arguments-to-configuration

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!