summaryrefslogtreecommitdiffstats
path: root/Modules
diff options
context:
space:
mode:
authorBill Hoffman <bill.hoffman@kitware.com>2005-09-08 13:58:41 (GMT)
committerBill Hoffman <bill.hoffman@kitware.com>2005-09-08 13:58:41 (GMT)
commitb64b020f09a0f126842879c0e08a2cc8449b7b38 (patch)
tree8337b895e5db5075f838d2671d9071fba716419a /Modules
parent0a521f4e3e5b9437f722f37a7fd8b4511814fb03 (diff)
downloadCMake-b64b020f09a0f126842879c0e08a2cc8449b7b38.zip
CMake-b64b020f09a0f126842879c0e08a2cc8449b7b38.tar.gz
CMake-b64b020f09a0f126842879c0e08a2cc8449b7b38.tar.bz2
ENH: add Ken Morelands fixes for FindQT
Diffstat (limited to 'Modules')
-rw-r--r--Modules/FindQt4.cmake914
-rw-r--r--Modules/UseQt4.cmake200
2 files changed, 578 insertions, 536 deletions
diff --git a/Modules/FindQt4.cmake b/Modules/FindQt4.cmake
index 7fde561..55001e7 100644
--- a/Modules/FindQt4.cmake
+++ b/Modules/FindQt4.cmake
@@ -1,236 +1,252 @@
########################################################################
#
-# DO NOT CALL THIS DIRECTLY
-# LET FindQt.cmake deside which FindQtX.cmake to include
-#
-# Locates Qt4 include paths and libraries (called by FindQt.cmake)
+# Locates Qt4 include paths and libraries
#
########################################################################
# This module defines
-# QT_INCLUDES ,list of paths to all include directories of Qt4
+# QT_USE_FILE A CMake file that can be included to compile
+# Qt 4 applications and libraries. By default,
+# the QtCore and QtGui libraries are loaded.
+# This behavior can be changed by setting one
+# or more of the following variables to true:
+# QT_DONT_USE_QTCORE
+# QT_DONT_USE_QTGUI
+# QT_USE_QT3SUPPORT
+# QT_USE_QTASSISTANT
+# QT_USE_QTDESIGNER
+# QT_USE_QTMOTIF
+# QT_USE_QTNETWORK
+# QT_USE_QTNSPLUGIN
+# QT_USE_QTOPENGL
+# QT_USE_QTSQL
+# QT_USE_QTXML
+# All the libraries required are stored in a
+# variable called QT_LIBRARIES. Add this variable
+# to your TARGET_LINK_LIBRARIES.
#
# macro QT4_WRAP_CPP(outfiles inputfile ... )
# macro QT4_WRAP_UI(outfiles inputfile ... )
# macro QT4_ADD_RESOURCE(outfiles inputfile ... )
#
-# QT_INCLUDE_DIR ,path to "include" of Qt4
-# QT_QT_INCLUDE_DIR ,path to "include/Qt" of Qt4
-# QT_QT3SUPPORT_INCLUDE_DIR ,path to "include/Qt3Support" of Qt
-# QT_QTASSISTANT_INCLUDE_DIR ,path to "include/QtAssistant" of Qt4
-# QT_QTCORE_INCLUDE_DIR ,path to "include/QtCore" of Qt4
-# QT_QTDESIGNER_INCLUDE_DIR ,path to "include/QtDesigner" of Qt4
-# QT_QTGUI_INCLUDE_DIR ,path to "include/QtGui" of Qt4
-# QT_QTMOTIF_INCLUDE_DIR ,path to "include/QtMotif" of Qt4
-# QT_QTNETWORK_INCLUDE_DIR ,path to "include/QtNetwork" of Qt4
-# QT_QTNSPLUGIN_INCLUDE_DIR ,path to "include/QtNsPlugin" of Qt4
-# QT_QTOPENGL_INCLUDE_DIR ,path to "include/QtOpenGL" of Qt4
-# QT_QTSQL_INCLUDE_DIR ,path to "include/QtSql" of Qt4
-# QT_QTXML_INCLUDE_DIR ,path to "include/QtXml" of Qt4
+# QT_FOUND If false, don't try to use Qt.
+# QT4_FOUND If false, don't try to use Qt 4.
+#
+# QT_QTCORE_FOUND True if QtCore includes and library found.
+# QT_QTGUI_FOUND True if QtGui includes and library found.
+# QT_QT3SUPPORT_FOUND True if Qt3Support includes and library found.
+# QT_QTASSISTANT_FOUND True if QtAssistant includes and library found.
+# QT_QTDESIGNER_FOUND True if QtDesigner includes and library found.
+# QT_QTMOTIF_FOUND True if QtMotif includes and library found.
+# QT_QTNETWORK_FOUND True if QtNetwork includes and library found.
+# QT_QTNSPLUGIN_FOUND True if QtNsPlugin includes and library found.
+# QT_QTOPENGL_FOUND True if QtOpenGL includes and library found.
+# QT_QTSQL_FOUND True if QtSql includes and library found.
+# QT_QTXML_FOUND True if QtXml includes and library found.
#
-# QT_LIBRARIES ,list of path+filename of all optimized libs of Qt4
-# QT_LIBRARIES_DEBUG ,list of path+filename of all debug libs of Qt4
-# QT_LIBRARIES_TRYOPTIMIZED ,list of path+filename of all libs (try optimized, if not found try debug)
-# QT_LIBRARIES_TRYDEBUG ,list of path+filename of all libs (try debug, if not found try optimized)
-# QT_LIBRARY_DIR ,path to "lib" of Qt4
+# QT_DEFINITIONS Definitions to use when compiling code that
+# uses Qt.
#
-# QT_QT3SUPPORT_LIBRARY ,path+filename for Qt3Support library of Qt4
-# QT_QTASSISTANT_LIBRARY ,path+filename for QtAssistant library of Qt4
-# QT_QTCORE_LIBRARY ,path+filename for QtCore library of Qt4
-# QT_QTDESIGNER_LIBRARY ,path+filename for QtDesigner library of Qt4
-# QT_QTGUI_LIBRARY ,path+filename for QtGui library of Qt4
-# QT_QTMOTIF_LIBRARY ,path+filename for QtMotif library of Qt4
-# QT_QTNETWORK_LIBRARY ,path+filename for QtNetwork library of Qt4
-# QT_QTNSPLUGIN_LIBRARY ,path+filename for QtNsPlugin library of Qt4
-# QT_QTOPENGL_LIBRARY ,path+filename for QtOpenGL library of Qt4
-# QT_QTSQL_LIBRARY ,path+filename for QtSql library of Qt4
-# QT_QTXML_LIBRARY ,path+filename for QtXml library of Qt4
+# QT_INCLUDES List of paths to all include directories of Qt4
+# QT_INCLUDE_DIR Path to "include" of Qt4
+# QT_QT_INCLUDE_DIR Path to "include/Qt" of Qt4
+# QT_QT3SUPPORT_INCLUDE_DIR Path to "include/Qt3Support" of Qt
+# QT_QTASSISTANT_INCLUDE_DIR Path to "include/QtAssistant" of Qt4
+# QT_QTCORE_INCLUDE_DIR Path to "include/QtCore" of Qt4
+# QT_QTDESIGNER_INCLUDE_DIR Path to "include/QtDesigner" of Qt4
+# QT_QTGUI_INCLUDE_DIR Path to "include/QtGui" of Qt4
+# QT_QTMOTIF_INCLUDE_DIR Path to "include/QtMotif" of Qt4
+# QT_QTNETWORK_INCLUDE_DIR Path to "include/QtNetwork" of Qt4
+# QT_QTNSPLUGIN_INCLUDE_DIR Path to "include/QtNsPlugin" of Qt4
+# QT_QTOPENGL_INCLUDE_DIR Path to "include/QtOpenGL" of Qt4
+# QT_QTSQL_INCLUDE_DIR Path to "include/QtSql" of Qt4
+# QT_QTXML_INCLUDE_DIR Path to "include/QtXml" of Qt4
#
-# QT_QT3SUPPORT_LIBRARY_DEBUG ,path+filename for Qt3Support_debug library of Qt
-# QT_QTASSISTANT_LIBRARY_DEBUG ,path+filename for QtAssistant_debug library of Qt4
-# QT_QTCORE_LIBRARY_DEBUG ,path+filename for QtCore_debug library of Qt4
-# QT_QTDESIGNER_LIBRARY_DEBUG ,path+filename for QtDesigner_debug library of Qt4
-# QT_QTGUI_LIBRARY_DEBUG ,path+filename for QtGui_debug library of Qt4
-# QT_QTMOTIF_LIBRARY_DEBUG ,path+filename for QtMotif_debug library of Qt4
-# QT_QTNETWORK_LIBRARY_DEBUG ,path+filename for QtNetwork_debug library of Qt4
-# QT_QTNSPLUGIN_LIBRARY_DEBUG ,path+filename for QtNsPlugin_debug library of Qt4
-# QT_QTOPENGL_LIBRARY_DEBUG ,path+filename for QtOpenGL_debug library of Qt4
-# QT_QTSQL_LIBRARY_DEBUG ,path+filename for QtSql_debug library of Qt4
-# QT_QTXML_LIBRARY_DEBUG ,path+filename for QtXml_debug library of Qt4
+# QT_LIBRARY_DIR Path to "lib" of Qt4
#
-# QT_DEFINITIONS ,definitions to use when compiling code that uses Qt.
-# QT_FOUND ,If false, don't try to use Qt (depends on existence of QT_LIBRARY_DIR and QT_INCLUDE_DIR)
+# QT_QT3SUPPORT_LIBRARY Path+filename for Qt3Support library of Qt4
+# QT_QTASSISTANT_LIBRARY Path+filename for QtAssistant library of Qt4
+# QT_QTCORE_LIBRARY Path+filename for QtCore library of Qt4
+# QT_QTDESIGNER_LIBRARY Path+filename for QtDesigner library of Qt4
+# QT_QTGUI_LIBRARY Path+filename for QtGui library of Qt4
+# QT_QTMOTIF_LIBRARY Path+filename for QtMotif library of Qt4
+# QT_QTNETWORK_LIBRARY Path+filename for QtNetwork library of Qt4
+# QT_QTNSPLUGIN_LIBRARY Path+filename for QtNsPlugin library of Qt4
+# QT_QTOPENGL_LIBRARY Path+filename for QtOpenGL library of Qt4
+# QT_QTSQL_LIBRARY Path+filename for QtSql library of Qt4
+# QT_QTXML_LIBRARY Path+filename for QtXml library of Qt4
+#
+# QT_QT3SUPPORT_LIBRARY_DEBUG Path+filename for Qt3Support_debug library of Qt
+# QT_QTASSISTANT_LIBRARY_DEBUG Path+filename for QtAssistant_debug library
+# of Qt4
+# QT_QTCORE_LIBRARY_DEBUG Path+filename for QtCore_debug library of Qt4
+# QT_QTDESIGNER_LIBRARY_DEBUG Path+filename for QtDesigner_debug library of Qt4
+# QT_QTGUI_LIBRARY_DEBUG Path+filename for QtGui_debug library of Qt4
+# QT_QTMOTIF_LIBRARY_DEBUG Path+filename for QtMotif_debug library of Qt4
+# QT_QTNETWORK_LIBRARY_DEBUG Path+filename for QtNetwork_debug library of Qt4
+# QT_QTNSPLUGIN_LIBRARY_DEBUG Path+filename for QtNsPlugin_debug library of Qt4
+# QT_QTOPENGL_LIBRARY_DEBUG Path+filename for QtOpenGL_debug library of Qt4
+# QT_QTSQL_LIBRARY_DEBUG Path+filename for QtSql_debug library of Qt4
+# QT_QTXML_LIBRARY_DEBUG Path+filename for QtXml_debug library of Qt4
#
# also defined, but not for general use are
-# QT_MOC_EXECUTABLE ,where to find the moc tool.
-# QT_UIC_EXECUTABLE ,where to find the uic tool.
-# QT_RCC_EXECUTABLE ,where to find the rcc tool
+# QT_MOC_EXECUTABLE Where to find the moc tool.
+# QT_UIC_EXECUTABLE Where to find the uic tool.
+# QT_RCC_EXECUTABLE Where to find the rcc tool
#
# These are around for backwards compatibility
# they will be set
-# QT_WRAP_CPP ,set true if QT_MOC_EXECUTABLE is found
-# QT_WRAP_UI ,set true if QT_UIC_EXECUTABLE is found
+# QT_WRAP_CPP Set true if QT_MOC_EXECUTABLE is found
+# QT_WRAP_UI Set true if QT_UIC_EXECUTABLE is found
#
#
# These variables do _NOT_ have any effect anymore (compared to FindQt.cmake)
-# QT_MT_REQUIRED , Qt4 is now always multithreaded
+# QT_MT_REQUIRED Qt4 is now always multithreaded
#
-# These variables are set to "" , because Qt structure changed (They make no sence in Qt4)
-# QT_QT_LIBRARY , Qt-Library is now splitt into different parts
-# QT_QTMAIN_LIBRARY , Qt-Library is now splitt into different parts
+# These variables are set to "" Because Qt structure changed (They make no sence in Qt4)
+# QT_QT_LIBRARY Qt-Library is now splitt into different parts
+# QT_QTMAIN_LIBRARY Qt-Library is now splitt into different parts
+SET(QT_USE_FILE ${CMAKE_ROOT}/Modules/UseQt4.cmake)
+
+SET( QT_DEFINITIONS "")
+
+IF (WIN32)
+ SET(QT_DEFINITIONS -DQT_DLL)
+ENDIF(WIN32)
# check for qmake
-IF(NOT QT_QMAKE_EXECUTABLE)
- FIND_PROGRAM(QT_QMAKE_EXECUTABLE NAMES qmake PATHS $ENV{QTDIR}/bin)
-ENDIF(NOT QT_QMAKE_EXECUTABLE)
+FIND_PROGRAM(QT_QMAKE_EXECUTABLE NAMES qmake PATHS $ENV{QTDIR}/bin)
+
+# Set QT_LIBRARY_DIR
+IF(NOT QT_LIBRARY_DIR)
+ EXEC_PROGRAM( ${QT_QMAKE_EXECUTABLE}
+ ARGS "-query QT_INSTALL_LIBS"
+ OUTPUT_VARIABLE QT_LIBRARY_DIR_TMP )
+ SET(QT_LIBRARY_DIR ${QT_LIBRARY_DIR_TMP} CACHE PATH "Qt library dir")
+ENDIF(NOT QT_LIBRARY_DIR)
+
+IF (APPLE)
+ IF (EXISTS ${QT_LIBRARY_DIR}/QtCore.framework)
+ SET(QT_USE_FRAMEWORKS ON
+ CACHE BOOL "Set to ON if Qt build uses frameworks.")
+ ELSE (EXISTS ${QT_LIBRARY_DIR}/QtCore.framework)
+ SET(QT_USE_FRAMEWORKS OFF
+ CACHE BOOL "Set to ON if Qt build uses frameworks.")
+ ENDIF (EXISTS ${QT_LIBRARY_DIR}/QtCore.framework)
+
+ MARK_AS_ADVANCED(QT_USE_FRAMEWORKS)
+ENDIF (APPLE)
########################################
#
# Setting the INCLUDE-Variables
#
########################################
-# Set QT_QT_INCLUDE_DIR by searching for qglobal.h
-IF(NOT QT_QT_INCLUDE_DIR)
+IF (NOT QT_HEADERS_DIR)
+ # Set QT_QT_INCLUDE_DIR by searching for qglobal.h
IF(QT_QMAKE_EXECUTABLE)
EXEC_PROGRAM( ${QT_QMAKE_EXECUTABLE}
ARGS "-query QT_INSTALL_HEADERS"
OUTPUT_VARIABLE qt_headers )
+ SET(QT_HEADERS_DIR ${qt_headers} CACHE INTERNAL "")
ENDIF(QT_QMAKE_EXECUTABLE)
- FIND_PATH( QT_QT_INCLUDE_DIR qglobal.h
- ${qt_headers}/Qt
- $ENV{QTDIR}/include/Qt
- /usr/local/qt/include/Qt
- /usr/local/include/Qt
- /usr/lib/qt/include/Qt
- /usr/include/Qt
- /usr/share/qt4/include/Qt
- C:/Progra~1/qt/include/Qt
- /usr/include/qt4/Qt)
-ENDIF(NOT QT_QT_INCLUDE_DIR)
+ENDIF (NOT QT_HEADERS_DIR)
+FIND_PATH( QT_QT_INCLUDE_DIR qglobal.h
+ ${QT_HEADERS_DIR}/Qt
+ ${QT_LIBRARY_DIR}/QtCore.framework/Headers
+ $ENV{QTDIR}/include/Qt
+ /usr/local/qt/include/Qt
+ /usr/local/include/Qt
+ /usr/lib/qt/include/Qt
+ /usr/include/Qt
+ /usr/share/qt4/include/Qt
+ "C:/Program Files/qt/include/Qt"
+ /usr/include/qt4/Qt)
# Set QT_INCLUDE_DIR by removine "/Qt" in the string ${QT_QT_INCLUDE_DIR}
-IF(NOT QT_INCLUDE_DIR)
- IF( QT_QT_INCLUDE_DIR AND NOT QT_INCLUDE_DIR)
+IF( QT_QT_INCLUDE_DIR AND NOT QT_INCLUDE_DIR)
+ IF (QT_USE_FRAMEWORKS)
+ SET(QT_INCLUDE_DIR ${QT_HEADERS_DIR})
+ ELSE (QT_USE_FRAMEWORKS)
STRING( REGEX REPLACE "/Qt$" "" qt4_include_dir ${QT_QT_INCLUDE_DIR})
SET( QT_INCLUDE_DIR ${qt4_include_dir} CACHE PATH "")
- ELSE( QT_QT_INCLUDE_DIR AND NOT QT_INCLUDE_DIR)
- IF( NOT Qt_FIND_QUIETLY AND Qt_FIND_REQUIRED)
- MESSAGE( SEND_ERROR "Could not find qglobal.h")
- ENDIF( NOT Qt_FIND_QUIETLY AND Qt_FIND_REQUIRED)
- ENDIF( QT_QT_INCLUDE_DIR AND NOT QT_INCLUDE_DIR)
-ENDIF(NOT QT_INCLUDE_DIR)
+ ENDIF (QT_USE_FRAMEWORKS)
+ENDIF( QT_QT_INCLUDE_DIR AND NOT QT_INCLUDE_DIR)
+IF( NOT QT_INCLUDE_DIR)
+ IF( NOT Qt_FIND_QUIETLY AND Qt_FIND_REQUIRED)
+ MESSAGE( SEND_ERROR "Could not find qglobal.h")
+ ENDIF( NOT Qt_FIND_QUIETLY AND Qt_FIND_REQUIRED)
+ENDIF( NOT QT_INCLUDE_DIR)
+
+IF (QT_USE_FRAMEWORKS)
+ SET(QT_DEFINITIONS ${QT_DEFINITIONS}
+ -F${QT_LIBRARY_DIR}
+ )
+ENDIF (QT_USE_FRAMEWORKS)
# Set QT_QT3SUPPORT_INCLUDE_DIR
-IF(NOT QT_QT3SUPPORT_INCLUDE_DIR)
- FIND_PATH( QT_QT3SUPPORT_INCLUDE_DIR Qt3Support ${QT_INCLUDE_DIR}/Qt3Support)
- IF( NOT QT_QT3SUPPORT_INCLUDE_DIR )
- IF( NOT Qt_FIND_QUIETLY)
- MESSAGE( STATUS "Could not find ${QT_INCLUDE_DIR}/Qt3Support")
- ENDIF( NOT Qt_FIND_QUIETLY)
- ENDIF( NOT QT_QT3SUPPORT_INCLUDE_DIR )
-ENDIF(NOT QT_QT3SUPPORT_INCLUDE_DIR)
-
-# Set QT_QTASSISTANT_INCLUDE_DIR
-IF(NOT QT_QTASSISTANT_INCLUDE_DIR)
- FIND_PATH( QT_QTASSISTANT_INCLUDE_DIR QtAssistant ${QT_INCLUDE_DIR}/QtAssistant)
- IF( NOT QT_QTASSISTANT_INCLUDE_DIR )
- IF( NOT Qt_FIND_QUIETLY)
- MESSAGE( STATUS "Could not find ${QT_INCLUDE_DIR}/QtAssistant")
- ENDIF( NOT Qt_FIND_QUIETLY)
- ENDIF( NOT QT_QTASSISTANT_INCLUDE_DIR )
-ENDIF(NOT QT_QTASSISTANT_INCLUDE_DIR)
+FIND_PATH( QT_QT3SUPPORT_INCLUDE_DIR Qt3Support
+ ${QT_INCLUDE_DIR}/Qt3Support
+ ${QT_LIBRARY_DIR}/Qt3Support.framework/Headers
+ )
# Set QT_QTCORE_INCLUDE_DIR
-IF(NOT QT_QTCORE_INCLUDE_DIR)
- FIND_PATH( QT_QTCORE_INCLUDE_DIR QtCore ${QT_INCLUDE_DIR}/QtCore)
- IF( NOT QT_QTCORE_INCLUDE_DIR )
- IF( NOT Qt_FIND_QUIETLY)
- MESSAGE( STATUS "Could not find ${QT_INCLUDE_DIR}/QtCore")
- ENDIF( NOT Qt_FIND_QUIETLY)
- ENDIF( NOT QT_QTCORE_INCLUDE_DIR )
-ENDIF(NOT QT_QTCORE_INCLUDE_DIR)
-
-# Set QT_QTDESIGNER_INCLUDE_DIR
-IF(NOT QT_QTDESIGNER_INCLUDE_DIR)
- FIND_PATH( QT_QTDESIGNER_INCLUDE_DIR QDesignerComponents ${QT_INCLUDE_DIR}/QtDesigner)
- IF( NOT QT_QTDESIGNER_INCLUDE_DIR )
- IF( NOT Qt_FIND_QUIETLY)
- MESSAGE( STATUS "Could not find ${QT_INCLUDE_DIR}/QtDesigner")
- ENDIF( NOT Qt_FIND_QUIETLY)
- ENDIF( NOT QT_QTDESIGNER_INCLUDE_DIR )
-ENDIF(NOT QT_QTDESIGNER_INCLUDE_DIR)
+FIND_PATH( QT_QTCORE_INCLUDE_DIR QtCore
+ ${QT_INCLUDE_DIR}/QtCore
+ ${QT_LIBRARY_DIR}/QtCore.framework/Headers
+ )
# Set QT_QTGUI_INCLUDE_DIR
-IF(NOT QT_QTGUI_INCLUDE_DIR)
- FIND_PATH( QT_QTGUI_INCLUDE_DIR QtGui ${QT_INCLUDE_DIR}/QtGui)
- IF( NOT QT_QTGUI_INCLUDE_DIR )
- IF( NOT Qt_FIND_QUIETLY)
- MESSAGE( STATUS "Could not find ${QT_INCLUDE_DIR}/QtGui")
- ENDIF( NOT Qt_FIND_QUIETLY)
- ENDIF( NOT QT_QTGUI_INCLUDE_DIR )
-ENDIF(NOT QT_QTGUI_INCLUDE_DIR)
+FIND_PATH( QT_QTGUI_INCLUDE_DIR QtGui
+ ${QT_INCLUDE_DIR}/QtGui
+ ${QT_LIBRARY_DIR}/QtGui.framework/Headers
+ )
# Set QT_QTMOTIF_INCLUDE_DIR
-IF(NOT QT_QTMOTIF_INCLUDE_DIR)
- FIND_PATH( QT_QTMOTIF_INCLUDE_DIR QtMotif ${QT_INCLUDE_DIR}/QtMotif)
- IF( NOT QT_QTMOTIF_INCLUDE_DIR )
- IF( NOT Qt_FIND_QUIETLY)
- MESSAGE( STATUS "Could not find ${QT_INCLUDE_DIR}/QtMotif")
- ENDIF( NOT Qt_FIND_QUIETLY)
- ENDIF( NOT QT_QTMOTIF_INCLUDE_DIR )
-ENDIF(NOT QT_QTMOTIF_INCLUDE_DIR)
+FIND_PATH( QT_QTMOTIF_INCLUDE_DIR QtMotif ${QT_INCLUDE_DIR}/QtMotif)
# Set QT_QTNETWORK_INCLUDE_DIR
-IF(NOT QT_QTNETWORK_INCLUDE_DIR)
- FIND_PATH( QT_QTNETWORK_INCLUDE_DIR QtNetwork ${QT_INCLUDE_DIR}/QtNetwork)
- IF( NOT QT_QTNETWORK_INCLUDE_DIR )
- IF( NOT Qt_FIND_QUIETLY)
- MESSAGE( STATUS "Could not find ${QT_INCLUDE_DIR}/QtNetwork")
- ENDIF( NOT Qt_FIND_QUIETLY)
- ENDIF( NOT QT_QTNETWORK_INCLUDE_DIR )
-ENDIF(NOT QT_QTNETWORK_INCLUDE_DIR)
+FIND_PATH( QT_QTNETWORK_INCLUDE_DIR QtNetwork
+ ${QT_INCLUDE_DIR}/QtNetwork
+ ${QT_LIBRARY_DIR}/QtNetwork.framework/Headers
+ )
# Set QT_QTNSPLUGIN_INCLUDE_DIR
-IF(NOT QT_QTNSPLUGIN_INCLUDE_DIR)
- FIND_PATH( QT_QTNSPLUGIN_INCLUDE_DIR QtNsPlugin ${QT_INCLUDE_DIR}/QtNsPlugin)
- IF( NOT QT_QTNSPLUGIN_INCLUDE_DIR )
- IF( NOT Qt_FIND_QUIETLY)
- MESSAGE( STATUS "Could not find ${QT_INCLUDE_DIR}/QtNsPlugin")
- ENDIF( NOT Qt_FIND_QUIETLY)
- ENDIF( NOT QT_QTNSPLUGIN_INCLUDE_DIR )
-ENDIF(NOT QT_QTNSPLUGIN_INCLUDE_DIR)
+FIND_PATH( QT_QTNSPLUGIN_INCLUDE_DIR QtNsPlugin
+ ${QT_INCLUDE_DIR}/QtNsPlugin
+ ${QT_LIBRARY_DIR}/QtNsPlugin.framework/Headers
+ )
# Set QT_QTOPENGL_INCLUDE_DIR
-IF(NOT QT_QTOPENGL_INCLUDE_DIR)
- FIND_PATH( QT_QTOPENGL_INCLUDE_DIR QtOpenGL ${QT_INCLUDE_DIR}/QtOpenGL)
- IF( NOT QT_QTOPENGL_INCLUDE_DIR )
- IF( NOT Qt_FIND_QUIETLY)
- MESSAGE( STATUS "Could not find ${QT_INCLUDE_DIR}/QtOpenGL")
- ENDIF( NOT Qt_FIND_QUIETLY)
- ENDIF( NOT QT_QTOPENGL_INCLUDE_DIR )
-ENDIF(NOT QT_QTOPENGL_INCLUDE_DIR)
+FIND_PATH( QT_QTOPENGL_INCLUDE_DIR QtOpenGL
+ ${QT_INCLUDE_DIR}/QtOpenGL
+ ${QT_LIBRARY_DIR}/QtOpenGL.framework/Headers
+ )
# Set QT_QTSQL_INCLUDE_DIR
-IF(NOT QT_QTSQL_INCLUDE_DIR)
- FIND_PATH( QT_QTSQL_INCLUDE_DIR QtSql ${QT_INCLUDE_DIR}/QtSql)
- IF( NOT QT_QTSQL_INCLUDE_DIR )
- IF( NOT Qt_FIND_QUIETLY)
- MESSAGE( STATUS "Could not find ${QT_INCLUDE_DIR}/QtSql")
- ENDIF( NOT Qt_FIND_QUIETLY)
- ENDIF( NOT QT_QTSQL_INCLUDE_DIR )
-ENDIF(NOT QT_QTSQL_INCLUDE_DIR)
-
+FIND_PATH( QT_QTSQL_INCLUDE_DIR QtSql
+ ${QT_INCLUDE_DIR}/QtSql
+ ${QT_LIBRARY_DIR}/QtSql.framework/Headers
+ )
# Set QT_QTXML_INCLUDE_DIR
-IF(NOT QT_QTXML_INCLUDE_DIR)
- FIND_PATH( QT_QTXML_INCLUDE_DIR QtXml ${QT_INCLUDE_DIR}/QtXml)
- IF( NOT QT_QTXML_INCLUDE_DIR )
- IF( NOT Qt_FIND_QUIETLY)
- MESSAGE( STATUS "Could not find ${QT_INCLUDE_DIR}/QtXml")
- ENDIF( NOT Qt_FIND_QUIETLY)
- ENDIF( NOT QT_QTXML_INCLUDE_DIR )
-ENDIF(NOT QT_QTXML_INCLUDE_DIR)
+FIND_PATH( QT_QTXML_INCLUDE_DIR QtXml
+ ${QT_INCLUDE_DIR}/QtXml
+ ${QT_LIBRARY_DIR}/QtXml.framework/Headers
+ )
+
+# Set QT_QTASSISTANT_INCLUDE_DIR
+FIND_PATH( QT_QTASSISTANT_INCLUDE_DIR QtAssistant
+ ${QT_INCLUDE_DIR}/QtAssistant
+ ${QT_HEADERS_DIR}/QtAssistant
+ )
+
+# Set QT_QTDESIGNER_INCLUDE_DIR
+FIND_PATH( QT_QTDESIGNER_INCLUDE_DIR QDesignerComponents
+ ${QT_INCLUDE_DIR}/QtDesigner
+ ${QT_HEADERS_DIR}/QtDesigner
+ )
# Make variables changeble to the advanced user
MARK_AS_ADVANCED(
@@ -258,6 +274,7 @@ SET( QT_INCLUDES
${QT_QTASSISTANT_INCLUDE_DIR}
${QT_QTCORE_INCLUDE_DIR}
${QT_QTDESIGNER_INCLUDE_DIR}
+ ${QT_QTDESIGNER_INCLUDE_DIR}/..
${QT_QTGUI_INCLUDE_DIR}
${QT_QTMOTIF_INCLUDE_DIR}
${QT_QTNETWORK_INCLUDE_DIR}
@@ -272,17 +289,46 @@ SET( QT_INCLUDES
# Setting the LIBRARY-Variables
#
########################################
-IF(NOT QT_QTCORE_LIBRARY)
- IF(QT_QMAKE_EXECUTABLE)
- EXEC_PROGRAM( ${QT_QMAKE_EXECUTABLE}
- ARGS "-query QT_INSTALL_LIBS"
- OUTPUT_VARIABLE qt_libs )
- ENDIF(QT_QMAKE_EXECUTABLE)
- # Set QT_QTCORE_LIBRARY by searching for a lib with "QtCore." as part of the filename
+
+IF (QT_USE_FRAMEWORKS)
+ # If FIND_LIBRARY found libraries in Apple frameworks, we would not have
+ # to jump through these hoops.
+ SET(QT_QTCORE_LIBRARY "-F${QT_LIBRARY_DIR} -framework QtCore"
+ CACHE STRING "The QtCore library.")
+ SET(QT_QTCORE_LIBRARY_DEBUG "-F${QT_LIBRARY_DIR} -framework QtCore"
+ CACHE STRING "The QtCore library.")
+ SET(QT_QT3SUPPORT_LIBRARY "-framework Qt3Support"
+ CACHE STRING "The Qt3Support library.")
+ SET(QT_QT3SUPPORT_LIBRARY_DEBUG "-framework Qt3Support"
+ CACHE STRING "The Qt3Support library.")
+ SET(QT_QTGUI_LIBRARY "-framework QtGui"
+ CACHE STRING "The QtGui library.")
+ SET(QT_QTGUI_LIBRARY_DEBUG "-framework QtGui"
+ CACHE STRING "The QtGui library.")
+ SET(QT_QTNETWORK_LIBRARY "-framework QtNetwork"
+ CACHE STRING "The QtNetwork library.")
+ SET(QT_QTNETWORK_LIBRARY_DEBUG "-framework QtNetwork"
+ CACHE STRING "The QtNetwork library.")
+ SET(QT_QTOPENGL_LIBRARY "-framework QtOpenGL"
+ CACHE STRING "The QtOpenGL library.")
+ SET(QT_QTOPENGL_LIBRARY_GUI "-framework QtOpenGL"
+ CACHE STRING "The QtOpenGL library.")
+ SET(QT_QTSQL_LIBRARY "-framework QtSql"
+ CACHE STRING "The QtSql library.")
+ SET(QT_QTSQL_LIBRARY_DEBUG "-framework QtSql"
+ CACHE STRING "The QtSql library.")
+ SET(QT_QTXML_LIBRARY "-framework QtXml"
+ CACHE STRING "The QtXml library.")
+ SET(QT_QTXML_LIBRARY_DEBUG "-framework QtXml"
+ CACHE STRING "The QtXml library.")
+ELSE (QT_USE_FRAMEWORKS)
+
+ # Set QT_QTCORE_LIBRARY by searching for a lib with "QtCore." as part of
+ # the filename
FIND_LIBRARY( QT_QTCORE_LIBRARY
NAMES QtCore QtCore4
PATHS
- ${qt_libs}
+ ${QT_LIBRARY_DIR}
$ENV{QTDIR}/lib
/usr/local/qt/lib
/usr/local/lib
@@ -291,19 +337,13 @@ IF(NOT QT_QTCORE_LIBRARY)
/usr/share/qt4/lib
C:/Progra~1/qt/lib
/usr/lib/qt4 )
-ENDIF(NOT QT_QTCORE_LIBRARY)
-# Set QT_QTCORE_LIBRARY_DEBUG by searching for a lib with "QtCore_debug" as part of the filename
-IF(NOT QT_QTCORE_LIBRARY_DEBUG)
- IF(QT_QMAKE_EXECUTABLE)
- EXEC_PROGRAM( ${QT_QMAKE_EXECUTABLE}
- ARGS "-query QT_INSTALL_LIBS"
- OUTPUT_VARIABLE qt_libs )
- ENDIF(QT_QMAKE_EXECUTABLE)
+ # Set QT_QTCORE_LIBRARY_DEBUG by searching for a lib with "QtCore_debug"
+ # as part of the filename
FIND_LIBRARY( QT_QTCORE_LIBRARY_DEBUG
NAMES QtCore_debug QtCored4
PATHS
- ${qt_libs}
+ ${QT_LIBRARY_DIR}
$ENV{QTDIR}/lib
/usr/local/qt/lib
/usr/local/lib
@@ -312,95 +352,48 @@ IF(NOT QT_QTCORE_LIBRARY_DEBUG)
/usr/share/qt4/lib
C:/Progra~1/qt/lib
/usr/lib/qt4 )
-ENDIF(NOT QT_QTCORE_LIBRARY_DEBUG)
-# Set QT_LIBRARY_DIR
-IF(NOT QT_LIBRARY_DIR)
- EXEC_PROGRAM( ${QT_QMAKE_EXECUTABLE}
- ARGS "-query QT_INSTALL_LIBS"
- OUTPUT_VARIABLE QT_LIBRARY_DIR_TMP )
- SET(QT_LIBRARY_DIR ${QT_LIBRARY_DIR_TMP} CACHE PATH "Qt library dir")
-ENDIF(NOT QT_LIBRARY_DIR)
-
-# Set QT_QT3SUPPORT_LIBRARY
-IF(NOT QT_QT3SUPPORT_LIBRARY)
+ # Set QT_QT3SUPPORT_LIBRARY
FIND_LIBRARY(QT_QT3SUPPORT_LIBRARY NAMES Qt3Support Qt3Support4 PATHS ${QT_LIBRARY_DIR})
-ENDIF(NOT QT_QT3SUPPORT_LIBRARY)
-IF(NOT QT_QT3SUPPORT_LIBRARY_DEBUG)
FIND_LIBRARY(QT_QT3SUPPORT_LIBRARY_DEBUG NAMES Qt3Support_debug Qt3Supportd4 PATHS ${QT_LIBRARY_DIR})
-ENDIF(NOT QT_QT3SUPPORT_LIBRARY_DEBUG)
-
-# Set QT_QTASSISTANT_LIBRARY
-IF(NOT QT_QTASSISTANT_LIBRARY)
- FIND_LIBRARY(QT_QTASSISTANT_LIBRARY NAMES QtAssistant QtAssistant4 PATHS ${QT_LIBRARY_DIR})
-ENDIF(NOT QT_QTASSISTANT_LIBRARY)
-IF(NOT QT_QTASSISTANT_LIBRARY_DEBUG)
- FIND_LIBRARY(QT_QTASSISTANT_LIBRARY_DEBUG NAMES QtAssistant_debug QtAssistantd4 PATHS ${QT_LIBRARY_DIR})
-ENDIF(NOT QT_QTASSISTANT_LIBRARY_DEBUG)
-# Set QT_QTDESIGNER_LIBRARY
-IF(NOT QT_QTDESIGNER_LIBRARY)
- FIND_LIBRARY(QT_QTDESIGNER_LIBRARY NAMES QtDesigner QtDesigner4 PATHS ${QT_LIBRARY_DIR})
-ENDIF(NOT QT_QTDESIGNER_LIBRARY)
-IF(NOT QT_QTDESIGNER_LIBRARY_DEBUG)
- FIND_LIBRARY(QT_QTDESIGNER_LIBRARY_DEBUG NAMES QtDesigner_debug QtDesignerd4 PATHS ${QT_LIBRARY_DIR})
-ENDIF(NOT QT_QTDESIGNER_LIBRARY_DEBUG)
-
-# Set QT_QTGUI_LIBRARY
-IF(NOT QT_QTGUI_LIBRARY)
+ # Set QT_QTGUI_LIBRARY
FIND_LIBRARY(QT_QTGUI_LIBRARY NAMES QtGui QtGui4 PATHS ${QT_LIBRARY_DIR})
-ENDIF(NOT QT_QTGUI_LIBRARY)
-IF(NOT QT_QTGUI_LIBRARY_DEBUG)
FIND_LIBRARY(QT_QTGUI_LIBRARY_DEBUG NAMES QtGui_debug QtGuid4 PATHS ${QT_LIBRARY_DIR})
-ENDIF(NOT QT_QTGUI_LIBRARY_DEBUG)
-# Set QT_QTMOTIF_LIBRARY
-IF(NOT QT_QTMOTIF_LIBRARY)
+ # Set QT_QTMOTIF_LIBRARY
FIND_LIBRARY(QT_QTMOTIF_LIBRARY NAMES QtMotif PATHS ${QT_LIBRARY_DIR})
-ENDIF(NOT QT_QTMOTIF_LIBRARY)
-IF(NOT QT_QTMOTIF_LIBRARY_DEBUG)
FIND_LIBRARY(QT_QTMOTIF_LIBRARY_DEBUG NAMES QtMotif_debug PATHS ${QT_LIBRARY_DIR})
-ENDIF(NOT QT_QTMOTIF_LIBRARY_DEBUG)
-# Set QT_QTNETWORK_LIBRARY
-IF(NOT QT_QTNETWORK_LIBRARY)
+ # Set QT_QTNETWORK_LIBRARY
FIND_LIBRARY(QT_QTNETWORK_LIBRARY NAMES QtNetwork QtNetwork4 PATHS ${QT_LIBRARY_DIR})
-ENDIF(NOT QT_QTNETWORK_LIBRARY)
-IF(NOT QT_QTNETWORK_LIBRARY_DEBUG)
FIND_LIBRARY(QT_QTNETWORK_LIBRARY_DEBUG NAMES QtNetwork_debug QtNetworkd4 PATHS ${QT_LIBRARY_DIR})
-ENDIF(NOT QT_QTNETWORK_LIBRARY_DEBUG)
-# Set QT_QTNSPLUGIN_LIBRARY
-IF(NOT QT_QTNSPLUGIN_LIBRARY)
+ # Set QT_QTNSPLUGIN_LIBRARY
FIND_LIBRARY(QT_QTNSPLUGIN_LIBRARY NAMES QtNsPlugin PATHS ${QT_LIBRARY_DIR})
-ENDIF(NOT QT_QTNSPLUGIN_LIBRARY)
-IF(NOT QT_QTNSPLUGIN_LIBRARY_DEBUG)
FIND_LIBRARY(QT_QTNSPLUGIN_LIBRARY_DEBUG NAMES QtNsPlugin_debug PATHS ${QT_LIBRARY_DIR})
-ENDIF(NOT QT_QTNSPLUGIN_LIBRARY_DEBUG)
-# Set QT_QTOPENGL_LIBRARY
-IF(NOT QT_QTOPENGL_LIBRARY)
+ # Set QT_QTOPENGL_LIBRARY
FIND_LIBRARY(QT_QTOPENGL_LIBRARY NAMES QtOpenGL QtOpenGL4 PATHS ${QT_LIBRARY_DIR})
-ENDIF(NOT QT_QTOPENGL_LIBRARY)
-IF(NOT QT_QTOPENGL_LIBRARY_DEBUG)
FIND_LIBRARY(QT_QTOPENGL_LIBRARY_DEBUG NAMES QtOpenGL_debug QtOpenGLd4 PATHS ${QT_LIBRARY_DIR})
-ENDIF(NOT QT_QTOPENGL_LIBRARY_DEBUG)
-# Set QT_QTSQL_LIBRARY
-IF(NOT QT_QTSQL_LIBRARY)
+ # Set QT_QTSQL_LIBRARY
FIND_LIBRARY(QT_QTSQL_LIBRARY NAMES QtSql QtSql4 PATHS ${QT_LIBRARY_DIR})
-ENDIF(NOT QT_QTSQL_LIBRARY)
-IF(NOT QT_QTSQL_LIBRARY_DEBUG)
FIND_LIBRARY(QT_QTSQL_LIBRARY_DEBUG NAMES QtSql_debug QtSqld4 PATHS ${QT_LIBRARY_DIR})
-ENDIF(NOT QT_QTSQL_LIBRARY_DEBUG)
-# Set QT_QTXML_LIBRARY
-IF(NOT QT_QTXML_LIBRARY)
+ # Set QT_QTXML_LIBRARY
FIND_LIBRARY(QT_QTXML_LIBRARY NAMES QtXml QtXml4 PATHS ${QT_LIBRARY_DIR})
-ENDIF(NOT QT_QTXML_LIBRARY)
-IF(NOT QT_QTXML_LIBRARY_DEBUG)
FIND_LIBRARY(QT_QTXML_LIBRARY_DEBUG NAMES QtXml_debug QtXmld4 PATHS ${QT_LIBRARY_DIR})
-ENDIF(NOT QT_QTXML_LIBRARY_DEBUG)
+
+ENDIF (QT_USE_FRAMEWORKS)
+
+# Set QT_QTASSISTANT_LIBRARY
+FIND_LIBRARY(QT_QTASSISTANT_LIBRARY NAMES QtAssistant QtAssistant4 PATHS ${QT_LIBRARY_DIR})
+FIND_LIBRARY(QT_QTASSISTANT_LIBRARY_DEBUG NAMES QtAssistant_debug QtAssistantd4 PATHS ${QT_LIBRARY_DIR})
+
+# Set QT_QTDESIGNER_LIBRARY
+FIND_LIBRARY(QT_QTDESIGNER_LIBRARY NAMES QtDesigner QtDesigner4 PATHS ${QT_LIBRARY_DIR})
+FIND_LIBRARY(QT_QTDESIGNER_LIBRARY_DEBUG NAMES QtDesigner_debug QtDesignerd4 PATHS ${QT_LIBRARY_DIR})
# Make variables changeble to the advanced user
MARK_AS_ADVANCED(
@@ -416,20 +409,6 @@ MARK_AS_ADVANCED(
QT_QTSQL_LIBRARY
QT_QTXML_LIBRARY )
-# Set QT_LIBRARIES
-SET( QT_LIBRARIES
- ${QT_QT3SUPPORT_LIBRARY}
- ${QT_QTASSISTANT_LIBRARY}
- ${QT_QTCORE_LIBRARY}
- ${QT_QTDESIGNER_LIBRARY}
- ${QT_QTGUI_LIBRARY}
- ${QT_QTMOTIF_LIBRARY}
- ${QT_QTNETWORK_LIBRARY}
- ${QT_QTNSPLUGIN_LIBRARY}
- ${QT_QTOPENGL_LIBRARY}
- ${QT_QTSQL_LIBRARY}
- ${QT_QTXML_LIBRARY} )
-
# Make variables changeble to the advanced user
MARK_AS_ADVANCED(
QT_QT3SUPPORT_LIBRARY_DEBUG
@@ -444,202 +423,88 @@ MARK_AS_ADVANCED(
QT_QTSQL_LIBRARY_DEBUG
QT_QTXML_LIBRARY_DEBUG )
-# Set QT_LIBRARIES_DEBUG
-SET( QT_LIBRARIES_DEBUG
- ${QT_QT3SUPPORT_LIBRARY_DEBUG}
- ${QT_QTASSISTANT_LIBRARY_DEBUG}
- ${QT_QTCORE_LIBRARY_DEBUG}
- ${QT_QTDESIGNER_LIBRARY_DEBUG}
- ${QT_QTGUI_LIBRARY_DEBUG}
- ${QT_QTMOTIF_LIBRARY_DEBUG}
- ${QT_QTNETWORK_LIBRARY_DEBUG}
- ${QT_QTNSPLUGIN_LIBRARY_DEBUG}
- ${QT_QTOPENGL_LIBRARY_DEBUG}
- ${QT_QTSQL_LIBRARY_DEBUG}
- ${QT_QTXML_LIBRARY_DEBUG} )
-
-# Set QT_LIBRARIES_TRYOPTIMIZED
-IF(NOT QT_LIBRARIES_TRYOPTIMIZED)
- IF(QT_QT3SUPPORT_LIBRARY)
- SET( QT_LIBRARIES_TRYOPTIMIZED ${QT_LIBRARIES_TRYOPTIMIZED} ${QT_QT3SUPPORT_LIBRARY} )
- ELSE(QT_QT3SUPPORT_LIBRARY)
- IF(QT_QT3SUPPORT_LIBRARY_DEBUG)
- SET( QT_LIBRARIES_TRYOPTIMIZED ${QT_LIBRARIES_TRYOPTIMIZED} ${QT_QT3SUPPORT_LIBRARY_DEBUG} )
- ENDIF(QT_QT3SUPPORT_LIBRARY_DEBUG)
- ENDIF(QT_QT3SUPPORT_LIBRARY)
-
- IF(QT_QTASSISTANT_LIBRARY)
- SET( QT_LIBRARIES_TRYOPTIMIZED ${QT_LIBRARIES_TRYOPTIMIZED} ${QT_QTASSISTANT_LIBRARY} )
- ELSE(QT_QTASSISTANT_LIBRARY)
- IF(QT_QTASSISTANT_LIBRARY_DEBUG)
- SET( QT_LIBRARIES_TRYOPTIMIZED ${QT_LIBRARIES_TRYOPTIMIZED} ${QT_QTASSISTANT_LIBRARY_DEBUG} )
- ENDIF(QT_QTASSISTANT_LIBRARY_DEBUG)
- ENDIF(QT_QTASSISTANT_LIBRARY)
-
- IF(QT_QTCORE_LIBRARY)
- SET( QT_LIBRARIES_TRYOPTIMIZED ${QT_LIBRARIES_TRYOPTIMIZED} ${QT_QTCORE_LIBRARY} )
- ELSE(QT_QTCORE_LIBRARY)
- IF(QT_QTCORE_LIBRARY_DEBUG)
- SET( QT_LIBRARIES_TRYOPTIMIZED ${QT_LIBRARIES_TRYOPTIMIZED} ${QT_QTCORE_LIBRARY_DEBUG} )
- ENDIF(QT_QTCORE_LIBRARY_DEBUG)
- ENDIF(QT_QTCORE_LIBRARY)
-
- IF(QT_QTDESIGNER_LIBRARY)
- SET( QT_LIBRARIES_TRYOPTIMIZED ${QT_LIBRARIES_TRYOPTIMIZED} ${QT_QTDESIGNER_LIBRARY} )
- ELSE(QT_QTDESIGNER_LIBRARY)
- IF(QT_QTDESIGNER_LIBRARY_DEBUG)
- SET( QT_LIBRARIES_TRYOPTIMIZED ${QT_LIBRARIES_TRYOPTIMIZED} ${QT_QTDESIGNER_LIBRARY_DEBUG} )
- ENDIF(QT_QTDESIGNER_LIBRARY_DEBUG)
- ENDIF(QT_QTDESIGNER_LIBRARY)
-
- IF(QT_QTGUI_LIBRARY)
- SET( QT_LIBRARIES_TRYOPTIMIZED ${QT_LIBRARIES_TRYOPTIMIZED} ${QT_QTGUI_LIBRARY} )
- ELSE(QT_QTGUI_LIBRARY)
- IF(QT_QTGUI_LIBRARY_DEBUG)
- SET( QT_LIBRARIES_TRYOPTIMIZED ${QT_LIBRARIES_TRYOPTIMIZED} ${QT_QTGUI_LIBRARY_DEBUG} )
- ENDIF(QT_QTGUI_LIBRARY_DEBUG)
- ENDIF(QT_QTGUI_LIBRARY)
-
- IF(QT_QTMOTIF_LIBRARY)
- SET( QT_LIBRARIES_TRYOPTIMIZED ${QT_LIBRARIES_TRYOPTIMIZED} ${QT_QTMOTIF_LIBRARY} )
- ELSE(QT_QTMOTIF_LIBRARY)
- IF(QT_QTMOTIF_LIBRARY_DEBUG)
- SET( QT_LIBRARIES_TRYOPTIMIZED ${QT_LIBRARIES_TRYOPTIMIZED} ${QT_QTMOTIF_LIBRARY_DEBUG} )
- ENDIF(QT_QTMOTIF_LIBRARY_DEBUG)
- ENDIF(QT_QTMOTIF_LIBRARY)
-
- IF(QT_QTNETWORK_LIBRARY)
- SET( QT_LIBRARIES_TRYOPTIMIZED ${QT_LIBRARIES_TRYOPTIMIZED} ${QT_QTNETWORK_LIBRARY} )
- ELSE(QT_QTNETWORK_LIBRARY)
- IF(QT_QTNETWORK_LIBRARY_DEBUG)
- SET( QT_LIBRARIES_TRYOPTIMIZED ${QT_LIBRARIES_TRYOPTIMIZED} ${QT_QTNETWORK_LIBRARY_DEBUG} )
- ENDIF(QT_QTNETWORK_LIBRARY_DEBUG)
- ENDIF(QT_QTNETWORK_LIBRARY)
-
- IF(QT_QTNSPLUGIN_LIBRARY)
- SET( QT_LIBRARIES_TRYOPTIMIZED ${QT_LIBRARIES_TRYOPTIMIZED} ${QT_QTNSPLUGIN_LIBRARY} )
- ELSE(QT_QTNSPLUGIN_LIBRARY)
- IF(QT_QTNSPLUGIN_LIBRARY_DEBUG)
- SET( QT_LIBRARIES_TRYOPTIMIZED ${QT_LIBRARIES_TRYOPTIMIZED} ${QT_QTNSPLUGIN_LIBRARY_DEBUG} )
- ENDIF(QT_QTNSPLUGIN_LIBRARY_DEBUG)
- ENDIF(QT_QTNSPLUGIN_LIBRARY)
-
- IF(QT_QTOPENGL_LIBRARY)
- SET( QT_LIBRARIES_TRYOPTIMIZED ${QT_LIBRARIES_TRYOPTIMIZED} ${QT_QTOPENGL_LIBRARY} )
- ELSE(QT_QTOPENGL_LIBRARY)
- IF(QT_QTOPENGL_LIBRARY_DEBUG)
- SET( QT_LIBRARIES_TRYOPTIMIZED ${QT_LIBRARIES_TRYOPTIMIZED} ${QT_QTOPENGL_LIBRARY_DEBUG} )
- ENDIF(QT_QTOPENGL_LIBRARY_DEBUG)
- ENDIF(QT_QTOPENGL_LIBRARY)
-
- IF(QT_QTSQL_LIBRARY)
- SET( QT_LIBRARIES_TRYOPTIMIZED ${QT_LIBRARIES_TRYOPTIMIZED} ${QT_QTSQL_LIBRARY} )
- ELSE(QT_QTSQL_LIBRARY)
- IF(QT_QTSQL_LIBRARY_DEBUG)
- SET( QT_LIBRARIES_TRYOPTIMIZED ${QT_LIBRARIES_TRYOPTIMIZED} ${QT_QTSQL_LIBRARY_DEBUG} )
- ENDIF(QT_QTSQL_LIBRARY_DEBUG)
- ENDIF(QT_QTSQL_LIBRARY)
-
- IF(QT_QTXML_LIBRARY)
- SET( QT_LIBRARIES_TRYOPTIMIZED ${QT_LIBRARIES_TRYOPTIMIZED} ${QT_QTXML_LIBRARY} )
- ELSE(QT_QTXML_LIBRARY)
- IF(QT_QTXML_LIBRARY_DEBUG)
- SET( QT_LIBRARIES_TRYOPTIMIZED ${QT_LIBRARIES_TRYOPTIMIZED} ${QT_QTXML_LIBRARY_DEBUG} )
- ENDIF(QT_QTXML_LIBRARY_DEBUG)
- ENDIF(QT_QTXML_LIBRARY)
-ENDIF(NOT QT_LIBRARIES_TRYOPTIMIZED)
-
-# Set QT_LIBRARIES_TRYDEBUG
-IF(NOT QT_LIBRARIES_TRYDEBUG)
- IF(QT_QT3SUPPORT_LIBRARY_DEBUG)
- SET( QT_LIBRARIES_TRYDEBUG ${QT_LIBRARIES_TRYDEBUG} ${QT_QT3SUPPORT_LIBRARY_DEBUG} )
- ELSE(QT_QT3SUPPORT_LIBRARY_DEBUG)
- IF(QT_QT3SUPPORT_LIBRARY)
- SET( QT_LIBRARIES_TRYDEBUG ${QT_LIBRARIES_TRYDEBUG} ${QT_QT3SUPPORT_LIBRARY} )
- ENDIF(QT_QT3SUPPORT_LIBRARY)
- ENDIF(QT_QT3SUPPORT_LIBRARY_DEBUG)
-
- IF(QT_QTASSISTANT_LIBRARY_DEBUG)
- SET( QT_LIBRARIES_TRYDEBUG ${QT_LIBRARIES_TRYDEBUG} ${QT_QTASSISTANT_LIBRARY_DEBUG} )
- ELSE(QT_QTASSISTANT_LIBRARY_DEBUG)
- IF(QT_QTASSISTANT_LIBRARY)
- SET( QT_LIBRARIES_TRYDEBUG ${QT_LIBRARIES_TRYDEBUG} ${QT_QTASSISTANT_LIBRARY} )
- ENDIF(QT_QTASSISTANT_LIBRARY)
- ENDIF(QT_QTASSISTANT_LIBRARY_DEBUG)
-
- IF(QT_QTCORE_LIBRARY_DEBUG)
- SET( QT_LIBRARIES_TRYDEBUG ${QT_LIBRARIES_TRYDEBUG} ${QT_QTCORE_LIBRARY_DEBUG} )
- ELSE(QT_QTCORE_LIBRARY_DEBUG)
- IF(QT_QTCORE_LIBRARY)
- SET( QT_LIBRARIES_TRYDEBUG ${QT_LIBRARIES_TRYDEBUG} ${QT_QTCORE_LIBRARY} )
- ENDIF(QT_QTCORE_LIBRARY)
- ENDIF(QT_QTCORE_LIBRARY_DEBUG)
-
- IF(QT_QTDESIGNER_LIBRARY_DEBUG)
- SET( QT_LIBRARIES_TRYDEBUG ${QT_LIBRARIES_TRYDEBUG} ${QT_QTDESIGNER_LIBRARY_DEBUG} )
- ELSE(QT_QTDESIGNER_LIBRARY_DEBUG)
- IF(QT_QTDESIGNER_LIBRARY)
- SET( QT_LIBRARIES_TRYDEBUG ${QT_LIBRARIES_TRYDEBUG} ${QT_QTDESIGNER_LIBRARY} )
- ENDIF(QT_QTDESIGNER_LIBRARY)
- ENDIF(QT_QTDESIGNER_LIBRARY_DEBUG)
-
- IF(QT_QTGUI_LIBRARY_DEBUG)
- SET( QT_LIBRARIES_TRYDEBUG ${QT_LIBRARIES_TRYDEBUG} ${QT_QTGUI_LIBRARY_DEBUG} )
- ELSE(QT_QTGUI_LIBRARY_DEBUG)
- IF(QT_QTGUI_LIBRARY)
- SET( QT_LIBRARIES_TRYDEBUG ${QT_LIBRARIES_TRYDEBUG} ${QT_QTGUI_LIBRARY} )
- ENDIF(QT_QTGUI_LIBRARY)
- ENDIF(QT_QTGUI_LIBRARY_DEBUG)
-
- IF(QT_QTMOTIF_LIBRARY_DEBUG)
- SET( QT_LIBRARIES_TRYDEBUG ${QT_LIBRARIES_TRYDEBUG} ${QT_QTMOTIF_LIBRARY_DEBUG} )
- ELSE(QT_QTMOTIF_LIBRARY_DEBUG)
- IF(QT_QTMOTIF_LIBRARY)
- SET( QT_LIBRARIES_TRYDEBUG ${QT_LIBRARIES_TRYDEBUG} ${QT_QTMOTIF_LIBRARY} )
- ENDIF(QT_QTMOTIF_LIBRARY)
- ENDIF(QT_QTMOTIF_LIBRARY_DEBUG)
-
- IF(QT_QTNETWORK_LIBRARY_DEBUG)
- SET( QT_LIBRARIES_TRYDEBUG ${QT_LIBRARIES_TRYDEBUG} ${QT_QTNETWORK_LIBRARY_DEBUG} )
- ELSE(QT_QTNETWORK_LIBRARY_DEBUG)
- IF(QT_QTNETWORK_LIBRARY)
- SET( QT_LIBRARIES_TRYDEBUG ${QT_LIBRARIES_TRYDEBUG} ${QT_QTNETWORK_LIBRARY} )
- ENDIF(QT_QTNETWORK_LIBRARY)
- ENDIF(QT_QTNETWORK_LIBRARY_DEBUG)
-
- IF(QT_QTNSPLUGIN_LIBRARY_DEBUG)
- SET( QT_LIBRARIES_TRYDEBUG ${QT_LIBRARIES_TRYDEBUG} ${QT_QTNSPLUGIN_LIBRARY_DEBUG} )
- ELSE(QT_QTNSPLUGIN_LIBRARY_DEBUG)
- IF(QT_QTNSPLUGIN_LIBRARY)
- SET( QT_LIBRARIES_TRYDEBUG ${QT_LIBRARIES_TRYDEBUG} ${QT_QTNSPLUGIN_LIBRARY} )
- ENDIF(QT_QTNSPLUGIN_LIBRARY)
- ENDIF(QT_QTNSPLUGIN_LIBRARY_DEBUG)
-
- IF(QT_QTOPENGL_LIBRARY_DEBUG)
- SET( QT_LIBRARIES_TRYDEBUG ${QT_LIBRARIES_TRYDEBUG} ${QT_QTOPENGL_LIBRARY_DEBUG} )
- ELSE(QT_QTOPENGL_LIBRARY_DEBUG)
- IF(QT_QTOPENGL_LIBRARY)
- SET( QT_LIBRARIES_TRYDEBUG ${QT_LIBRARIES_TRYDEBUG} ${QT_QTOPENGL_LIBRARY} )
- ENDIF(QT_QTOPENGL_LIBRARY)
- ENDIF(QT_QTOPENGL_LIBRARY_DEBUG)
-
- IF(QT_QTSQL_LIBRARY_DEBUG)
- SET( QT_LIBRARIES_TRYDEBUG ${QT_LIBRARIES_TRYDEBUG} ${QT_QTSQL_LIBRARY_DEBUG} )
- ELSE(QT_QTSQL_LIBRARY_DEBUG)
- IF(QT_QTSQL_LIBRARY)
- SET( QT_LIBRARIES_TRYDEBUG ${QT_LIBRARIES_TRYDEBUG} ${QT_QTSQL_LIBRARY} )
- ENDIF(QT_QTSQL_LIBRARY)
- ENDIF(QT_QTSQL_LIBRARY_DEBUG)
-
- IF(QT_QTXML_LIBRARY_DEBUG)
- SET( QT_LIBRARIES_TRYDEBUG ${QT_LIBRARIES_TRYDEBUG} ${QT_QTXML_LIBRARY_DEBUG} )
- ELSE(QT_QTXML_LIBRARY_DEBUG)
- IF(QT_QTXML_LIBRARY)
- SET( QT_LIBRARIES_TRYDEBUG ${QT_LIBRARIES_TRYDEBUG} ${QT_QTXML_LIBRARY} )
- ENDIF(QT_QTXML_LIBRARY)
- ENDIF(QT_QTXML_LIBRARY_DEBUG)
-ENDIF(NOT QT_LIBRARIES_TRYDEBUG)
-
+############################################
+#
+# Check the existence of the libraries.
+#
+############################################
+
+IF (QT_QTCORE_INCLUDE_DIR AND QT_QTCORE_LIBRARY)
+ SET(QT_QTCORE_FOUND 1)
+ IF (NOT QT_QTCORE_LIBRARY_DEBUG)
+ SET(QT_QTCORE_LIBRARY_DEBUG ${QT_QTCORE_LIBRARY})
+ ENDIF (NOT QT_QTCORE_LIBRARY_DEBUG)
+ENDIF (QT_QTCORE_INCLUDE_DIR AND QT_QTCORE_LIBRARY)
+
+IF (QT_QTGUI_INCLUDE_DIR AND QT_QTGUI_LIBRARY)
+ SET(QT_QTGUI_FOUND 1)
+ IF (NOT QT_QTGUI_LIBRARY_DEBUG)
+ SET(QT_QTGUI_LIBRARY_DEBUG ${QT_QTGUI_LIBRARY})
+ ENDIF (NOT QT_QTGUI_LIBRARY_DEBUG)
+ENDIF (QT_QTGUI_INCLUDE_DIR AND QT_QTGUI_LIBRARY)
+
+IF (QT_QT3SUPPORT_INCLUDE_DIR AND QT_QT3SUPPORT_LIBRARY)
+ SET(QT_QT3SUPPORT_FOUND 1)
+ IF (NOT QT_QT3SUPPORT_LIBRARY_DEBUG)
+ SET(QT_QT3SUPPORT_LIBRARY_DEBUG ${QT_QT3SUPPORT_LIBRARY})
+ ENDIF (NOT QT_QT3SUPPORT_LIBRARY_DEBUG)
+ENDIF (QT_QT3SUPPORT_INCLUDE_DIR AND QT_QT3SUPPORT_LIBRARY)
+
+IF (QT_QTASSISTANT_INCLUDE_DIR AND QT_QTASSISTANT_LIBRARY)
+ SET(QT_QTASSISTANT_FOUND 1)
+ IF (NOT QT_QTASSISTANT_LIBRARY_DEBUG)
+ SET(QT_QTASSISTANT_LIBRARY_DEBUG ${QT_QTASSISTANT_LIBRARY})
+ ENDIF (NOT QT_QTASSISTANT_LIBRARY_DEBUG)
+ENDIF (QT_QTASSISTANT_INCLUDE_DIR AND QT_QTASSISTANT_LIBRARY)
+
+IF (QT_QTDESIGNER_INCLUDE_DIR AND QT_QTDESIGNER_LIBRARY)
+ SET(QT_QTDESIGNER_FOUND 1)
+ IF (NOT QT_QTDESIGNER_LIBRARY_DEBUG)
+ SET(QT_QTDESIGNER_LIBRARY_DEBUG ${QT_QTDESIGNER_LIBRARY})
+ ENDIF (NOT QT_QTDESIGNER_LIBRARY_DEBUG)
+ENDIF (QT_QTDESIGNER_INCLUDE_DIR AND QT_QTDESIGNER_LIBRARY)
+
+IF (QT_QTMOTIF_INCLUDE_DIR AND QT_QTMOTIF_LIBRARY)
+ SET(QT_QTMOTIF_FOUND 1)
+ IF (NOT QT_QTMOTIF_LIBRARY_DEBUG)
+ SET(QT_QTMOTIF_LIBRARY_DEBUG ${QT_QTMOTIF_LIBRARY})
+ ENDIF (NOT QT_QTMOTIF_LIBRARY_DEBUG)
+ENDIF (QT_QTMOTIF_INCLUDE_DIR AND QT_QTMOTIF_LIBRARY)
+
+IF (QT_QTNETWORK_INCLUDE_DIR AND QT_QTNETWORK_LIBRARY)
+ SET(QT_QTNETWORK_FOUND 1)
+ IF (NOT QT_QTNETWORK_LIBRARY_DEBUG)
+ SET(QT_QTNETWORK_LIBRARY_DEBUG ${QT_QTNETWORK_LIBRARY})
+ ENDIF (NOT QT_QTNETWORK_LIBRARY_DEBUG)
+ENDIF (QT_QTNETWORK_INCLUDE_DIR AND QT_QTNETWORK_LIBRARY)
+
+IF (QT_QTNSPLUGIN_INCLUDE_DIR AND QT_QTNSPLUGIN_LIBRARY)
+ SET(QT_QTNSPLUGIN_FOUND 1)
+ IF (NOT QT_QTNSPLUGIN_LIBRARY_DEBUG)
+ SET(QT_QTNSPLUGIN_LIBRARY_DEBUG ${QT_QTNSPLUGIN_LIBRARY})
+ ENDIF (NOT QT_QTNSPLUGIN_LIBRARY_DEBUG)
+ENDIF (QT_QTNSPLUGIN_INCLUDE_DIR AND QT_QTNSPLUGIN_LIBRARY)
+
+IF (QT_QTOPENGL_INCLUDE_DIR AND QT_QTOPENGL_LIBRARY)
+ SET(QT_QTOPENGL_FOUND 1)
+ IF (NOT QT_QTOPENGL_LIBRARY_DEBUG)
+ SET(QT_QTOPENGL_LIBRARY_DEBUG ${QT_QTOPENGL_LIBRARY})
+ ENDIF (NOT QT_QTOPENGL_LIBRARY_DEBUG)
+ENDIF (QT_QTOPENGL_INCLUDE_DIR AND QT_QTOPENGL_LIBRARY)
+
+IF (QT_QTSQL_INCLUDE_DIR AND QT_QTSQL_LIBRARY)
+ SET(QT_QTSQL_FOUND 1)
+ IF (NOT QT_QTSQL_LIBRARY_DEBUG)
+ SET(QT_QTSQL_LIBRARY_DEBUG ${QT_QTSQL_LIBRARY})
+ ENDIF (NOT QT_QTSQL_LIBRARY_DEBUG)
+ENDIF (QT_QTSQL_INCLUDE_DIR AND QT_QTSQL_LIBRARY)
+
+IF (QT_QTXML_INCLUDE_DIR AND QT_QTXML_LIBRARY)
+ SET(QT_QTXML_FOUND 1)
+ IF (NOT QT_QTXML_LIBRARY_DEBUG)
+ SET(QT_QTXML_LIBRARY_DEBUG ${QT_QTXML_LIBRARY})
+ ENDIF (NOT QT_QTXML_LIBRARY_DEBUG)
+ENDIF (QT_QTXML_INCLUDE_DIR AND QT_QTXML_LIBRARY)
#######################################
#
@@ -647,78 +512,61 @@ ENDIF(NOT QT_LIBRARIES_TRYDEBUG)
# ( moc, uic, rcc )
#
#######################################
-IF(NOT QT_MOC_EXECUTABLE)
- IF(QT_QMAKE_EXECUTABLE)
- EXEC_PROGRAM( ${QT_QMAKE_EXECUTABLE}
- ARGS "-query QT_INSTALL_BINS"
- OUTPUT_VARIABLE qt_bins )
- ENDIF(QT_QMAKE_EXECUTABLE)
- FIND_PROGRAM(QT_MOC_EXECUTABLE
- NAMES moc
- PATHS
- ${qt_bins}
- $ENV{QTDIR}/bin
- /usr/local/qt/bin
- /usr/local/bin
- /usr/lib/qt/bin
- /usr/bin
- /usr/share/qt4/bin
- C:/Progra~1/qt/bin
- /usr/bin/qt4
- )
-ENDIF(NOT QT_MOC_EXECUTABLE)
+IF (NOT QT_BINARY_DIR)
+ EXEC_PROGRAM( ${QT_QMAKE_EXECUTABLE}
+ ARGS "-query QT_INSTALL_BINS"
+ OUTPUT_VARIABLE qt_bins )
+ SET(QT_BINARY_DIR ${qt_bins} CACHE INTERNAL "")
+ENDIF (NOT QT_BINARY_DIR)
+FIND_PROGRAM(QT_MOC_EXECUTABLE
+ NAMES moc
+ PATHS
+ ${QT_BINARY_DIR}
+ $ENV{QTDIR}/bin
+ /usr/local/qt/bin
+ /usr/local/bin
+ /usr/lib/qt/bin
+ /usr/bin
+ /usr/share/qt4/bin
+ C:/Progra~1/qt/bin
+ /usr/bin/qt4
+ )
IF(QT_MOC_EXECUTABLE)
SET ( QT_WRAP_CPP "YES")
-ELSE(QT_MOC_EXECUTABLE)
ENDIF(QT_MOC_EXECUTABLE)
-IF(NOT QT_UIC_EXECUTABLE )
- IF(QT_QMAKE_EXECUTABLE)
- EXEC_PROGRAM( ${QT_QMAKE_EXECUTABLE}
- ARGS "-query QT_INSTALL_BINS"
- OUTPUT_VARIABLE qt_bins )
- ENDIF(QT_QMAKE_EXECUTABLE)
- FIND_PROGRAM(QT_UIC_EXECUTABLE
- NAMES uic
- PATHS
- ${qt_bins}
- $ENV{QTDIR}/bin
- /usr/local/qt/bin
- /usr/local/bin
- /usr/lib/qt/bin
- /usr/bin
- /usr/share/qt4/bin
- C:/Progra~1/qt/bin
- /usr/bin/qt4
- )
-ENDIF(NOT QT_UIC_EXECUTABLE )
+FIND_PROGRAM(QT_UIC_EXECUTABLE
+ NAMES uic
+ PATHS
+ ${QT_BINARY_DIR}
+ $ENV{QTDIR}/bin
+ /usr/local/qt/bin
+ /usr/local/bin
+ /usr/lib/qt/bin
+ /usr/bin
+ /usr/share/qt4/bin
+ C:/Progra~1/qt/bin
+ /usr/bin/qt4
+ )
IF(QT_UIC_EXECUTABLE)
SET ( QT_WRAP_UI "YES")
-ELSE(QT_UIC_EXECUTABLE)
ENDIF(QT_UIC_EXECUTABLE)
-IF(NOT QT_RCC_EXECUTABLE)
- IF(QT_QMAKE_EXECUTABLE)
- EXEC_PROGRAM( ${QT_QMAKE_EXECUTABLE}
- ARGS "-query QT_INSTALL_BINS"
- OUTPUT_VARIABLE qt_bins )
- ENDIF(QT_QMAKE_EXECUTABLE)
- FIND_PROGRAM(QT_RCC_EXECUTABLE
- NAMES rcc
- PATHS
- ${qt_bins}
- $ENV{QTDIR}/bin
- /usr/local/qt/bin
- /usr/local/bin
- /usr/lib/qt/bin
- /usr/bin
- /usr/share/qt4/bin
- C:/Progra~1/qt/bin
- /usr/bin/qt4
- )
-ENDIF(NOT QT_RCC_EXECUTABLE )
+FIND_PROGRAM(QT_RCC_EXECUTABLE
+ NAMES rcc
+ PATHS
+ ${QT_BINARY_DIR}
+ $ENV{QTDIR}/bin
+ /usr/local/qt/bin
+ /usr/local/bin
+ /usr/lib/qt/bin
+ /usr/bin
+ /usr/share/qt4/bin
+ C:/Progra~1/qt/bin
+ /usr/bin/qt4
+ )
MARK_AS_ADVANCED(
QT_UIC_EXECUTABLE
@@ -803,16 +651,17 @@ ENDMACRO(QT4_ADD_RESOURCES)
######################################
# if the includes,libraries,moc,uic and rcc are found then we have it
IF( QT_LIBRARY_DIR AND QT_INCLUDE_DIR AND QT_MOC_EXECUTABLE AND QT_UIC_EXECUTABLE AND QT_RCC_EXECUTABLE)
- SET( QT_FOUND "YES" )
+ SET( QT4_FOUND "YES" )
IF( NOT Qt_FIND_QUIETLY)
MESSAGE(STATUS "Found Qt-Version ${QT_INST_MAJOR_VERSION}.${QT_INST_MINOR_VERSION}.${QT_INST_PATCH_VERSION}")
ENDIF( NOT Qt_FIND_QUIETLY)
ELSE( QT_LIBRARY_DIR AND QT_INCLUDE_DIR AND QT_MOC_EXECUTABLE AND QT_UIC_EXECUTABLE AND QT_RCC_EXECUTABLE)
- SET( QT_FOUND "NO")
+ SET( QT4_FOUND "NO")
IF( Qt_FIND_REQUIRED)
MESSAGE( SEND_ERROR "Qt libraries, includes, moc, uic or/and rcc NOT found!")
ENDIF( Qt_FIND_REQUIRED)
ENDIF( QT_LIBRARY_DIR AND QT_INCLUDE_DIR AND QT_MOC_EXECUTABLE AND QT_UIC_EXECUTABLE AND QT_RCC_EXECUTABLE)
+SET(QT_FOUND ${QT4_FOUND})
#######################################
@@ -823,12 +672,6 @@ ENDIF( QT_LIBRARY_DIR AND QT_INCLUDE_DIR AND QT_MOC_EXECUTABLE AND QT_UIC_EXECUT
# for unix add X11 stuff
IF(UNIX)
FIND_PACKAGE(X11)
- IF (X11_FOUND)
- SET (QT_LIBRARIES ${QT_LIBRARIES} ${X11_LIBRARIES})
- ENDIF (X11_FOUND)
- IF (CMAKE_DL_LIBS)
- SET (QT_LIBRARIES ${QT_LIBRARIES} ${CMAKE_DL_LIBS})
- ENDIF (CMAKE_DL_LIBS)
ENDIF(UNIX)
@@ -841,7 +684,6 @@ ENDIF(UNIX)
SET (QT_MOC_EXE ${QT_MOC_EXECUTABLE} )
SET (QT_UIC_EXE ${QT_UIC_EXECUTABLE} )
-SET( QT_DEFINITIONS "")
SET( QT_QT_LIBRARY "")
SET( QT_QTMAIN_LIBRARY "")
diff --git a/Modules/UseQt4.cmake b/Modules/UseQt4.cmake
new file mode 100644
index 0000000..a5c8352
--- /dev/null
+++ b/Modules/UseQt4.cmake
@@ -0,0 +1,200 @@
+#############################################################################
+#
+# Sets up C and C++ to use Qt 4. It is assumed that FindQt.cmake
+# has already been loaded. See FindQt.cmake for information on
+# how to load Qt 4 into your CMake project.
+#
+#############################################################################
+
+ADD_DEFINITIONS(${QT_DEFINITIONS})
+
+INCLUDE_DIRECTORIES(${QT_INCLUDE_DIR})
+
+SET(QT_LIBRARIES "")
+
+IF (NOT QT_DONT_USE_QTCORE)
+ IF (QT_QTCORE_FOUND)
+ INCLUDE_DIRECTORIES(${QT_QTCORE_INCLUDE_DIR})
+ IF (CMAKE_CONFIGURATION_TYPES OR CMAKE_BUILD_TYPE)
+ SET(QT_LIBRARIES ${QT_LIBRARIES}
+ optimized "${QT_QTCORE_LIBRARY}"
+ debug "${QT_QTCORE_LIBRARY_DEBUG}"
+ )
+ ELSE (CMAKE_CONFIGURATION_TYPES OR CMAKE_BUILD_TYPE)
+ SET(QT_LIBRARIES ${QT_LIBRARIES} "${QT_QTCORE_LIBRARY}" )
+ ENDIF (CMAKE_CONFIGURATION_TYPES OR CMAKE_BUILD_TYPE)
+ IF (UNIX)
+ IF (CMAKE_DL_LIBS)
+ SET (QT_LIBRARIES ${QT_LIBRARIES} ${CMAKE_DL_LIBS})
+ ENDIF (CMAKE_DL_LIBS)
+ ENDIF (UNIX)
+ ELSE (QT_QTCORE_FOUND)
+ MESSAGE("QtCore library not found.")
+ ENDIF (QT_QTCORE_FOUND)
+ENDIF (NOT QT_DONT_USE_QTCORE)
+
+IF (NOT QT_DONT_USE_QTGUI)
+ IF (QT_QTGUI_FOUND)
+ INCLUDE_DIRECTORIES(${QT_QTGUI_INCLUDE_DIR})
+ IF (CMAKE_CONFIGURATION_TYPES OR CMAKE_BUILD_TYPE)
+ SET(QT_LIBRARIES ${QT_LIBRARIES}
+ optimized "${QT_QTGUI_LIBRARY}"
+ debug "${QT_QTGUI_LIBRARY_DEBUG}"
+ )
+ ELSE (CMAKE_CONFIGURATION_TYPES OR CMAKE_BUILD_TYPE)
+ SET(QT_LIBRARIES ${QT_LIBRARIES} "${QT_QTGUI_LIBRARY}")
+ ENDIF (CMAKE_CONFIGURATION_TYPES OR CMAKE_BUILD_TYPE)
+ IF (UNIX)
+ IF (X11_FOUND)
+ SET (QT_LIBRARIES ${QT_LIBRARIES} ${X11_LIBRARIES})
+ ENDIF (X11_FOUND)
+ ENDIF (UNIX)
+ ELSE (QT_QTGUI_FOUND)
+ MESSAGE("QtGui library not found.")
+ ENDIF (QT_QTGUI_FOUND)
+ENDIF (NOT QT_DONT_USE_QTGUI)
+
+IF (QT_USE_QT3SUPPORT)
+ IF (QT_QT3SUPPORT_FOUND)
+ INCLUDE_DIRECTORIES(${QT_QT3SUPPORT_INCLUDE_DIR})
+ ADD_DEFINITIONS(-DQT3_SUPPORT)
+ IF (CMAKE_CONFIGURATION_TYPES OR CMAKE_BUILD_TYPE)
+ SET(QT_LIBRARIES ${QT_LIBRARIES}
+ optimized "${QT_QT3SUPPORT_LIBRARY}"
+ debug "${QT_QT3SUPPORT_LIBRARY_DEBUG}"
+ )
+ ELSE (CMAKE_CONFIGURATION_TYPES OR CMAKE_BUILD_TYPE)
+ SET(QT_LIBRARIES ${QT_LIBRARIES} "${QT_QT3SUPPORT_LIBRARY}")
+ ENDIF (CMAKE_CONFIGURATION_TYPES OR CMAKE_BUILD_TYPE)
+ ELSE (QT_QT3SUPPORT_FOUND)
+ MESSAGE("Qt3Support library not found.")
+ ENDIF (QT_QT3SUPPORT_FOUND)
+ENDIF (QT_USE_QT3SUPPORT)
+
+IF (QT_USE_QTASSISTANT)
+ IF (QT_QTASSISTANT_FOUND)
+ INCLUDE_DIRECTORIES(${QT_QTASSISTANT_INCLUDE_DIR})
+ IF (CMAKE_CONFIGURATION_TYPES OR CMAKE_BUILD_TYPE)
+ SET(QT_LIBRARIES ${QT_LIBRARIES}
+ optimized "${QT_QTASSISTANT_LIBRARY}"
+ debug "${QT_QTASSISTANT_LIBRARY_DEBUG}"
+ )
+ ELSE (CMAKE_CONFIGURATION_TYPES OR CMAKE_BUILD_TYPE)
+ SET(QT_LIBRARIES ${QT_LIBRARIES} "${QT_QTASSISTANT_LIBRARY}")
+ ENDIF (CMAKE_CONFIGURATION_TYPES OR CMAKE_BUILD_TYPE)
+ ELSE (QT_QTASSISTANT_FOUND)
+ MESSAGE("QtAssistant library not found.")
+ ENDIF (QT_QTASSISTANT_FOUND)
+ENDIF (QT_USE_QTASSISTANT)
+
+IF (QT_USE_QTDESIGNER)
+ IF (QT_QTDESIGNER_FOUND)
+ INCLUDE_DIRECTORIES(${QT_QTDESIGNER_INCLUDE_DIR})
+ IF (CMAKE_CONFIGURATION_TYPES OR CMAKE_BUILD_TYPE)
+ SET(QT_LIBRARIES ${QT_LIBRARIES}
+ optimized "${QT_QTDESIGNER_LIBRARY}"
+ debug "${QT_QTDESIGNER_LIBRARY_DEBUG}"
+ )
+ ELSE (CMAKE_CONFIGURATION_TYPES OR CMAKE_BUILD_TYPE)
+ SET(QT_LIBRARIES ${QT_LIBRARIES} "${QT_QTDESIGNER_LIBRARY}")
+ ENDIF (CMAKE_CONFIGURATION_TYPES OR CMAKE_BUILD_TYPE)
+ ELSE (QT_QTDESIGNER_FOUND)
+ MESSAGE("QtDesigner library not found.")
+ ENDIF (QT_QTDESIGNER_FOUND)
+ENDIF (QT_USE_QTDESIGNER)
+
+IF (QT_USE_QTMOTIF)
+ IF (QT_QTMOTIF_FOUND)
+ INCLUDE_DIRECTORIES(${QT_QTMOTIF_INCLUDE_DIR})
+ IF (CMAKE_CONFIGURATION_TYPES OR CMAKE_BUILD_TYPE)
+ SET(QT_LIBRARIES ${QT_LIBRARIES}
+ optimized "${QT_QTMOTIF_LIBRARY}"
+ debug "${QT_QTMOTIF_LIBRARY_DEBUG}"
+ )
+ ELSE (CMAKE_CONFIGURATION_TYPES OR CMAKE_BUILD_TYPE)
+ SET(QT_LIBRARIES ${QT_LIBRARIES} "${QT_QTMOTIF_LIBRARY}")
+ ENDIF (CMAKE_CONFIGURATION_TYPES OR CMAKE_BUILD_TYPE)
+ ELSE (QT_QTMOTIF_FOUND)
+ MESSAGE("QtMotif library not found.")
+ ENDIF (QT_QTMOTIF_FOUND)
+ENDIF (QT_USE_QTMOTIF)
+
+IF (QT_USE_QTNETWORK)
+ IF (QT_QTNETWORK_FOUND)
+ INCLUDE_DIRECTORIES(${QT_QTNETWORK_INCLUDE_DIR})
+ IF (CMAKE_CONFIGURATION_TYPES OR CMAKE_BUILD_TYPE)
+ SET(QT_LIBRARIES ${QT_LIBRARIES}
+ optimized "${QT_QTNETWORK_LIBRARY}"
+ debug "${QT_QTNETWORK_LIBRARY_DEBUG}"
+ )
+ ELSE (CMAKE_CONFIGURATION_TYPES OR CMAKE_BUILD_TYPE)
+ SET(QT_LIBRARIES ${QT_LIBRARIES} "${QT_QTNETWORK_LIBRARY}")
+ ENDIF (CMAKE_CONFIGURATION_TYPES OR CMAKE_BUILD_TYPE)
+ ELSE (QT_QTNETWORK_FOUND)
+ MESSAGE("QtNetwork library not found.")
+ ENDIF (QT_QTNETWORK_FOUND)
+ENDIF (QT_USE_QTNETWORK)
+
+IF (QT_USE_QTNSPLUGIN)
+ IF (QT_QTNSPLUGIN_FOUND)
+ INCLUDE_DIRECTORIES(${QT_QTNSPLUGIN_INCLUDE_DIR})
+ IF (CMAKE_CONFIGURATION_TYPES OR CMAKE_BUILD_TYPE)
+ SET(QT_LIBRARIES ${QT_LIBRARIES}
+ optimized "${QT_QTNSPLUGIN_LIBRARY}"
+ debug "${QT_QTNSPLUGIN_LIBRARY_DEBUG}"
+ )
+ ELSE (CMAKE_CONFIGURATION_TYPES OR CMAKE_BUILD_TYPE)
+ SET(QT_LIBRARIES ${QT_LIBRARIES} "${QT_QTNSPLUGIN_LIBRARY}")
+ ENDIF (CMAKE_CONFIGURATION_TYPES OR CMAKE_BUILD_TYPE)
+ ELSE (QT_QTNSPLUGIN_FOUND)
+ MESSAGE("QtNsPlugin library not found.")
+ ENDIF (QT_QTNSPLUGIN_FOUND)
+ENDIF (QT_USE_QTNSPLUGIN)
+
+IF (QT_USE_QTOPENGL)
+ IF (QT_QTOPENGL_FOUND)
+ INCLUDE_DIRECTORIES(${QT_QTOPENGL_INCLUDE_DIR})
+ IF (CMAKE_CONFIGURATION_TYPES OR CMAKE_BUILD_TYPE)
+ SET(QT_LIBRARIES ${QT_LIBRARIES}
+ optimized "${QT_QTOPENGL_LIBRARY}"
+ debug "${QT_QTOPENGL_LIBRARY_DEBUG}"
+ )
+ ELSE (CMAKE_CONFIGURATION_TYPES OR CMAKE_BUILD_TYPE)
+ SET(QT_LIBRARIES ${QT_LIBRARIES} "${QT_QTOPENGL_LIBRARY}")
+ ENDIF (CMAKE_CONFIGURATION_TYPES OR CMAKE_BUILD_TYPE)
+ ELSE (QT_QTOPENGL_FOUND)
+ MESSAGE("QtOpenGL library not found.")
+ ENDIF (QT_QTOPENGL_FOUND)
+ENDIF (QT_USE_QTOPENGL)
+
+IF (QT_USE_QTSQL)
+ IF (QT_QTSQL_FOUND)
+ INCLUDE_DIRECTORIES(${QT_QTSQL_INCLUDE_DIR})
+ IF (CMAKE_CONFIGURATION_TYPES OR CMAKE_BUILD_TYPE)
+ SET(QT_LIBRARIES ${QT_LIBRARIES}
+ optimized "${QT_QTSQL_LIBRARY}"
+ debug "${QT_QTSQL_LIBRARY_DEBUG}"
+ )
+ ELSE (CMAKE_CONFIGURATION_TYPES OR CMAKE_BUILD_TYPE)
+ SET(QT_LIBRARIES ${QT_LIBRARIES} "${QT_QTSQL_LIBRARY}")
+ ENDIF (CMAKE_CONFIGURATION_TYPES OR CMAKE_BUILD_TYPE)
+ ELSE (QT_QTSQL_FOUND)
+ MESSAGE("QtSql library not found.")
+ ENDIF (QT_QTSQL_FOUND)
+ENDIF (QT_USE_QTSQL)
+
+IF (QT_USE_QTXML)
+ IF (QT_QTXML_FOUND)
+ INCLUDE_DIRECTORIES(${QT_QTXML_INCLUDE_DIR})
+ IF (CMAKE_CONFIGURATION_TYPES OR CMAKE_BUILD_TYPE)
+ SET(QT_LIBRARIES ${QT_LIBRARIES}
+ optimized "${QT_QTXML_LIBRARY}"
+ debug "${QT_QTXML_LIBRARY_DEBUG}"
+ )
+ ELSE (CMAKE_CONFIGURATION_TYPES OR CMAKE_BUILD_TYPE)
+ SET(QT_LIBRARIES ${QT_LIBRARIES} "${QT_QTXML_LIBRARY}")
+ ENDIF (CMAKE_CONFIGURATION_TYPES OR CMAKE_BUILD_TYPE)
+ ELSE (QT_QTXML_FOUND)
+ MESSAGE("QtXml library not found.")
+ ENDIF (QT_QTXML_FOUND)
+ENDIF (QT_USE_QTXML)