How do I set up goals Release
and Debug
for the same project simultaneously with cmake for my eclipse CDT? So far, my file is CMakeLists.txt
as follows:
cmake_minimum_required (VERSION 2.6)
...
SET ( CMAKE_CXX_FLAGS_DEBUG "${CMAKE_CXX_FLAGS_DEBUG} -O0 -g" )
SET ( CMAKE_CXX_FLAGS_RELEASE "${CMAKE_CXX_FLAGS_RELEASE} -O2" )
In doing so, I can use either the configuration Debug
or Release
for my in-source project:
$ cmake -G"Eclipse CDT4 - Unix Makefiles" -DCMAKE_BUILD_TYPE=Release .
$ cmake -G"Eclipse CDT4 - Unix Makefiles" -DCMAKE_BUILD_TYPE=Debug .
I know that I can create assemblies outside the source code using folders for sharing with another configuration, but then I have two different projects in my eclipse. In my scenario, I just want to have one project with different goals.
This site explains how to do it manually, but is there an auto-generated way?