diff options
author | Bill Hoffman <bill.hoffman@kitware.com> | 2006-09-06 08:31:50 -0400 |
---|---|---|
committer | Bill Hoffman <bill.hoffman@kitware.com> | 2006-09-06 08:31:50 -0400 |
commit | 207292cf459d70840e42a3a864d299aa77dab2d2 (patch) | |
tree | bb41ddbc984c02b1efccf0a0e2a0e800c4a8a5bf /Modules/UseQt4.cmake | |
parent | 8be3602c930331f1bdfbbd86bb75116eb149ddf7 (diff) | |
download | cmake-207292cf459d70840e42a3a864d299aa77dab2d2.tar.gz |
ENH: fixes from Clinton to allow qt to work with static libs
Diffstat (limited to 'Modules/UseQt4.cmake')
-rw-r--r-- | Modules/UseQt4.cmake | 156 |
1 files changed, 56 insertions, 100 deletions
diff --git a/Modules/UseQt4.cmake b/Modules/UseQt4.cmake index 04fa934819..17fb1e1f5b 100644 --- a/Modules/UseQt4.cmake +++ b/Modules/UseQt4.cmake @@ -10,125 +10,81 @@ INCLUDE_DIRECTORIES(${QT_INCLUDE_DIR}) SET(QT_LIBRARIES "") -IF (NOT QT_DONT_USE_QTCORE) - IF (QT_QTCORE_FOUND) - INCLUDE_DIRECTORIES(${QT_QTCORE_INCLUDE_DIR}) - ADD_DEFINITIONS(-DQT_CORE_LIB) - SET(QT_LIBRARIES ${QT_LIBRARIES} ${QT_QTCORE_LIBRARY}) - 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 (QT_USE_QTMAIN) + IF (WIN32) + SET(QT_LIBRARIES ${QT_LIBRARIES} ${QT_QTMAIN_LIBRARY}) + ENDIF (WIN32) +ENDIF (QT_USE_QTMAIN) -IF (NOT QT_DONT_USE_QTGUI) - IF (QT_QTGUI_FOUND) - INCLUDE_DIRECTORIES(${QT_QTGUI_INCLUDE_DIR}) - ADD_DEFINITIONS(-DQT_GUI_LIB) - SET(QT_LIBRARIES ${QT_LIBRARIES} ${QT_QTGUI_LIBRARY}) - 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) +# Macro for setting up compile flags for Qt modules +MACRO(QT_MODULE_SETUP module) + IF (QT_QT${module}_FOUND) + ADD_DEFINITIONS(-DQT_${module}_LIB) + INCLUDE_DIRECTORIES(${QT_QT${module}_INCLUDE_DIR}) + SET(QT_LIBRARIES ${QT_LIBRARIES} ${QT_QT${module}_LIBRARY}) + SET(QT_LIBRARIES ${QT_LIBRARIES} ${QT_${module}_LIB_DEPENDENCIES}) + ELSE (QT_QT${module}_FOUND) + MESSAGE("Qt ${module} library not found.") + ENDIF (QT_QT${module}_FOUND) +ENDMACRO(QT_MODULE_SETUP) + + +# Qt modules (in order of dependence) IF (QT_USE_QT3SUPPORT) - IF (QT_QT3SUPPORT_FOUND) - INCLUDE_DIRECTORIES(${QT_QT3SUPPORT_INCLUDE_DIR}) - ADD_DEFINITIONS(-DQT3_SUPPORT) - SET(QT_LIBRARIES ${QT_LIBRARIES} ${QT_QT3SUPPORT_LIBRARY}) - ELSE (QT_QT3SUPPORT_FOUND) - MESSAGE("Qt3Support library not found.") - ENDIF (QT_QT3SUPPORT_FOUND) + QT_MODULE_SETUP(3SUPPORT) ENDIF (QT_USE_QT3SUPPORT) +IF (QT_USE_QTOPENGL) + QT_MODULE_SETUP(OPENGL) +ENDIF (QT_USE_QTOPENGL) + IF (QT_USE_QTASSISTANT) - IF (QT_QTASSISTANT_FOUND) - INCLUDE_DIRECTORIES(${QT_QTASSISTANT_INCLUDE_DIR}) - SET(QT_LIBRARIES ${QT_LIBRARIES} ${QT_QTASSISTANT_LIBRARY}) - ELSE (QT_QTASSISTANT_FOUND) - MESSAGE("QtAssistant library not found.") - ENDIF (QT_QTASSISTANT_FOUND) + QT_MODULE_SETUP(ASSISTANT) ENDIF (QT_USE_QTASSISTANT) IF (QT_USE_QTDESIGNER) - IF (QT_QTDESIGNER_FOUND) - INCLUDE_DIRECTORIES(${QT_QTDESIGNER_INCLUDE_DIR}) - SET(QT_LIBRARIES ${QT_LIBRARIES} ${QT_QTDESIGNER_LIBRARY}) - ELSE (QT_QTDESIGNER_FOUND) - MESSAGE("QtDesigner library not found.") - ENDIF (QT_QTDESIGNER_FOUND) + QT_MODULE_SETUP(DESIGNER) ENDIF (QT_USE_QTDESIGNER) -IF (QT_USE_QTMAIN) - IF (WIN32) - SET(QT_LIBRARIES ${QT_LIBRARIES} ${QT_QTMAIN_LIBRARY}) - ENDIF (WIN32) -ENDIF (QT_USE_QTMAIN) - IF (QT_USE_QTMOTIF) - IF (QT_QTMOTIF_FOUND) - INCLUDE_DIRECTORIES(${QT_QTMOTIF_INCLUDE_DIR}) - SET(QT_LIBRARIES ${QT_LIBRARIES} ${QT_QTMOTIF_LIBRARY}) - ELSE (QT_QTMOTIF_FOUND) - MESSAGE("QtMotif library not found.") - ENDIF (QT_QTMOTIF_FOUND) + QT_MODULE_SETUP(MOTIF) ENDIF (QT_USE_QTMOTIF) -IF (QT_USE_QTNETWORK) - IF (QT_QTNETWORK_FOUND) - INCLUDE_DIRECTORIES(${QT_QTNETWORK_INCLUDE_DIR}) - ADD_DEFINITIONS(-DQT_NETWORK_LIB) - SET(QT_LIBRARIES ${QT_LIBRARIES} ${QT_QTNETWORK_LIBRARY}) - 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}) - SET(QT_LIBRARIES ${QT_LIBRARIES} ${QT_QTNSPLUGIN_LIBRARY}) - ELSE (QT_QTNSPLUGIN_FOUND) - MESSAGE("QtNsPlugin library not found.") - ENDIF (QT_QTNSPLUGIN_FOUND) + QT_MODULE_SETUP(NSPLUGIN) ENDIF (QT_USE_QTNSPLUGIN) -IF (QT_USE_QTOPENGL) - IF (QT_QTOPENGL_FOUND) - INCLUDE_DIRECTORIES(${QT_QTOPENGL_INCLUDE_DIR}) - ADD_DEFINITIONS(-DQT_OPENGL_LIB) - SET(QT_LIBRARIES ${QT_LIBRARIES} ${QT_QTOPENGL_LIBRARY}) - ELSE (QT_QTOPENGL_FOUND) - MESSAGE("QtOpenGL library not found.") - ENDIF (QT_QTOPENGL_FOUND) -ENDIF (QT_USE_QTOPENGL) +IF (QT_USE_QTSVG) + QT_MODULE_SETUP(SVG) +ENDIF (QT_USE_QTSVG) -IF (QT_USE_QTSQL) - IF (QT_QTSQL_FOUND) - INCLUDE_DIRECTORIES(${QT_QTSQL_INCLUDE_DIR}) - ADD_DEFINITIONS(-DQT_SQL_LIB) - SET(QT_LIBRARIES ${QT_LIBRARIES} ${QT_QTSQL_LIBRARY}) - ELSE (QT_QTSQL_FOUND) - MESSAGE("QtSql library not found.") - ENDIF (QT_QTSQL_FOUND) -ENDIF (QT_USE_QTSQL) +IF (QT_USE_QTUITOOLS) + QT_MODULE_SETUP(UITOOLS) +ENDIF (QT_USE_QTUITOOLS) + +IF (NOT QT_DONT_USE_QTGUI) + QT_MODULE_SETUP(GUI) +ENDIF (NOT QT_DONT_USE_QTGUI) + +IF (QT_USE_QTTEST) + QT_MODULE_SETUP(TEST) +ENDIF (QT_USE_QTTEST) IF (QT_USE_QTXML) - IF (QT_QTXML_FOUND) - INCLUDE_DIRECTORIES(${QT_QTXML_INCLUDE_DIR}) - ADD_DEFINITIONS(-DQT_XML_LIB) - SET(QT_LIBRARIES ${QT_LIBRARIES} ${QT_QTXML_LIBRARY}) - ELSE (QT_QTXML_FOUND) - MESSAGE("QtXml library not found.") - ENDIF (QT_QTXML_FOUND) + QT_MODULE_SETUP(XML) ENDIF (QT_USE_QTXML) +IF (QT_USE_QTSQL) + QT_MODULE_SETUP(SQL) +ENDIF (QT_USE_QTSQL) + +IF (QT_USE_QTNETWORK) + QT_MODULE_SETUP(NETWORK) +ENDIF (QT_USE_QTNETWORK) + +IF (NOT QT_DONT_USE_QTCORE) + QT_MODULE_SETUP(CORE) +ENDIF (NOT QT_DONT_USE_QTCORE) + + |