ENH: fix advanced bug
[cmake.git] / Modules / UseQt4.cmake
blob143e59e9b81c3d64144d96d5a65b0b7b41ba02b4
1 # - Use Module for QT4
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})
15 SET(QT_LIBRARIES "")
17 IF (QT_USE_QTMAIN)
18   IF (WIN32)
19     SET(QT_LIBRARIES ${QT_LIBRARIES} ${QT_QTMAIN_LIBRARY})
20   ENDIF (WIN32)
21 ENDIF (QT_USE_QTMAIN)
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)
42 IF (QT_USE_QTOPENGL)
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)
54 IF (QT_USE_QTMOTIF)
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)
62 IF (QT_USE_QTSCRIPT)
63   QT_MODULE_SETUP(SCRIPT)
64 ENDIF (QT_USE_QTSCRIPT)
66 IF (QT_USE_QTSVG)
67   QT_MODULE_SETUP(SVG)
68 ENDIF (QT_USE_QTSVG)
70 IF (QT_USE_QTUITOOLS)
71   QT_MODULE_SETUP(UITOOLS)
72 ENDIF (QT_USE_QTUITOOLS)
74 IF (NOT QT_DONT_USE_QTGUI)
75   QT_MODULE_SETUP(GUI)
76 ENDIF (NOT QT_DONT_USE_QTGUI)
78 IF (QT_USE_QTTEST)
79   QT_MODULE_SETUP(TEST)
80 ENDIF (QT_USE_QTTEST)
82 IF (QT_USE_QTXML)
83   QT_MODULE_SETUP(XML)
84 ENDIF (QT_USE_QTXML)
86 IF (QT_USE_QTSQL)
87   QT_MODULE_SETUP(SQL)
88 ENDIF (QT_USE_QTSQL)
90 IF (QT_USE_QTNETWORK)
91   QT_MODULE_SETUP(NETWORK)
92 ENDIF (QT_USE_QTNETWORK)
94 IF (QT_USE_QTDBUS)
95   QT_MODULE_SETUP(DBUS)
96 ENDIF (QT_USE_QTDBUS)
98 IF (NOT QT_DONT_USE_QTCORE)
99   QT_MODULE_SETUP(CORE)
100 ENDIF (NOT QT_DONT_USE_QTCORE)