summaryrefslogtreecommitdiffstats
path: root/Modules/FindQt4.cmake
diff options
context:
space:
mode:
authorAlexander Neundorf <neundorf@kde.org>2008-08-16 23:11:53 (GMT)
committerAlexander Neundorf <neundorf@kde.org>2008-08-16 23:11:53 (GMT)
commitdb4bebe5c83dc38551ff4d9507cb20ac4a2f9f56 (patch)
tree6c4dea5577866db0913bb879e5f5cb2724f69d67 /Modules/FindQt4.cmake
parent814b3687251605ed5c2924b0705ebae2e70d2eb3 (diff)
downloadCMake-db4bebe5c83dc38551ff4d9507cb20ac4a2f9f56.zip
CMake-db4bebe5c83dc38551ff4d9507cb20ac4a2f9f56.tar.gz
CMake-db4bebe5c83dc38551ff4d9507cb20ac4a2f9f56.tar.bz2
BUG: fix #7447, FindModulesExecuteAll test fails if both Qt3 and KDE4 can be
found in the system Qt3 and Qt4 cannot be used together in one project. Now Qt3/KDE3 and Qt4/KDE4 handle the case that this is done nevertheless properly, i.e. they fail with FATAL_ERROR if it was REQUIRED and they fail with just MESSAGE(STATUS ...) and RETURN() if it was not REQUIRED BUG: make FindQt4 error out with FATAL_ERROR also if it was searched QUIET Alex
Diffstat (limited to 'Modules/FindQt4.cmake')
-rw-r--r--Modules/FindQt4.cmake21
1 files changed, 17 insertions, 4 deletions
diff --git a/Modules/FindQt4.cmake b/Modules/FindQt4.cmake
index da8594c..236751c 100644
--- a/Modules/FindQt4.cmake
+++ b/Modules/FindQt4.cmake
@@ -256,6 +256,19 @@
# (They make no sense in Qt4)
# QT_QT_LIBRARY Qt-Library is now split
+# If Qt3 has already been found, fail.
+IF(QT_QT_LIBRARY)
+ IF(Qt4_FIND_REQUIRED)
+ MESSAGE( FATAL_ERROR "Qt3 and Qt4 cannot be used together in one project.")
+ ELSE(Qt4_FIND_REQUIRED)
+ IF(NOT Qt4_FIND_QUIETLY)
+ MESSAGE( STATUS "Qt3 and Qt4 cannot be used together in one project.")
+ ENDIF(NOT Qt4_FIND_QUIETLY)
+ RETURN()
+ ENDIF(Qt4_FIND_REQUIRED)
+ENDIF(QT_QTCORE_LIBRARY)
+
+
INCLUDE(CheckSymbolExists)
INCLUDE(MacroAddFileDependencies)
@@ -474,9 +487,9 @@ IF (QT4_QMAKE_FOUND)
ENDIF( QT_QTCORE_INCLUDE_DIR AND NOT QT_INCLUDE_DIR)
IF( NOT QT_INCLUDE_DIR)
- IF( NOT Qt4_FIND_QUIETLY AND Qt4_FIND_REQUIRED)
+ IF(Qt4_FIND_REQUIRED)
MESSAGE( FATAL_ERROR "Could NOT find QtGlobal header")
- ENDIF( NOT Qt4_FIND_QUIETLY AND Qt4_FIND_REQUIRED)
+ ENDIF(Qt4_FIND_REQUIRED)
ENDIF( NOT QT_INCLUDE_DIR)
#############################################
@@ -771,9 +784,9 @@ IF (QT4_QMAKE_FOUND)
ENDIF(EXISTS ${QT_LIBRARY_DIR}/libqtmain.a)
ENDIF(QT_LIBRARY_DIR AND MSVC)
- IF( NOT Qt4_FIND_QUIETLY AND Qt4_FIND_REQUIRED)
+ IF(Qt4_FIND_REQUIRED)
MESSAGE( FATAL_ERROR "Could NOT find QtCore. Check ${CMAKE_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/CMakeError.log for more details.")
- ENDIF( NOT Qt4_FIND_QUIETLY AND Qt4_FIND_REQUIRED)
+ ENDIF(Qt4_FIND_REQUIRED)
ENDIF( NOT QT_QTCORE_LIBRARY_DEBUG AND NOT QT_QTCORE_LIBRARY_RELEASE )
# Set QT_QTASSISTANT_LIBRARY