On Nov 20, 2007 1:38 AM, Jesse Corrington <[EMAIL PROTECTED]> wrote: > I searched the archives and couldn't find any good information about this > task, which I would assume is important to many people. I need to set > options in visual studio that are different in debug and release modes. For > example I need to set preprocessor defines, change compiler flags, link with > different libraries, and other settings. > > Is there anyway to do something like this. > > IF ( RELEASE ) > ADD_DEFINITIONS( -DREL1 ) > ELSEIF ( DEBUG ) > ADD_DEFINITIONS( -DDEB1 ) > ENDIF ()
Look at the CMAKE_BUILD_TYPE variable in http://www.cmake.org/Wiki/CMake_Useful_Variables Basically you can have variables like CMAKE_CXX_FLAGS_DEBUG, CMAKE_CXX_FLAGS_RELEASE, CMAKE_CXX_FLAGS_WHATEVER, and the correct variable is chosen by cmake according to the value of CMAKE_BUILD_TYPE (e.g. DEBUG, RELEASE or WHATEVER. -- Salvatore Iovene http://www.iovene.com/ Key Fingerprint: 5647 944D D5AD 2E87 00B4 7D54 2864 359D FF20 16D8 _______________________________________________ CMake mailing list [email protected] http://www.cmake.org/mailman/listinfo/cmake
