[CMake] Add a compiler switch to a a specific configuration

Jan Woetzel jw at mip.informatik.uni-kiel.de
Tue Jul 11 11:05:38 EDT 2006


Sagnes, Frederic wrote:

>Hello,
>
>I'm using the STLport library on several targets on my project, and need to define the _STLP_DEBUG flag on the debug configuration of each target. I looked at :
>SET_TARGET_PROPERTIES ( PROPERTIES COMPILE_FLAGS -D_STLP_DEBUG )
>
>... but it doesn't seem to be able to specify a switch for a specific configuration, neither can :
>ADD_DEFINITIONS ( -D_STLP_DEBUG )
>

IF     (CMAKE_BUILD_TYPE MATCHES ".*[rR][eE][lL].*")

# whatever you need in release

ELSE(CMAKE_BUILD_TYPE MATCHES ".*[rR][eE][lL].*")

  ADD_DEFINITIONS ( -D_STLP_DEBUG )

ENDIF (CMAKE_BUILD_TYPE MATCHES ".*[rR][eE][lL].*")

Jan.

-- 

  Dipl.-Ing. Jan Woetzel
--------------------------------------------------
  University of Kiel
  Institute of Computer Science and Applied Mathematics
  Hermann-Rodewald-Str. 3 [room 310]
  24098 Kiel/Germany
--------------------------------------------------
  Phone +49-431-880-4477
  Fax   +49-431-880-4054
  Mob.  +49-179-2937346
--------------------------------------------------
  Url   www.mip.informatik.uni-kiel.de/~jw
  Email jw at mip.informatik.uni-kiel.de



More information about the CMake mailing list