summaryrefslogtreecommitdiffstats
path: root/Modules/UseQt4.cmake
blob: cf896a6a77d6e74f5b690fa62ecc50a5b6d51d7a (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
# - 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})

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_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)