summaryrefslogtreecommitdiffstats
path: root/Modules/UseQt4.cmake
blob: 143e59e9b81c3d64144d96d5a65b0b7b41ba02b4 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
# - Use Module for QT4
# 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})
SET_PROPERTY(DIRECTORY APPEND PROPERTY COMPILE_DEFINITIONS_DEBUG QT_DEBUG)
SET_PROPERTY(DIRECTORY APPEND PROPERTY COMPILE_DEFINITIONS_RELEASE QT_NO_DEBUG)
SET_PROPERTY(DIRECTORY APPEND PROPERTY COMPILE_DEFINITIONS_RELWITHDEBINFO QT_NO_DEBUG)
SET_PROPERTY(DIRECTORY APPEND PROPERTY COMPILE_DEFINITIONS_MINSIZEREL QT_NO_DEBUG)

INCLUDE_DIRECTORIES(${QT_INCLUDE_DIR})

SET(QT_LIBRARIES "")

IF (QT_USE_QTMAIN)
  IF (WIN32)
    SET(QT_LIBRARIES ${QT_LIBRARIES} ${QT_QTMAIN_LIBRARY})
  ENDIF (WIN32)
ENDIF (QT_USE_QTMAIN)

# 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} ${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)
  QT_MODULE_SETUP(3SUPPORT)
  ADD_DEFINITIONS(-DQT3_SUPPORT)
ENDIF (QT_USE_QT3SUPPORT)

IF (QT_USE_QTOPENGL)
  QT_MODULE_SETUP(OPENGL)
ENDIF (QT_USE_QTOPENGL)

IF (QT_USE_QTASSISTANT)
  QT_MODULE_SETUP(ASSISTANT)
ENDIF (QT_USE_QTASSISTANT)

IF (QT_USE_QTDESIGNER)
  QT_MODULE_SETUP(DESIGNER)
ENDIF (QT_USE_QTDESIGNER)

IF (QT_USE_QTMOTIF)
  QT_MODULE_SETUP(MOTIF)
ENDIF (QT_USE_QTMOTIF)

IF (QT_USE_QTNSPLUGIN)
  QT_MODULE_SETUP(NSPLUGIN)
ENDIF (QT_USE_QTNSPLUGIN)

IF (QT_USE_QTSCRIPT)
  QT_MODULE_SETUP(SCRIPT)
ENDIF (QT_USE_QTSCRIPT)

IF (QT_USE_QTSVG)
  QT_MODULE_SETUP(SVG)
ENDIF (QT_USE_QTSVG)

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)
  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 (QT_USE_QTDBUS)
  QT_MODULE_SETUP(DBUS)
ENDIF (QT_USE_QTDBUS)

IF (NOT QT_DONT_USE_QTCORE)
  QT_MODULE_SETUP(CORE)
ENDIF (NOT QT_DONT_USE_QTCORE)