How to Cmake all targets to do complete build of the project
I am a newbie to CLion
We have a well established CMake project with multiple targets in it.
I would like to execute target all to do a build of the entire project.
Unfortunately Edit configuration does not show me the "all" target even though it shows all individual targets
Is there a way to do equivalent of "make all" via the cmake build ?
Also how can I pass parameters to cmake eg.
cmake .. -DCMAKE_BUILD_TYPE:STRING=RelWithDebInfo
Thanks
Sam
Please sign in to leave a comment.
Hello,
There is no option currently to build all targets: http://youtrack.jetbrains.com/issue/CPP-158
As for the cmake parameters jut set it in the CMakeLists.txt file like: SET(CMAKE_BUILD_TYPE RelWithDebInfo).
Thank for confirming. Would cmake all be there in a future version ?
Also for the cmake option, I was talking about passing an option externally using -D eg. via -DUSE_CLANG to CMake when you have something like the following in CMakeLists.txt
if(USE_CLANG)
SET(CMAKE_CXX_COMPILER "${CLANG_ROOT_PATH}/bin/clang++")
SET(CMAKE_C_LINK_EXECUTABLE "${CLANG_ROOT_PATH}/bin/clang++")
SET(CMAKE_C_COMPILER "${CLANG_ROOT_PATH}/bin/clang")
SET(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -std=c++11 -fsanitize=address")
endif()
Thanks
Sam
Yes, CMake will stay for later versions in CLion.
Now there is no possibility to pass parameters to CMake externally (http://youtrack.jetbrains.com/issue/CPP-188).