2007/5/21, Kenny Erleben <[EMAIL PROTECTED]>:
Eric Noulard skrev: > 2007/5/20, Kenny Erleben <[EMAIL PROTECTED]>: > >> iii) How to make several executables share the same compiler- and >> linker- flags? > > you may define a CMake variable > SET(MYCFLAGS "jkdlfjlj") > SET(MYLDFLAGS "ljjl") > > then you may use > SET_TARGET_PROPERTIES(target1 target2 > PROPERTIES > COMPILE_FLAGS ${MYCFLAGS} > LINK_FLAGS ${MYLDFLAGS}) How can I use different flags for debug and optimized versions?
I would test the value of CMAKE_BUILD_TYPE and SET your MYxxxFLAGS accordingly. something like: IF (CMAKE_BUILD_TYPE STREQUAL "Debug") SET ... ELSE (CMAKE_BUILD_TYPE STREQUAL "Debug") SET ... ENDIF (CMAKE_BUILD_TYPE STREQUAL "Debug") as a side note you should look at the wiki http://www.cmake.org/Wiki/CMake_Useful_Variables and look for "You can create your own build type" you may search ML archive for this kind of subject too may be it is another suitable way to do what you want with your "custom" FLAGS -- Erk _______________________________________________ CMake mailing list CMake@cmake.org http://www.cmake.org/mailman/listinfo/cmake