@@ -11,6 +11,20 @@ cmake_minimum_required(VERSION 2.8)
11
11
project (PythonQt )
12
12
#-----------------------------------------------------------------------------
13
13
14
+ #----------------------------------------------------------------------------
15
+ # Qt version
16
+
17
+ # Set PythonQt_QT_VERSION
18
+ set (PythonQt_QT_VERSION 4 )
19
+
20
+ # Requirements
21
+ set (minimum_required_qt4_version "4.6.2" )
22
+ set (minimum_required_qt_version ${minimum_required_qt${PythonQt_QT_VERSION}_version} )
23
+
24
+ # Qt components
25
+ set (qt4libs core gui network opengl sql svg uitools webkit xml xmlpatterns )
26
+ set (qtlibs ${qt${PythonQt_QT_VERSION}libs} )
27
+
14
28
#-----------------------------------------------------------------------------
15
29
# Python libraries
16
30
@@ -40,17 +54,24 @@ if(NOT DEFINED PythonQt_INSTALL_INCLUDE_DIR)
40
54
set (PythonQt_INSTALL_INCLUDE_DIR include /PythonQt )
41
55
endif ()
42
56
43
- option (PythonQt_Wrap_QtAll "Make all Qt components available in python" OFF )
57
+ set (qt4_wrapped_libs ${qt4libs} )
58
+ set (qt_wrapped_libs ${qt${PythonQt_QT_VERSION}_wrapped_libs} )
44
59
45
- set (qtlibs core gui network opengl sql svg uitools webkit xml xmlpatterns )
46
- foreach (qtlib ${qtlibs} )
60
+ # Define PythonQt_Wrap_Qt* options
61
+ option (PythonQt_Wrap_QtAll "Make all Qt components available in python" OFF )
62
+ foreach (qtlib ${qt_wrapped_libs} )
47
63
OPTION (PythonQt_Wrap_Qt${qtlib} "Make all of Qt${qtlib} available in python" OFF )
48
64
endforeach ()
49
65
66
+
50
67
# Force option if it applies
51
68
if (PythonQt_Wrap_QtAll )
52
- list (REMOVE_ITEM qtlibs xmlpatterns ) # xmlpatterns wrapper does *NOT* build at all :(
53
- foreach (qtlib ${qtlibs} )
69
+ set (_qt_wrapped_libs ${qt_wrapped_libs} )
70
+
71
+ # XXX xmlpatterns wrapper does *NOT* build at all :(
72
+ list (REMOVE_ITEM _qt_wrapped_libs xmlpatterns )
73
+
74
+ foreach (qtlib ${_qt_wrapped_libs} )
54
75
if (NOT ${PythonQt_Wrap_Qt${qtlib}} )
55
76
set (PythonQt_Wrap_Qt${qtlib} ON CACHE BOOL "Make all of Qt${qtlib} available in python" FORCE )
56
77
message (STATUS "Enabling [PythonQt_Wrap_Qt${qtlib} ] because of [PythonQt_Wrap_QtAll] evaluates to True" )
@@ -68,7 +89,6 @@ endif()
68
89
#-----------------------------------------------------------------------------
69
90
# Setup Qt
70
91
71
- set (minimum_required_qt_version "4.6.2" )
72
92
73
93
find_package (Qt4 )
74
94
@@ -81,7 +101,7 @@ if(QT4_FOUND)
81
101
endif ()
82
102
83
103
# Enable required qt module
84
- foreach (qtlib network opengl sql svg uitools webkit xml xmlpatterns )
104
+ foreach (qtlib ${qt_wrapped_libs} )
85
105
string (TOUPPER ${qtlib} qtlib_uppercase )
86
106
if (NOT ${QT_QT${qtlib_uppercase}_FOUND} )
87
107
message (FATAL_ERROR "QT_QT${qtlib_uppercase} *not* FOUND - Try to disable PythonQt_Wrap_Qt${qtlib} " )
@@ -185,7 +205,7 @@ set(moc_sources
185
205
186
206
#-----------------------------------------------------------------------------
187
207
# Add extra sources
188
- foreach (qtlib core gui network opengl sql svg uitools webkit xml xmlpatterns )
208
+ foreach (qtlib ${qt_wrapped_libs} )
189
209
190
210
if (${PythonQt_Wrap_Qt${qtlib}} )
191
211
0 commit comments