[CMake] Decoupuling configuration and toolchain

Andrea Galeazzi galeazzi at korg.it
Thu Sep 23 10:58:27 EDT 2010


Hi everybody,
I've got a project with two configuration (Debug and Release) and two  
target: win32 and ARM.
In your opinion what's the best way to manage a such kind of project?
As an example, in my CmakeList I have the following piece of code that  
works fine only for visual studio.
if(CMAKE_CONFIGURATION_TYPES)
	   set(CMAKE_CONFIGURATION_TYPES Debug Release)
        set(CMAKE_CONFIGURATION_TYPES "${CMAKE_CONFIGURATION_TYPES}"  
CACHE STRING "Reset the configurations to what we need" FORCE)
	   set(CMAKE_CXX_FLAGS_DEBUG "/D _DEBUG")
	   set(CMAKE_CXX_FLAGS_RELEASE "/D _NDEBUG")
endif()

What I need is to move this code in another file so I can also specify  
similar options for gcc etc......
On the other hand in CMakeList.txt should contain just only the  
sources,include path and the other statements not involving the  
specific target or configuration.
Cheers


More information about the CMake mailing list