ENH: Use new COMPILE_DEFINITIONS_* with set_property to

add Qt release/debug defines.
This commit is contained in:
Clinton Stimpson 2008-02-01 12:02:19 -05:00
parent f1b334ca7a
commit d94087ab44
1 changed files with 4 additions and 11 deletions

View File

@ -5,17 +5,10 @@
ADD_DEFINITIONS(${QT_DEFINITIONS}) ADD_DEFINITIONS(${QT_DEFINITIONS})
SET_PROPERTY(DIRECTORY APPEND PROPERTY COMPILE_DEFINITIONS_DEBUG QT_DEBUG)
# check that QT_NO_DEBUG is defined for release configurations SET_PROPERTY(DIRECTORY APPEND PROPERTY COMPILE_DEFINITIONS_RELEASE QT_NO_DEBUG)
MACRO(QT_CHECK_FLAG_EXISTS FLAG VAR DOC) SET_PROPERTY(DIRECTORY APPEND PROPERTY COMPILE_DEFINITIONS_RELWITHDEBINFO QT_NO_DEBUG)
IF(NOT ${VAR} MATCHES "${FLAG}") SET_PROPERTY(DIRECTORY APPEND PROPERTY COMPILE_DEFINITIONS_MINSIZEREL QT_NO_DEBUG)
SET(${VAR} "${${VAR}} ${FLAG}"
CACHE STRING "Flags used by the compiler during ${DOC} builds." FORCE)
ENDIF(NOT ${VAR} MATCHES "${FLAG}")
ENDMACRO(QT_CHECK_FLAG_EXISTS FLAG VAR)
QT_CHECK_FLAG_EXISTS(-DQT_NO_DEBUG CMAKE_CXX_FLAGS_RELWITHDEBINFO "Release with Debug Info")
QT_CHECK_FLAG_EXISTS(-DQT_NO_DEBUG CMAKE_CXX_FLAGS_RELEASE "release")
QT_CHECK_FLAG_EXISTS(-DQT_NO_DEBUG CMAKE_CXX_FLAGS_MINSIZEREL "release minsize")
INCLUDE_DIRECTORIES(${QT_INCLUDE_DIR}) INCLUDE_DIRECTORIES(${QT_INCLUDE_DIR})