2 # Sets up C and C++ to use Qt 4. It is assumed that FindQt.cmake
3 # has already been loaded. See FindQt.cmake for information on
4 # how to load Qt 4 into your CMake project.
7 ADD_DEFINITIONS(${QT_DEFINITIONS})
8 SET_PROPERTY(DIRECTORY APPEND PROPERTY COMPILE_DEFINITIONS_DEBUG QT_DEBUG)
9 SET_PROPERTY(DIRECTORY APPEND PROPERTY COMPILE_DEFINITIONS_RELEASE QT_NO_DEBUG)
10 SET_PROPERTY(DIRECTORY APPEND PROPERTY COMPILE_DEFINITIONS_RELWITHDEBINFO QT_NO_DEBUG)
11 SET_PROPERTY(DIRECTORY APPEND PROPERTY COMPILE_DEFINITIONS_MINSIZEREL QT_NO_DEBUG)
13 INCLUDE_DIRECTORIES(${QT_INCLUDE_DIR})
19 SET(QT_LIBRARIES ${QT_LIBRARIES} ${QT_QTMAIN_LIBRARY})
23 # Macro for setting up compile flags for Qt modules
24 MACRO(QT_MODULE_SETUP module)
25 IF (QT_QT${module}_FOUND)
26 ADD_DEFINITIONS(-DQT_${module}_LIB)
27 INCLUDE_DIRECTORIES(${QT_QT${module}_INCLUDE_DIR})
28 SET(QT_LIBRARIES ${QT_LIBRARIES} ${QT_QT${module}_LIBRARY} ${QT_${module}_LIB_DEPENDENCIES})
29 ELSE (QT_QT${module}_FOUND)
30 MESSAGE("Qt ${module} library not found.")
31 ENDIF (QT_QT${module}_FOUND)
32 ENDMACRO(QT_MODULE_SETUP)
35 # Qt modules (in order of dependence)
37 IF (QT_USE_QT3SUPPORT)
38 QT_MODULE_SETUP(3SUPPORT)
39 ADD_DEFINITIONS(-DQT3_SUPPORT)
40 ENDIF (QT_USE_QT3SUPPORT)
43 QT_MODULE_SETUP(OPENGL)
44 ENDIF (QT_USE_QTOPENGL)
46 IF (QT_USE_QTASSISTANT)
47 QT_MODULE_SETUP(ASSISTANT)
48 ENDIF (QT_USE_QTASSISTANT)
50 IF (QT_USE_QTDESIGNER)
51 QT_MODULE_SETUP(DESIGNER)
52 ENDIF (QT_USE_QTDESIGNER)
55 QT_MODULE_SETUP(MOTIF)
56 ENDIF (QT_USE_QTMOTIF)
58 IF (QT_USE_QTNSPLUGIN)
59 QT_MODULE_SETUP(NSPLUGIN)
60 ENDIF (QT_USE_QTNSPLUGIN)
63 QT_MODULE_SETUP(SCRIPT)
64 ENDIF (QT_USE_QTSCRIPT)
71 QT_MODULE_SETUP(UITOOLS)
72 ENDIF (QT_USE_QTUITOOLS)
74 IF (NOT QT_DONT_USE_QTGUI)
76 ENDIF (NOT QT_DONT_USE_QTGUI)
91 QT_MODULE_SETUP(NETWORK)
92 ENDIF (QT_USE_QTNETWORK)
98 IF (NOT QT_DONT_USE_QTCORE)
100 ENDIF (NOT QT_DONT_USE_QTCORE)