Skip to content

Commit acd9d3a

Browse files
committed
Support compilation of wrappers associated with either Qt 4.6.x, 4.7.x or 4.8.x
1 parent dbd8dbd commit acd9d3a

File tree

77 files changed

+222111
-9
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

77 files changed

+222111
-9
lines changed

CMakeLists.txt

+20-9
Original file line numberDiff line numberDiff line change
@@ -54,6 +54,17 @@ else()
5454
message(FATAL_ERROR "error: Qt4 was not found on your system. You probably need to set the QT_QMAKE_EXECUTABLE variable")
5555
endif()
5656

57+
#-----------------------------------------------------------------------------
58+
# The variable "generated_cpp_suffix" allows to conditionnally compile the generated wrappers
59+
# associated with the Qt version being used.
60+
set(generated_cpp_suffix "_${QT_VERSION_MAJOR}${QT_VERSION_MINOR}")
61+
if("${generated_cpp_suffix}" STREQUAL "_48")
62+
set(generated_cpp_suffix "")
63+
endif()
64+
if("${generated_cpp_suffix}" STREQUAL "_46")
65+
set(generated_cpp_suffix "_47") # Also use 4.7 wrappers for 4.6.x version
66+
endif()
67+
5768
#-----------------------------------------------------------------------------
5869
# Sources
5970

@@ -76,12 +87,12 @@ set(sources
7687
src/PythonQtStdOut.cpp
7788
src/gui/PythonQtScriptingConsole.cpp
7889

79-
generated_cpp/PythonQt_QtBindings.cpp
90+
generated_cpp${generated_cpp_suffix}/PythonQt_QtBindings.cpp
8091

81-
generated_cpp/com_trolltech_qt_core_builtin/com_trolltech_qt_core_builtin0.cpp
82-
generated_cpp/com_trolltech_qt_core_builtin/com_trolltech_qt_core_builtin_init.cpp
83-
generated_cpp/com_trolltech_qt_gui_builtin/com_trolltech_qt_gui_builtin0.cpp
84-
generated_cpp/com_trolltech_qt_gui_builtin/com_trolltech_qt_gui_builtin_init.cpp
92+
generated_cpp${generated_cpp_suffix}/com_trolltech_qt_core_builtin/com_trolltech_qt_core_builtin0.cpp
93+
generated_cpp${generated_cpp_suffix}/com_trolltech_qt_core_builtin/com_trolltech_qt_core_builtin_init.cpp
94+
generated_cpp${generated_cpp_suffix}/com_trolltech_qt_gui_builtin/com_trolltech_qt_gui_builtin0.cpp
95+
generated_cpp${generated_cpp_suffix}/com_trolltech_qt_gui_builtin/com_trolltech_qt_gui_builtin_init.cpp
8596
)
8697

8798
#-----------------------------------------------------------------------------
@@ -110,7 +121,7 @@ set(headers
110121
src/PythonQtSystem.h
111122
src/PythonQtVariants.h
112123
src/PythonQtPythonInclude.h
113-
generated_cpp/PythonQt_QtBindings.h
124+
generated_cpp${generated_cpp_suffix}/PythonQt_QtBindings.h
114125
)
115126

116127
#-----------------------------------------------------------------------------
@@ -122,8 +133,8 @@ set(moc_sources
122133
src/PythonQtStdDecorators.h
123134
src/gui/PythonQtScriptingConsole.h
124135

125-
generated_cpp/com_trolltech_qt_core_builtin/com_trolltech_qt_core_builtin0.h
126-
generated_cpp/com_trolltech_qt_gui_builtin/com_trolltech_qt_gui_builtin0.h
136+
generated_cpp${generated_cpp_suffix}/com_trolltech_qt_core_builtin/com_trolltech_qt_core_builtin0.h
137+
generated_cpp${generated_cpp_suffix}/com_trolltech_qt_gui_builtin/com_trolltech_qt_gui_builtin0.h
127138
)
128139

129140
#-----------------------------------------------------------------------------
@@ -134,7 +145,7 @@ foreach(qtlib core gui network opengl sql svg uitools webkit xml xmlpatterns)
134145

