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})
25 ELSE(QT_DONT_USE_QTGUI)
27 ENDIF(QT_DONT_USE_QTGUI)
29 IF(QT_DONT_USE_QTCORE)
31 ELSE(QT_DONT_USE_QTCORE)
33 ENDIF(QT_DONT_USE_QTCORE)
35 IF (QT_USE_QT3SUPPORT)
36 ADD_DEFINITIONS(-DQT3_SUPPORT)
37 ENDIF (QT_USE_QT3SUPPORT)
39 # list dependent modules, so dependent libraries are added
40 SET(QT_QT3SUPPORT_MODULE_DEPENDS QTGUI QTSQL QTXML QTNETWORK QTCORE)
41 SET(QT_QTSVG_MODULE_DEPENDS QTGUI QTXML QTCORE)
42 SET(QT_QTUITOOLS_MODULE_DEPENDS QTGUI QTXML QTCORE)
43 SET(QT_QTHELP_MODULE_DEPENDS QTGUI QTSQL QTXML QTCORE)
44 SET(QT_PHONON_MODULE_DEPENDS QTGUI QTDBUS QTCORE)
45 SET(QT_QTDBUS_MODULE_DEPENDS QTXML QTCORE)
46 SET(QT_QTXMLPATTERNS_MODULE_DEPENDS QTNETWORK QTCORE)
48 # Qt modules (in order of dependence)
49 FOREACH(module QT3SUPPORT QTOPENGL QTASSISTANT QTDESIGNER QTMOTIF QTNSPLUGIN
50 QTSCRIPT QTSVG QTUITOOLS QTHELP QTWEBKIT PHONON QTGUI QTTEST
51 QTDBUS QTXML QTSQL QTXMLPATTERNS QTNETWORK QTCORE)
53 IF (QT_USE_${module} OR QT_USE_${module}_DEPENDS)
54 IF (QT_${module}_FOUND)
56 STRING(REPLACE "QT" "" qt_module_def "${module}")
57 ADD_DEFINITIONS(-DQT_${qt_module_def}_LIB)
58 INCLUDE_DIRECTORIES(${QT_${module}_INCLUDE_DIR})
59 ENDIF(QT_USE_${module})
60 SET(QT_LIBRARIES ${QT_LIBRARIES} ${QT_${module}_LIBRARY} ${QT_${module}_LIB_DEPENDENCIES})
61 FOREACH(depend_module ${QT_${module}_MODULE_DEPENDS})
62 SET(QT_USE_${depend_module}_DEPENDS 1)
63 ENDFOREACH(depend_module ${QT_${module}_MODULE_DEPENDS})
64 ELSE (QT_${module}_FOUND)
65 MESSAGE("Qt ${module} library not found.")
66 ENDIF (QT_${module}_FOUND)
67 ENDIF (QT_USE_${module} OR QT_USE_${module}_DEPENDS)