Jesper Eskilson wrote: > Hi! > > I would like to be able to specify compiler flags (or -D options, > specifically) bound to a specific build type, i.e. Debug, Release, > etc. How can I do this? There is a target property > LINK_FLAGS_<CONFIG>, but there is no COMPILE_FLAGS_<CONFIG>. >
http://www.cmake.org/Wiki/CMake_Useful_Variables : """ CMAKE_BUILD_TYPE Choose the type of build. CMake has default flags for these: * None (CMAKE_C_FLAGS or CMAKE_CXX_FLAGS used) * Debug (CMAKE_C_FLAGS_DEBUG or CMAKE_CXX_FLAGS_DEBUG) * Release (CMAKE_C_FLAGS_RELEASE or CMAKE_CXX_FLAGS_RELEASE) * RelWithDebInfo (CMAKE_C_FLAGS_RELWITHDEBINFO or CMAKE_CXX_FLAGS_RELWITHDEBINFO * MinSizeRel (CMAKE_C_FLAGS_MINSIZEREL or CMAKE_CXX_FLAGS_MINSIZEREL) Example: SET(CMAKE_BUILD_TYPE Debug) You can create your own build type like this: SET(CMAKE_BUILD_TYPE distribution) SET(CMAKE_CXX_FLAGS_DISTRIBUTION "-O3") SET(CMAKE_C_FLAGS_DISTRIBUTION "-O3") Note that CMAKE_BUILD_TYPE is not initialized with a readable value at configuration time. This is because the user is free to select a build type at build time. """ Filipe Sousa
signature.asc
Description: OpenPGP digital signature
_______________________________________________ CMake mailing list [email protected] http://www.cmake.org/mailman/listinfo/cmake
