summaryrefslogtreecommitdiffstats
path: root/Modules/UseQt4.cmake
diff options
context:
space:
mode:
authorClinton Stimpson <clinton@elemtech.com>2007-12-01 00:11:18 (GMT)
committerClinton Stimpson <clinton@elemtech.com>2007-12-01 00:11:18 (GMT)
commit96d8460b4e193212be216945f598311f385ca074 (patch)
treee5bb8be1cf0ef15884b1ced3478b65f653a3ce36 /Modules/UseQt4.cmake
parent8537c5598803d59f368efdad45d83c195ed99a07 (diff)
downloadCMake-96d8460b4e193212be216945f598311f385ca074.zip
CMake-96d8460b4e193212be216945f598311f385ca074.tar.gz
CMake-96d8460b4e193212be216945f598311f385ca074.tar.bz2
ENH: Define QT_NO_DEBUG when building with release Qt libs.
Fixes #6104.
Diffstat (limited to 'Modules/UseQt4.cmake')
-rw-r--r--Modules/UseQt4.cmake11
1 files changed, 11 insertions, 0 deletions
diff --git a/Modules/UseQt4.cmake b/Modules/UseQt4.cmake
index fa7b5a0..bdc723c 100644
--- a/Modules/UseQt4.cmake
+++ b/Modules/UseQt4.cmake
@@ -6,6 +6,17 @@
ADD_DEFINITIONS(${QT_DEFINITIONS})
+# check that QT_NO_DEBUG is defined for release configurations
+MACRO(QT_CHECK_FLAG_EXISTS FLAG VAR DOC)
+ IF(NOT ${VAR} MATCHES "${FLAG}")
+ 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})
SET(QT_LIBRARIES "")