135146
ADD_DEFINITIONS(-DPYTHONQT_WRAP_Qt${qtlib})
136147

137-
set(file_prefix generated_cpp/com_trolltech_qt_${qtlib}/com_trolltech_qt_${qtlib})
148+
set(file_prefix generated_cpp${generated_cpp_suffix}/com_trolltech_qt_${qtlib}/com_trolltech_qt_${qtlib})
138149

139150
foreach(index RANGE 0 10)
140151

+63
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,63 @@
1+
2+
#include "PythonQt_QtBindings.h"
3+
4+
#include "PythonQt.h"
5+
6+
void PythonQt_init_QtGui(PyObject*);
7+
void PythonQt_init_QtSvg(PyObject*);
8+
void PythonQt_init_QtSql(PyObject*);
9+
void PythonQt_init_QtNetwork(PyObject*);
10+
void PythonQt_init_QtCore(PyObject*);
11+
void PythonQt_init_QtWebKit(PyObject*);
12+
void PythonQt_init_QtOpenGL(PyObject*);
13+
void PythonQt_init_QtXml(PyObject*);
14+
void PythonQt_init_QtXmlPatterns(PyObject*);
15+
void PythonQt_init_QtUiTools(PyObject*);
16+
void PythonQt_init_QtPhonon(PyObject*);
17+
18+
PYTHONQT_EXPORT void PythonQt_init_QtBindings()
19+
{
20+
#ifdef PYTHONQT_WRAP_Qtcore
21+
PythonQt_init_QtCore(0);
22+
#endif
23+
24+
#ifdef PYTHONQT_WRAP_Qtgui
25+
PythonQt_init_QtGui(0);
26+
#endif
27+
28+
#ifdef PYTHONQT_WRAP_Qtnetwork
29+
PythonQt_init_QtNetwork(0);
30+
#endif
31+
32+
#ifdef PYTHONQT_WRAP_Qtopengl
33+
PythonQt_init_QtOpenGL(0);
34+
#endif
35+
36+
#ifdef PYTHONQT_WRAP_Qtsql
37+
PythonQt_init_QtSql(0);
38+
#endif
39+
40+
#ifdef PYTHONQT_WRAP_Qtsvg
41+
PythonQt_init_QtSvg(0);
42+
#endif
43+
44+
#ifdef PYTHONQT_WRAP_Qtuitools
45+
PythonQt_init_QtUiTools(0);
46+
#endif
47+
48+
#ifdef PYTHONQT_WRAP_Qtwebkit
49+
PythonQt_init_QtWebKit(0);
50+
#endif
51+
52+
#ifdef PYTHONQT_WRAP_Qtxml
53+
PythonQt_init_QtXml(0);
54+
#endif
55+
56+
#ifdef PYTHONQT_WRAP_Qtxmlpatterns
57+
PythonQt_init_QtXmlPatterns(0);
58+
#endif
59+
60+
#ifdef PYTHONQT_WRAP_Qtphonon
61+
PythonQt_init_QtPhonon(0);
62+
#endif
63+
};
+10
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
#ifndef _PYTHONQT_QTBINDINGS_H
2+
#define _PYTHONQT_QTBINDINGS_H
3+
4+
#include "PythonQtSystem.h"
5+
6+
/// Initialize Qt bindings enabled at configuration time
7+
PYTHONQT_EXPORT void PythonQt_init_QtBindings();
8+
9+
#endif
10+
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
HEADERS += \
2+
$$PWD/com_trolltech_qt_core0.h \
3+
$$PWD/com_trolltech_qt_core1.h \
4+
$$PWD/com_trolltech_qt_core2.h \
5+
6+
SOURCES += \
7+
$$PWD/com_trolltech_qt_core0.cpp \
8+
$$PWD/com_trolltech_qt_core1.cpp \
9+
$$PWD/com_trolltech_qt_core2.cpp \
10+
$$PWD/com_trolltech_qt_core_init.cpp

0 commit comments

Comments
 (0)