##// END OF EJS Templates
Add PythonQt*Config.cmake
Orochimarufan -
r211:6242b5a89014
parent child
Show More
@@ -0,0 +1,24
1 cmake_policy(SET CMP0007 OLD)
2
3 if (NOT EXISTS "@CMAKE_CURRENT_BINARY_DIR@/install_manifest.txt")
4 message(FATAL_ERROR "Cannot find install manifest: \"@CMAKE_CURRENT_BINARY_DIR@/install_manifest.txt\"")
5 endif(NOT EXISTS "@CMAKE_CURRENT_BINARY_DIR@/install_manifest.txt")
6
7 file(READ "@CMAKE_CURRENT_BINARY_DIR@/install_manifest.txt" files)
8 string(REGEX REPLACE "\n" ";" files "${files}")
9 list(REVERSE files)
10 foreach (file ${files})
11 message(STATUS "Uninstalling \"$ENV{DESTDIR}${file}\"")
12 if (EXISTS "$ENV{DESTDIR}${file}")
13 execute_process(
14 COMMAND @CMAKE_COMMAND@ -E remove "$ENV{DESTDIR}${file}"
15 OUTPUT_VARIABLE rm_out
16 RESULT_VARIABLE rm_retval
17 )
18 if(NOT ${rm_retval} EQUAL 0)
19 message(FATAL_ERROR "Problem when removing \"$ENV{DESTDIR}${file}\"")
20 endif (NOT ${rm_retval} EQUAL 0)
21 else (EXISTS "$ENV{DESTDIR}${file}")
22 message(STATUS "File \"$ENV{DESTDIR}${file}\" does not exist.")
23 endif (EXISTS "$ENV{DESTDIR}${file}")
24 endforeach(file)
@@ -0,0 +1,21
1 # - Config file for the PythonQt package
2 # It defines the following variables
3 # PythonQt - the PythonQt core target (PythonQt PythonQt_3 PythonQt5 PythonQt5_3)
4 # PythonQt_QtAll - the PythonQt QtAll target
5 # PythonQt_QtAll_INCLUDE_DIRS - include directories for PythonQt
6 # PythonQt_QtAll_LIBRARIES - libraries to link against
7
8 set(PythonQt @PythonQt@)
9 set(PythonQt_QtAll @PythonQt_QtAll@)
10
11 # Compute paths
12 get_filename_component(PYTHONQT_QTALL_CMAKE_DIR "${CMAKE_CURRENT_LIST_FILE}" PATH)
13 set(PythonQt_QtAll_INCLUDE_DIRS "@INCLUDE_DIRS@")
14
15 # Our library dependencies (contains definitions for IMPORTED targets)
16 if(NOT TARGET @PythonQt_QtAll@)
17 include("${PYTHONQT_QTALL_CMAKE_DIR}/@PythonQt_QtAll@Targets.cmake")
18 endif()
19
20 # These are IMPORTED targets created by @PythonQt_QtAll@Targets.cmake
21 set(PythonQt_QtAll_LIBRARIES @PythonQt_QtAll@)
@@ -0,0 +1,11
1 set(PACKAGE_VERSION "@PythonQt_VERSION@")
2
3 # Check whether the requested PACKAGE_FIND_VERSION is compatible
4 if("${PACKAGE_VERSION}" VERSION_LESS "${PACKAGE_FIND_VERSION}")
5 set(PACKAGE_VERSION_COMPATIBLE FALSE)
6 else()
7 set(PACKAGE_VERSION_COMPATIBLE TRUE)
8 if ("${PACKAGE_VERSION}" VERSION_EQUAL "${PACKAGE_FIND_VERSION}")
9 set(PACKAGE_VERSION_EXACT TRUE)
10 endif()
11 endif()
@@ -0,0 +1,22
1 # - Config file for the PythonQt package
2 # It defines the following variables
3 # PythonQt - the PythonQt core target (PythonQt PythonQt_3 PythonQt5 PythonQt5_3)
4 # PythonQt_INCLUDE_DIRS - include directories for PythonQt
5 # PythonQt_LIBRARIES - libraries to link against
6
7 set(PythonQt @PythonQt@)
8 set(PythonQt_Qt5 @PythonQt_Qt5@)
9 set(PythonQt_Python3 @PythonQt_Python3@)
10 set(PythonQt_Python @PYTHON_VERSION@)
11
12 # Compute paths
13 get_filename_component(PYTHONQT_CMAKE_DIR "${CMAKE_CURRENT_LIST_FILE}" PATH)
14 set(PythonQt_INCLUDE_DIRS "@INCLUDE_DIRS@")
15
16 # Our library dependencies (contains definitions for IMPORTED targets)
17 if(NOT TARGET @PythonQt@)
18 include("${PYTHONQT_CMAKE_DIR}/@PythonQt@Targets.cmake")
19 endif()
20
21 # These are IMPORTED targets created by @PythonQt@Targets.cmake
22 set(PythonQt_LIBRARIES @PythonQt@)
@@ -0,0 +1,11
1 set(PACKAGE_VERSION "@PythonQt_VERSION@")
2
3 # Check whether the requested PACKAGE_FIND_VERSION is compatible
4 if("${PACKAGE_VERSION}" VERSION_LESS "${PACKAGE_FIND_VERSION}")
5 set(PACKAGE_VERSION_COMPATIBLE FALSE)
6 else()
7 set(PACKAGE_VERSION_COMPATIBLE TRUE)
8 if ("${PACKAGE_VERSION}" VERSION_EQUAL "${PACKAGE_FIND_VERSION}")
9 set(PACKAGE_VERSION_EXACT TRUE)
10 endif()
11 endif()
@@ -1,159 +1,179
1 project(PythonQt)
1 project(PythonQt)
2 cmake_minimum_required(VERSION 2.8.10)
2 cmake_minimum_required(VERSION 2.8.10)
3
3
4 include(CTestUseLaunchers OPTIONAL)
4 include(CTestUseLaunchers OPTIONAL)
5
5
6 set(CMAKE_MODULE_PATH ${PROJECT_SOURCE_DIR}/cmake ${CMAKE_MODULE_PATH})
6 set(CMAKE_MODULE_PATH ${PROJECT_SOURCE_DIR}/cmake ${CMAKE_MODULE_PATH})
7
7
8 #-----------------------------------------------------------------------------
8 #-----------------------------------------------------------------------------
9 # Debug
9 # Debug
10 option(PythonQt_DEBUG "Enable/Disable PythonQt debug output" OFF)
10 option(PythonQt_DEBUG "Enable/Disable PythonQt debug output" OFF)
11 if(PythonQt_DEBUG)
11 if(PythonQt_DEBUG)
12 add_definitions(-DPYTHONQT_DEBUG)
12 add_definitions(-DPYTHONQT_DEBUG)
13 else()
13 else()
14 remove_definitions(-DPYTHONQT_DEBUG)
14 remove_definitions(-DPYTHONQT_DEBUG)
15 endif()
15 endif()
16
16
17 if(NOT CMAKE_BUILD_TYPE)
18 set(CMAKE_BUILD_TYPE Release)
19 endif()
20
17 #-----------------------------------------------------------------------------
21 #-----------------------------------------------------------------------------
18 # Qt
22 # Qt
19 option(PythonQt_Qt5 "Use Qt 5.x (5.1+)" OFF)
23 option(PythonQt_Qt5 "Use Qt 5.x (5.1+)" OFF)
20 if(PythonQt_Qt5)
24 if(PythonQt_Qt5)
21 include(PythonQt_Qt_5x)
25 include(PythonQt_Qt_5x)
22 else(PythonQt_Qt5)
26 else(PythonQt_Qt5)
23 include(PythonQt_Qt_4x)
27 include(PythonQt_Qt_4x)
24 endif(PythonQt_Qt5)
28 endif(PythonQt_Qt5)
25
29
26 #-----------------------------------------------------------------------------
30 #-----------------------------------------------------------------------------
27 # The variable "generated_cpp_suffix" allows to conditionnally compile the generated wrappers
31 # The variable "generated_cpp_suffix" allows to conditionnally compile the generated wrappers
28 # associated with the Qt version being used.
32 # associated with the Qt version being used.
29 set(generated_cpp_suffix "_${QT_VERSION_MAJOR}${QT_VERSION_MINOR}")
33 set(generated_cpp_suffix "_${QT_VERSION_MAJOR}${QT_VERSION_MINOR}")
30
34
31 if("${generated_cpp_suffix}" STREQUAL "_48")
35 if("${generated_cpp_suffix}" STREQUAL "_48")
32 set(generated_cpp_suffix "")
36 set(generated_cpp_suffix "")
33 endif()
37 endif()
34 if("${generated_cpp_suffix}" STREQUAL "_46")
38 if("${generated_cpp_suffix}" STREQUAL "_46")
35 set(generated_cpp_suffix "_47") # Also use 4.7 wrappers for 4.6.x version
39 set(generated_cpp_suffix "_47") # Also use 4.7 wrappers for 4.6.x version
36 endif()
40 endif()
37 if("${generated_cpp_suffix}" STREQUAL "_51")
41 if("${generated_cpp_suffix}" STREQUAL "_51")
38 set(generated_cpp_suffix "_50")
42 set(generated_cpp_suffix "_50")
39 endif()
43 endif()
40
44
41 #-----------------------------------------------------------------------------
45 #-----------------------------------------------------------------------------
42 # Generator
46 # Generator
43 if(PythonQt_Qt5)
47 if(PythonQt_Qt5)
44 add_subdirectory(generator_50 EXCLUDE_FROM_ALL)
48 add_subdirectory(generator_50 EXCLUDE_FROM_ALL)
45 add_custom_target(generator)
49 add_custom_target(generator)
46 add_dependencies(generator pythonqt_generator)
50 add_dependencies(generator pythonqt_generator)
47 endif()
51 endif()
48
52
49 # TODO
53 # TODO
50
54
51 #-----------------------------------------------------------------------------
55 #-----------------------------------------------------------------------------
52 # Build options
56 # Build options
53
57
54 #option(PythonQt_Wrap_QtAll "Make all Qt components available in python" OFF)
58 #option(PythonQt_Wrap_QtAll "Make all Qt components available in python" OFF)
55 #
59 #
56 #set(qtlibs core gui network opengl sql svg uitools webkit xml xmlpatterns)
60 #set(qtlibs core gui network opengl sql svg uitools webkit xml xmlpatterns)
57 #foreach(qtlib ${qtlibs})
61 #foreach(qtlib ${qtlibs})
58 # OPTION(PythonQt_Wrap_Qt${qtlib} "Make all of Qt${qtlib} available in python" OFF)
62 # OPTION(PythonQt_Wrap_Qt${qtlib} "Make all of Qt${qtlib} available in python" OFF)
59 #endforeach()
63 #endforeach()
60
64
61 # Force option if it applies
65 # Force option if it applies
62 #if(PythonQt_Wrap_QtAll)
66 #if(PythonQt_Wrap_QtAll)
63 # list(REMOVE_ITEM qtlibs xmlpatterns) # xmlpatterns wrapper does *NOT* build at all :(
67 # list(REMOVE_ITEM qtlibs xmlpatterns) # xmlpatterns wrapper does *NOT* build at all :(
64 # foreach(qtlib ${qtlibs})
68 # foreach(qtlib ${qtlibs})
65 # if(NOT ${PythonQt_Wrap_Qt${qtlib}})
69 # if(NOT ${PythonQt_Wrap_Qt${qtlib}})
66 # set(PythonQt_Wrap_Qt${qtlib} ON CACHE BOOL "Make all of Qt${qtlib} available in python" FORCE)
70 # set(PythonQt_Wrap_Qt${qtlib} ON CACHE BOOL "Make all of Qt${qtlib} available in python" FORCE)
67 # message(STATUS "Enabling [PythonQt_Wrap_Qt${qtlib}] because of [PythonQt_Wrap_QtAll] evaluates to True")
71 # message(STATUS "Enabling [PythonQt_Wrap_Qt${qtlib}] because of [PythonQt_Wrap_QtAll] evaluates to True")
68 # endif()
72 # endif()
69 # endforeach()
73 # endforeach()
70 #endif()
74 #endif()
71
75
72 #-----------------------------------------------------------------------------
76 #-----------------------------------------------------------------------------
73 # Add extra sources
77 # Add extra sources
74 #foreach(qtlib core gui network opengl sql svg uitools webkit xml xmlpatterns)
78 #foreach(qtlib core gui network opengl sql svg uitools webkit xml xmlpatterns)
75 #
79 #
76 # if (${PythonQt_Wrap_Qt${qtlib}})
80 # if (${PythonQt_Wrap_Qt${qtlib}})
77 #
81 #
78 # ADD_DEFINITIONS(-DPYTHONQT_WRAP_Qt${qtlib})
82 # ADD_DEFINITIONS(-DPYTHONQT_WRAP_Qt${qtlib})
79 #
83 #
80 # set(file_prefix generated_cpp${generated_cpp_suffix}/com_trolltech_qt_${qtlib}/com_trolltech_qt_${qtlib})
84 # set(file_prefix generated_cpp${generated_cpp_suffix}/com_trolltech_qt_${qtlib}/com_trolltech_qt_${qtlib})
81 #
85 #
82 # foreach(index RANGE 0 11)
86 # foreach(index RANGE 0 11)
83 #
87 #
84 # # Source files
88 # # Source files
85 # if(EXISTS ${CMAKE_CURRENT_SOURCE_DIR}/${file_prefix}${index}.cpp)
89 # if(EXISTS ${CMAKE_CURRENT_SOURCE_DIR}/${file_prefix}${index}.cpp)
86 # list(APPEND sources ${file_prefix}${index}.cpp)
90 # list(APPEND sources ${file_prefix}${index}.cpp)
87 # endif()
91 # endif()
88 #
92 #
89 # # Headers that should run through moc
93 # # Headers that should run through moc
90 # if(EXISTS ${CMAKE_CURRENT_SOURCE_DIR}/${file_prefix}${index}.h)
94 # if(EXISTS ${CMAKE_CURRENT_SOURCE_DIR}/${file_prefix}${index}.h)
91 # list(APPEND moc_sources ${file_prefix}${index}.h)
95 # list(APPEND moc_sources ${file_prefix}${index}.h)
92 # endif()
96 # endif()
93 #
97 #
94 # endforeach()
98 # endforeach()
95 #
99 #
96 # list(APPEND sources ${file_prefix}_init.cpp)
100 # list(APPEND sources ${file_prefix}_init.cpp)
97 #
101 #
98 # endif()
102 # endif()
99 #endforeach()
103 #endforeach()
100
104
101 #-----------------------------------------------------------------------------
105 #-----------------------------------------------------------------------------
102 # Find Python
106 # Find Python
103 option(PythonQt_Python3 "Use Python 3.x (3.3+)" OFF)
107 option(PythonQt_Python3 "Use Python 3.x (3.3+)" OFF)
104 option(PythonQt_Python "Use specific Python Version" OFF)
108 option(PythonQt_Python "Use specific Python Version" OFF)
105 if(PythonQt_Python)
109 if(PythonQt_Python)
106 find_package(Python ${PythonQt_Python} REQUIRED EXACT)
110 find_package(Python ${PythonQt_Python} REQUIRED EXACT)
107 elseif(PythonQt_Python3)
111 elseif(PythonQt_Python3)
108 find_package(Python 3.3 REQUIRED)
112 find_package(Python 3.3 REQUIRED)
109 else()
113 else()
110 find_package(Python 2.6 REQUIRED)
114 find_package(Python 2.6 REQUIRED)
111 endif()
115 endif()
112
116
117 if(NOT ${PYTHON_VERSION} VERSION_LESS 3)
118 set(PythonQt_Python3 ON)
119 else()
120 set(PythonQt_Python3 OFF)
121 endif()
122
113 include_directories(${PYTHON_INCLUDE_DIRS})
123 include_directories(${PYTHON_INCLUDE_DIRS})
114 add_definitions(-DPYTHONQT_USE_RELEASE_PYTHON_FALLBACK)
124 add_definitions(-DPYTHONQT_USE_RELEASE_PYTHON_FALLBACK)
115
125
116 #-----------------------------------------------------------------------------
126 #-----------------------------------------------------------------------------
117 # Library Name
127 # Library Name
118 # The variable PythonQt_LibraryName contains the PythonQt core library name
128 # The variable PythonQt_LibraryName contains the PythonQt core library name
119 # It incorporates library mayor versions
129 # It incorporates library mayor versions
120 # The variable PythonQt_LibrarySuffix is "" or "_d", if it is a debug build
130 # The variable PythonQt_LibrarySuffix is "" or "_d", if it is a debug build
121 set(PythonQt_LibraryName PythonQt)
131 set(PythonQt_LibraryName PythonQt)
122
132
123 if(PythonQt_Qt5)
133 if(PythonQt_Qt5)
124 set(PythonQt_LibraryName ${PythonQt_LibraryName}5)
134 set(PythonQt_LibraryName ${PythonQt_LibraryName}5)
125 endif()
135 endif()
126
136
127 if(NOT ${PYTHON_VERSION} VERSION_LESS 3)
137 if(PythonQt_Python3)
128 set(PythonQt_LibraryName ${PythonQt_LibraryName}_3)
138 set(PythonQt_LibraryName ${PythonQt_LibraryName}_3)
129 endif()
139 endif()
130
140
131 if(${CMAKE_BUILD_TYPE} STREQUAL "Debug")
141 if("${CMAKE_BUILD_TYPE}" STREQUAL "Debug")
132 set(PythonQt_LibrarySuffix _d)
142 set(PythonQt_LibrarySuffix _d)
133 endif()
143 endif()
134
144
135 message(STATUS "Building ${PythonQt_LibraryName}${PythonQt_LibrarySuffix} (Qt ${QT_VERSION_MAJOR}.${QT_VERSION_MINOR}.${QT_VERSION_PATCH} + Python ${PYTHON_VERSION} | ${CMAKE_BUILD_TYPE})")
145 message(STATUS "Building ${PythonQt_LibraryName}${PythonQt_LibrarySuffix} (Qt ${QT_VERSION_MAJOR}.${QT_VERSION_MINOR}.${QT_VERSION_PATCH} + Python ${PYTHON_VERSION} | ${CMAKE_BUILD_TYPE})")
136
146
137 #-----------------------------------------------------------------------------
147 #-----------------------------------------------------------------------------
138 # Core
148 # Core
139 add_subdirectory(src)
149 add_subdirectory(src)
140
150
141 #-----------------------------------------------------------------------------
151 #-----------------------------------------------------------------------------
142 # Tests
152 # Tests
143 add_subdirectory(tests EXCLUDE_FROM_ALL)
153 add_subdirectory(tests EXCLUDE_FROM_ALL)
144 # test alias
154 # test alias
145 add_custom_target(test COMMAND tests/PythonQtTest WORKING_DIRECTORY ${CURRENT_BINARY_DIR})
155 add_custom_target(test COMMAND tests/PythonQtTest WORKING_DIRECTORY ${CURRENT_BINARY_DIR})
146 add_dependencies(test PythonQtTest)
156 add_dependencies(test PythonQtTest)
147
157
148 #-----------------------------------------------------------------------------
158 #-----------------------------------------------------------------------------
149 # Extenseions (QtAll)
159 # Extenseions (QtAll)
150 add_subdirectory(extensions EXCLUDE_FROM_ALL)
160 add_subdirectory(extensions)
151 # QtAll alias
161 # QtAll alias
152 add_custom_target(QtAll)
162 add_custom_target(QtAll)
153 add_dependencies(QtAll PythonQt_QtAll)
163 add_dependencies(QtAll ${PythonQt_QtAll})
154
164
155 #-----------------------------------------------------------------------------
165 #-----------------------------------------------------------------------------
156 # Examples
166 # Examples
157 include_directories(src)
167 include_directories(src)
158 include_directories(extensions/PythonQt_QtAll)
168 include_directories(extensions/PythonQt_QtAll)
159 add_subdirectory(examples EXCLUDE_FROM_ALL)
169 add_subdirectory(examples EXCLUDE_FROM_ALL)
170
171 #-----------------------------------------------------------------------------
172 # uninstall target
173 configure_file(
174 "${CMAKE_CURRENT_SOURCE_DIR}/cmake/cmake_uninstall.cmake.in"
175 "${CMAKE_CURRENT_BINARY_DIR}/cmake_uninstall.cmake"
176 IMMEDIATE @ONLY)
177
178 add_custom_target(uninstall
179 COMMAND ${CMAKE_COMMAND} -P ${CMAKE_CURRENT_BINARY_DIR}/cmake_uninstall.cmake)
@@ -1,61 +1,61
1 project(NicePyConsole)
1 project(NicePyConsole)
2
2
3 SET(HEADERS
3 SET(HEADERS
4 SimpleConsole.h
4 SimpleConsole.h
5 NicePyConsole.h
5 NicePyConsole.h
6 PygmentsHighlighter.h
6 PygmentsHighlighter.h
7 PythonCompleter.h
7 PythonCompleter.h
8 PythonCompleterPopup.h
8 PythonCompleterPopup.h
9 )
9 )
10
10
11 SET(SOURCES
11 SET(SOURCES
12 SimpleConsole.cpp
12 SimpleConsole.cpp
13 NicePyConsole.cpp
13 NicePyConsole.cpp
14 main.cpp
14 main.cpp
15 PygmentsHighlighter.cpp
15 PygmentsHighlighter.cpp
16 PythonCompleter.cpp
16 PythonCompleter.cpp
17 PythonCompleterPopup.cpp
17 PythonCompleterPopup.cpp
18 )
18 )
19
19
20 SET(FILES
20 SET(FILES
21 PygmentsHighlighter.py
21 PygmentsHighlighter.py
22 PythonCompleter.py
22 PythonCompleter.py
23 module_completion.py
23 module_completion.py
24 )
24 )
25
25
26 SET(DIRS
26 SET(DIRS
27 pygments
27 pygments
28 )
28 )
29
29
30 find_package(${PythonQt})
31
30 qt_wrap_cpp(GEN_MOC ${HEADERS})
32 qt_wrap_cpp(GEN_MOC ${HEADERS})
31
33
32 add_executable(NicePyConsole ${SOURCES} ${GEN_MOC})
34 add_executable(NicePyConsole ${SOURCES} ${GEN_MOC})
33 if(PythonQt_Qt5)
35 if(PythonQt_Qt5)
34 qt_use_modules(NicePyConsole Core Gui Widgets)
36 qt_use_modules(NicePyConsole Core Gui Widgets)
35 else()
37 else()
36 qt_use_modules(NicePyConsole Core Gui)
38 qt_use_modules(NicePyConsole Core Gui)
37 endif()
39 endif()
38
40
39 get_property(PythonQt_lib TARGET ${PythonQt} PROPERTY LOCATION)
41 target_link_libraries(NicePyConsole ${PythonQt} ${PythonQt_QtAll} ${PYTHON_LIBRARIES})
40 get_property(PythonQt_QtAll_lib TARGET ${PythonQt_QtAll} PROPERTY LOCATION)
41 target_link_libraries(NicePyConsole ${PythonQt_lib} ${PythonQt_QtAll_lib} ${PYTHON_LIBRARIES})
42
42
43 foreach(FILE ${FILES})
43 foreach(FILE ${FILES})
44 SET(OUT "${CMAKE_CURRENT_BINARY_DIR}/${FILE}")
44 SET(OUT "${CMAKE_CURRENT_BINARY_DIR}/${FILE}")
45 SET(IN "${CMAKE_CURRENT_SOURCE_DIR}/${FILE}")
45 SET(IN "${CMAKE_CURRENT_SOURCE_DIR}/${FILE}")
46 add_custom_command(OUTPUT "${OUT}"
46 add_custom_command(OUTPUT "${OUT}"
47 COMMAND "${CMAKE_COMMAND}" -E copy "${IN}" "${OUT}"
47 COMMAND "${CMAKE_COMMAND}" -E copy "${IN}" "${OUT}"
48 MAIN_DEPENDENCY "${IN}"
48 MAIN_DEPENDENCY "${IN}"
49 )
49 )
50 add_dependencies(NicePyConsole "${OUT}")
50 add_dependencies(NicePyConsole "${OUT}")
51 endforeach()
51 endforeach()
52
52
53 foreach(DIR ${DIRS})
53 foreach(DIR ${DIRS})
54 SET(OUT "${CMAKE_CURRENT_BINARY_DIR}/${DIR}")
54 SET(OUT "${CMAKE_CURRENT_BINARY_DIR}/${DIR}")
55 SET(IN "${CMAKE_CURRENT_SOURCE_DIR}/${DIR}")
55 SET(IN "${CMAKE_CURRENT_SOURCE_DIR}/${DIR}")
56 add_custom_command(OUTPUT "${OUT}"
56 add_custom_command(OUTPUT "${OUT}"
57 COMMAND "${CMAKE_COMMAND}" -E copy_directory "${IN}" "${OUT}"
57 COMMAND "${CMAKE_COMMAND}" -E copy_directory "${IN}" "${OUT}"
58 MAIN_DEPENDENCY "${IN}"
58 MAIN_DEPENDENCY "${IN}"
59 )
59 )
60 add_dependencies(NicePyConsole "${OUT}")
60 add_dependencies(NicePyConsole "${OUT}")
61 endforeach()
61 endforeach()
@@ -1,160 +1,188
1 project(PythonQt_QtAll)
1 project(PythonQt_QtAll)
2
2
3 # Bindings
3 # Bindings
4 SET(HEADERS
4 SET(HEADERS
5 PythonQt_QtAll.h
5 PythonQt_QtAll.h
6 )
6 )
7
7
8 SET(SOURCES
8 SET(SOURCES
9 PythonQt_QtAll.cpp
9 PythonQt_QtAll.cpp
10 )
10 )
11
11
12 #-------------------------------------------------------------------
12 #-------------------------------------------------------------------
13 # Generated stuff
13 # Generated stuff
14 SET(GEN ../../generated_cpp${generated_cpp_suffix})
14 SET(GEN ../../generated_cpp${generated_cpp_suffix})
15
15
16 foreach(MODULE core gui network opengl sql svg uitools webkit xml)
16 foreach(MODULE core gui network opengl sql svg uitools webkit xml)
17 SET(MODULE_TROLL com_trolltech_qt_${MODULE})
17 SET(MODULE_TROLL com_trolltech_qt_${MODULE})
18 SET(MODULE_BASE ${GEN}/${MODULE_TROLL}/${MODULE_TROLL})
18 SET(MODULE_BASE ${GEN}/${MODULE_TROLL}/${MODULE_TROLL})
19 FILE(GLOB HFILES ${MODULE_BASE}*.h)
19 FILE(GLOB HFILES ${MODULE_BASE}*.h)
20 FILE(GLOB CFILES ${MODULE_BASE}*.cpp)
20 FILE(GLOB CFILES ${MODULE_BASE}*.cpp)
21 LIST(APPEND HEADERS ${HFILES})
21 LIST(APPEND HEADERS ${HFILES})
22 LIST(APPEND SOURCES ${CFILES})
22 LIST(APPEND SOURCES ${CFILES})
23 endforeach()
23 endforeach()
24
24
25 ## Core
25 ## Core
26 #LIST(APPEND HEADERS
26 #LIST(APPEND HEADERS
27 # ${GEN}/com_trolltech_qt_core/com_trolltech_qt_core0.h
27 # ${GEN}/com_trolltech_qt_core/com_trolltech_qt_core0.h
28 # ${GEN}/com_trolltech_qt_core/com_trolltech_qt_core1.h
28 # ${GEN}/com_trolltech_qt_core/com_trolltech_qt_core1.h
29 # ${GEN}/com_trolltech_qt_core/com_trolltech_qt_core2.h
29 # ${GEN}/com_trolltech_qt_core/com_trolltech_qt_core2.h
30 #)
30 #)
31
31
32 #LIST(APPEND SOURCES
32 #LIST(APPEND SOURCES
33 # ${GEN}/com_trolltech_qt_core/com_trolltech_qt_core0.cpp
33 # ${GEN}/com_trolltech_qt_core/com_trolltech_qt_core0.cpp
34 # ${GEN}/com_trolltech_qt_core/com_trolltech_qt_core1.cpp
34 # ${GEN}/com_trolltech_qt_core/com_trolltech_qt_core1.cpp
35 # ${GEN}/com_trolltech_qt_core/com_trolltech_qt_core2.cpp
35 # ${GEN}/com_trolltech_qt_core/com_trolltech_qt_core2.cpp
36 # ${GEN}/com_trolltech_qt_core/com_trolltech_qt_core_init.cpp
36 # ${GEN}/com_trolltech_qt_core/com_trolltech_qt_core_init.cpp
37 #)
37 #)
38
38
39 ## Gui
39 ## Gui
40 #LIST(APPEND HEADERS
40 #LIST(APPEND HEADERS
41 # ${GEN}/com_trolltech_qt_gui/com_trolltech_qt_gui0.h
41 # ${GEN}/com_trolltech_qt_gui/com_trolltech_qt_gui0.h
42 # ${GEN}/com_trolltech_qt_gui/com_trolltech_qt_gui1.h
42 # ${GEN}/com_trolltech_qt_gui/com_trolltech_qt_gui1.h
43 # ${GEN}/com_trolltech_qt_gui/com_trolltech_qt_gui2.h
43 # ${GEN}/com_trolltech_qt_gui/com_trolltech_qt_gui2.h
44 # ${GEN}/com_trolltech_qt_gui/com_trolltech_qt_gui3.h
44 # ${GEN}/com_trolltech_qt_gui/com_trolltech_qt_gui3.h
45 # ${GEN}/com_trolltech_qt_gui/com_trolltech_qt_gui4.h
45 # ${GEN}/com_trolltech_qt_gui/com_trolltech_qt_gui4.h
46 # ${GEN}/com_trolltech_qt_gui/com_trolltech_qt_gui5.h
46 # ${GEN}/com_trolltech_qt_gui/com_trolltech_qt_gui5.h
47 # ${GEN}/com_trolltech_qt_gui/com_trolltech_qt_gui6.h
47 # ${GEN}/com_trolltech_qt_gui/com_trolltech_qt_gui6.h
48 # ${GEN}/com_trolltech_qt_gui/com_trolltech_qt_gui7.h
48 # ${GEN}/com_trolltech_qt_gui/com_trolltech_qt_gui7.h
49 # ${GEN}/com_trolltech_qt_gui/com_trolltech_qt_gui8.h
49 # ${GEN}/com_trolltech_qt_gui/com_trolltech_qt_gui8.h
50 # ${GEN}/com_trolltech_qt_gui/com_trolltech_qt_gui9.h
50 # ${GEN}/com_trolltech_qt_gui/com_trolltech_qt_gui9.h
51 #)
51 #)
52
52
53 #LIST(APPEND SOURCES
53 #LIST(APPEND SOURCES
54 # ${GEN}/com_trolltech_qt_gui/com_trolltech_qt_gui0.cpp
54 # ${GEN}/com_trolltech_qt_gui/com_trolltech_qt_gui0.cpp
55 # ${GEN}/com_trolltech_qt_gui/com_trolltech_qt_gui1.cpp
55 # ${GEN}/com_trolltech_qt_gui/com_trolltech_qt_gui1.cpp
56 # ${GEN}/com_trolltech_qt_gui/com_trolltech_qt_gui2.cpp
56 # ${GEN}/com_trolltech_qt_gui/com_trolltech_qt_gui2.cpp
57 # ${GEN}/com_trolltech_qt_gui/com_trolltech_qt_gui3.cpp
57 # ${GEN}/com_trolltech_qt_gui/com_trolltech_qt_gui3.cpp
58 # ${GEN}/com_trolltech_qt_gui/com_trolltech_qt_gui4.cpp
58 # ${GEN}/com_trolltech_qt_gui/com_trolltech_qt_gui4.cpp
59 # ${GEN}/com_trolltech_qt_gui/com_trolltech_qt_gui5.cpp
59 # ${GEN}/com_trolltech_qt_gui/com_trolltech_qt_gui5.cpp
60 # ${GEN}/com_trolltech_qt_gui/com_trolltech_qt_gui6.cpp
60 # ${GEN}/com_trolltech_qt_gui/com_trolltech_qt_gui6.cpp
61 # ${GEN}/com_trolltech_qt_gui/com_trolltech_qt_gui7.cpp
61 # ${GEN}/com_trolltech_qt_gui/com_trolltech_qt_gui7.cpp
62 # ${GEN}/com_trolltech_qt_gui/com_trolltech_qt_gui8.cpp
62 # ${GEN}/com_trolltech_qt_gui/com_trolltech_qt_gui8.cpp
63 # ${GEN}/com_trolltech_qt_gui/com_trolltech_qt_gui9.cpp
63 # ${GEN}/com_trolltech_qt_gui/com_trolltech_qt_gui9.cpp
64 # ${GEN}/com_trolltech_qt_gui/com_trolltech_qt_gui_init.cpp
64 # ${GEN}/com_trolltech_qt_gui/com_trolltech_qt_gui_init.cpp
65 #)
65 #)
66
66
67 ## Network
67 ## Network
68 #LIST(APPEND HEADERS
68 #LIST(APPEND HEADERS
69 # ${GEN}/com_trolltech_qt_network/com_trolltech_qt_network0.h
69 # ${GEN}/com_trolltech_qt_network/com_trolltech_qt_network0.h
70 #)
70 #)
71
71
72 #LIST(APPEND SOURCES
72 #LIST(APPEND SOURCES
73 # ${GEN}/com_trolltech_qt_network/com_trolltech_qt_network0.cpp
73 # ${GEN}/com_trolltech_qt_network/com_trolltech_qt_network0.cpp
74 # ${GEN}/com_trolltech_qt_network/com_trolltech_qt_network_init.cpp
74 # ${GEN}/com_trolltech_qt_network/com_trolltech_qt_network_init.cpp
75 #)
75 #)
76
76
77 ## OpenGL
77 ## OpenGL
78 #LIST(APPEND HEADERS
78 #LIST(APPEND HEADERS
79 # ${GEN}/com_trolltech_qt_opengl/com_trolltech_qt_opengl0.h
79 # ${GEN}/com_trolltech_qt_opengl/com_trolltech_qt_opengl0.h
80 #)
80 #)
81
81
82 #LIST(APPEND SOURCES
82 #LIST(APPEND SOURCES
83 # ${GEN}/com_trolltech_qt_opengl/com_trolltech_qt_opengl0.cpp
83 # ${GEN}/com_trolltech_qt_opengl/com_trolltech_qt_opengl0.cpp
84 # ${GEN}/com_trolltech_qt_opengl/com_trolltech_qt_opengl_init.cpp
84 # ${GEN}/com_trolltech_qt_opengl/com_trolltech_qt_opengl_init.cpp
85 #)
85 #)
86
86
87 ## Sql
87 ## Sql
88 #LIST(APPEND HEADERS
88 #LIST(APPEND HEADERS
89 # ${GEN}/com_trolltech_qt_sql/com_trolltech_qt_sql0.h
89 # ${GEN}/com_trolltech_qt_sql/com_trolltech_qt_sql0.h
90 #)
90 #)
91
91
92 #LIST(APPEND SOURCES
92 #LIST(APPEND SOURCES
93 # ${GEN}/com_trolltech_qt_sql/com_trolltech_qt_sql0.cpp
93 # ${GEN}/com_trolltech_qt_sql/com_trolltech_qt_sql0.cpp
94 # ${GEN}/com_trolltech_qt_sql/com_trolltech_qt_sql_init.cpp
94 # ${GEN}/com_trolltech_qt_sql/com_trolltech_qt_sql_init.cpp
95 #)
95 #)
96
96
97 ## Svg
97 ## Svg
98 #LIST(APPEND HEADERS
98 #LIST(APPEND HEADERS
99 # ${GEN}/com_trolltech_qt_svg/com_trolltech_qt_svg0.h
99 # ${GEN}/com_trolltech_qt_svg/com_trolltech_qt_svg0.h
100 #)
100 #)
101
101
102 #LIST(APPEND SOURCES
102 #LIST(APPEND SOURCES
103 # ${GEN}/com_trolltech_qt_svg/com_trolltech_qt_svg0.cpp
103 # ${GEN}/com_trolltech_qt_svg/com_trolltech_qt_svg0.cpp
104 # ${GEN}/com_trolltech_qt_svg/com_trolltech_qt_svg_init.cpp
104 # ${GEN}/com_trolltech_qt_svg/com_trolltech_qt_svg_init.cpp
105 #)
105 #)
106
106
107 ## uitools
107 ## uitools
108 #LIST(APPEND HEADERS
108 #LIST(APPEND HEADERS
109 # ${GEN}/com_trolltech_qt_uitools/com_trolltech_qt_uitools0.h
109 # ${GEN}/com_trolltech_qt_uitools/com_trolltech_qt_uitools0.h
110 #)
110 #)
111
111
112 #LIST(APPEND SOURCES
112 #LIST(APPEND SOURCES
113 # ${GEN}/com_trolltech_qt_uitools/com_trolltech_qt_uitools0.cpp
113 # ${GEN}/com_trolltech_qt_uitools/com_trolltech_qt_uitools0.cpp
114 # ${GEN}/com_trolltech_qt_uitools/com_trolltech_qt_uitools_init.cpp
114 # ${GEN}/com_trolltech_qt_uitools/com_trolltech_qt_uitools_init.cpp
115 #)
115 #)
116
116
117 ## WebKit
117 ## WebKit
118 #LIST(APPEND HEADERS
118 #LIST(APPEND HEADERS
119 # ${GEN}/com_trolltech_qt_webkit/com_trolltech_qt_webkit0.h
119 # ${GEN}/com_trolltech_qt_webkit/com_trolltech_qt_webkit0.h
120 #)
120 #)
121
121
122 #LIST(APPEND SOURCES
122 #LIST(APPEND SOURCES
123 # ${GEN}/com_trolltech_qt_webkit/com_trolltech_qt_webkit0.cpp
123 # ${GEN}/com_trolltech_qt_webkit/com_trolltech_qt_webkit0.cpp
124 # ${GEN}/com_trolltech_qt_webkit/com_trolltech_qt_webkit_init.cpp
124 # ${GEN}/com_trolltech_qt_webkit/com_trolltech_qt_webkit_init.cpp
125 #)
125 #)
126
126
127 ## Xml
127 ## Xml
128 #LIST(APPEND HEADERS
128 #LIST(APPEND HEADERS
129 # ${GEN}/com_trolltech_qt_xml/com_trolltech_qt_xml0.h
129 # ${GEN}/com_trolltech_qt_xml/com_trolltech_qt_xml0.h
130 #)
130 #)
131
131
132 #LIST(APPEND SOURCES
132 #LIST(APPEND SOURCES
133 # ${GEN}/com_trolltech_qt_xml/com_trolltech_qt_xml0.cpp
133 # ${GEN}/com_trolltech_qt_xml/com_trolltech_qt_xml0.cpp
134 # ${GEN}/com_trolltech_qt_xml/com_trolltech_qt_xml_init.cpp
134 # ${GEN}/com_trolltech_qt_xml/com_trolltech_qt_xml_init.cpp
135 #)
135 #)
136
136
137 #-------------------------------------------------------------------
137 #-------------------------------------------------------------------
138 # Build
138 # Build
139 set(PythonQt_QtAll ${PythonQt_LibraryName}_QtAll${PythonQt_LibrarySuffix} CACHE INTERNAL "")
139 set(PythonQt_QtAll ${PythonQt_LibraryName}_QtAll${PythonQt_LibrarySuffix} CACHE INTERNAL "")
140
140
141 find_package(${PythonQt})
142
141 include_directories(../../src)
143 include_directories(../../src)
142 add_definitions(-DPYTHONQT_QTALL_EXPORTS)
144 add_definitions(-DPYTHONQT_QTALL_EXPORTS)
143 qt_wrap_cpp(GEN_MOC ${HEADERS})
145 qt_wrap_cpp(GEN_MOC ${HEADERS})
144
146
145 SET(QT Core Gui Network OpenGL Sql Svg UiTools WebKit Xml)
147 SET(QT Core Gui Network OpenGL Sql Svg UiTools WebKit Xml)
146 if(PythonQt_Qt5)
148 if(PythonQt_Qt5)
147 LIST(APPEND QT Widgets WebKitWidgets)
149 LIST(APPEND QT Widgets WebKitWidgets)
148 endif()
150 endif()
149
151
150
152
151 add_library(${PythonQt_QtAll} SHARED ${SOURCES} ${GEN_MOC})
153 add_library(${PythonQt_QtAll} SHARED ${SOURCES} ${GEN_MOC})
152 qt_use_modules(${PythonQt_QtAll} ${QT})
154 qt_use_modules(${PythonQt_QtAll} ${QT})
153
155
154 get_property(PythonQt_lib TARGET ${PythonQt} PROPERTY LOCATION)
156 target_link_libraries(${PythonQt_QtAll} ${PythonQt} ${PYTHON_LIBRARIES})
155 target_link_libraries(${PythonQt_QtAll} ${PythonQt_lib} ${PYTHON_LIBRARIES})
156
157
157 install(TARGETS ${PythonQt_QtAll}
158 install(TARGETS ${PythonQt_QtAll} EXPORT ${PythonQt_QtAll}Targets COMPONENT QtAll
158 RUNTIME DESTINATION bin
159 RUNTIME DESTINATION bin
159 LIBRARY DESTINATION lib
160 LIBRARY DESTINATION lib
160 ARCHIVE DESTINATION lib)
161 ARCHIVE DESTINATION lib)
162
163 #-----------------------------------------------------------------------------
164 # Export CMake Config
165
166 if(WIN32 AND NOT CYGWIN)
167 set(LIB_CMAKE_PATH "cmake")
168 else()
169 set(LIB_CMAKE_PATH "lib/cmake/${PythonQt_QtAll}")
170 endif()
171
172 export(TARGETS ${PythonQt_QtAll} ${PythonQt} FILE "${PROJECT_BINARY_DIR}/${PythonQt_QtAll}Targets.cmake")
173 export(PACKAGE ${PythonQt_QtAll})
174
175 # build tree
176 set(INCLUDE_DIRS "${PROJECT_SOURCE_DIR}" "${PROJECT_BINARY_DIR}")
177 configure_file(PythonQt_QtAllConfig.cmake.in "${PROJECT_BINARY_DIR}/${PythonQt_QtAll}Config.cmake" @ONLY)
178 # install tree
179 set(INCLUDE_DIRS "${CMAKE_INSTALL_PREFIX}/include/PythonQt/QtAll")
180 configure_file(PythonQt_QtAllConfig.cmake.in "${PROJECT_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/${PythonQt_QtAll}Config.cmake" @ONLY)
181 # both
182 configure_file(PythonQt_QtAllConfigVersion.cmake.in "${PROJECT_BINARY_DIR}/${PythonQt_QtAll}ConfigVersion.cmake" @ONLY)
183
184 install(EXPORT ${PythonQt_QtAll}Targets DESTINATION "${LIB_CMAKE_PATH}" COMPONENT QtAll-dev)
185 install(FILES ${PROJECT_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/${PythonQt_QtAll}Config.cmake
186 ${PROJECT_BINARY_DIR}/${PythonQt_QtAll}ConfigVersion.cmake
187 DESTINATION "${LIB_CMAKE_PATH}" COMPONENT QtAll-dev)
188
@@ -1,110 +1,139
1 project(PythonQt_Core)
1 project(PythonQt_Core)
2 cmake_minimum_required(VERSION 2.8.10)
2 cmake_minimum_required(VERSION 2.8.10)
3
3
4 #-----------------------------------------------------------------------------
4 #-----------------------------------------------------------------------------
5 # Sources
5 # Sources
6
6
7 set(SOURCES
7 set(SOURCES
8 PythonQtClassInfo.cpp
8 PythonQtClassInfo.cpp
9 PythonQtClassWrapper.cpp
9 PythonQtClassWrapper.cpp
10 PythonQtConversion.cpp
10 PythonQtConversion.cpp
11 PythonQt.cpp
11 PythonQt.cpp
12 PythonQtImporter.cpp
12 PythonQtImporter.cpp
13 PythonQtInstanceWrapper.cpp
13 PythonQtInstanceWrapper.cpp
14 PythonQtMethodInfo.cpp
14 PythonQtMethodInfo.cpp
15 PythonQtMisc.cpp
15 PythonQtMisc.cpp
16 PythonQtObjectPtr.cpp
16 PythonQtObjectPtr.cpp
17 PythonQtQFileImporter.cpp
17 PythonQtQFileImporter.cpp
18 PythonQtSignalReceiver.cpp
18 PythonQtSignalReceiver.cpp
19 PythonQtSlot.cpp
19 PythonQtSlot.cpp
20 PythonQtSignal.cpp
20 PythonQtSignal.cpp
21 PythonQtStdDecorators.cpp
21 PythonQtStdDecorators.cpp
22 PythonQtStdIn.cpp
22 PythonQtStdIn.cpp
23 PythonQtStdOut.cpp
23 PythonQtStdOut.cpp
24 gui/PythonQtScriptingConsole.cpp
24 gui/PythonQtScriptingConsole.cpp
25
25
26 ../generated_cpp${generated_cpp_suffix}/PythonQt_QtBindings.cpp
26 ../generated_cpp${generated_cpp_suffix}/PythonQt_QtBindings.cpp
27
27
28 ../generated_cpp${generated_cpp_suffix}/com_trolltech_qt_core_builtin/com_trolltech_qt_core_builtin0.cpp
28 ../generated_cpp${generated_cpp_suffix}/com_trolltech_qt_core_builtin/com_trolltech_qt_core_builtin0.cpp
29 ../generated_cpp${generated_cpp_suffix}/com_trolltech_qt_core_builtin/com_trolltech_qt_core_builtin_init.cpp
29 ../generated_cpp${generated_cpp_suffix}/com_trolltech_qt_core_builtin/com_trolltech_qt_core_builtin_init.cpp
30 ../generated_cpp${generated_cpp_suffix}/com_trolltech_qt_gui_builtin/com_trolltech_qt_gui_builtin0.cpp
30 ../generated_cpp${generated_cpp_suffix}/com_trolltech_qt_gui_builtin/com_trolltech_qt_gui_builtin0.cpp
31 ../generated_cpp${generated_cpp_suffix}/com_trolltech_qt_gui_builtin/com_trolltech_qt_gui_builtin_init.cpp
31 ../generated_cpp${generated_cpp_suffix}/com_trolltech_qt_gui_builtin/com_trolltech_qt_gui_builtin_init.cpp
32 )
32 )
33
33
34 #-----------------------------------------------------------------------------
34 #-----------------------------------------------------------------------------
35 # List headers. This is list is used for the install command.
35 # List headers. This is list is used for the install command.
36
36
37 set(HEADERS
37 set(HEADERS
38 PythonQtClassInfo.h
38 PythonQtClassInfo.h
39 PythonQtClassWrapper.h
39 PythonQtClassWrapper.h
40 PythonQtConversion.h
40 PythonQtConversion.h
41 PythonQtCppWrapperFactory.h
41 PythonQtCppWrapperFactory.h
42 PythonQtDoc.h
42 PythonQtDoc.h
43 PythonQt.h
43 PythonQt.h
44 PythonQtImporter.h
44 PythonQtImporter.h
45 PythonQtImportFileInterface.h
45 PythonQtImportFileInterface.h
46 PythonQtInstanceWrapper.h
46 PythonQtInstanceWrapper.h
47 PythonQtMethodInfo.h
47 PythonQtMethodInfo.h
48 PythonQtMisc.h
48 PythonQtMisc.h
49 PythonQtObjectPtr.h
49 PythonQtObjectPtr.h
50 PythonQtQFileImporter.h
50 PythonQtQFileImporter.h
51 PythonQtSignalReceiver.h
51 PythonQtSignalReceiver.h
52 PythonQtSlot.h
52 PythonQtSlot.h
53 PythonQtSignal.h
53 PythonQtSignal.h
54 PythonQtStdDecorators.h
54 PythonQtStdDecorators.h
55 PythonQtStdIn.h
55 PythonQtStdIn.h
56 PythonQtStdOut.h
56 PythonQtStdOut.h
57 PythonQtSystem.h
57 PythonQtSystem.h
58 PythonQtVariants.h
58 PythonQtVariants.h
59 PythonQtPythonInclude.h
59 PythonQtPythonInclude.h
60 ../generated_cpp${generated_cpp_suffix}/PythonQt_QtBindings.h
60 ../generated_cpp${generated_cpp_suffix}/PythonQt_QtBindings.h
61 )
61 )
62
62
63 #-----------------------------------------------------------------------------
63 #-----------------------------------------------------------------------------
64 # Headers that should run through moc
64 # Headers that should run through moc
65
65
66 set(SOURCES_MOC
66 set(SOURCES_MOC
67 PythonQt.h
67 PythonQt.h
68 PythonQtSignalReceiver.h
68 PythonQtSignalReceiver.h
69 PythonQtStdDecorators.h
69 PythonQtStdDecorators.h
70 gui/PythonQtScriptingConsole.h
70 gui/PythonQtScriptingConsole.h
71
71
72 ../generated_cpp${generated_cpp_suffix}/com_trolltech_qt_core_builtin/com_trolltech_qt_core_builtin0.h
72 ../generated_cpp${generated_cpp_suffix}/com_trolltech_qt_core_builtin/com_trolltech_qt_core_builtin0.h
73 ../generated_cpp${generated_cpp_suffix}/com_trolltech_qt_gui_builtin/com_trolltech_qt_gui_builtin0.h
73 ../generated_cpp${generated_cpp_suffix}/com_trolltech_qt_gui_builtin/com_trolltech_qt_gui_builtin0.h
74 )
74 )
75
75
76 #-----------------------------------------------------------------------------
76 #-----------------------------------------------------------------------------
77 # Resources
77 # Resources
78 set(SOURCES_QRC )
78 set(SOURCES_QRC )
79
79
80 #-----------------------------------------------------------------------------
80 #-----------------------------------------------------------------------------
81 # Build the library
81 # Build the library
82 set(PythonQt ${PythonQt_LibraryName}${PythonQt_LibrarySuffix} CACHE INTERNAL "")
82 set(PythonQt ${PythonQt_LibraryName}${PythonQt_LibrarySuffix} CACHE INTERNAL "")
83
83
84 include_directories(${CMAKE_CURRENT_SOURCE_DIR})
84 include_directories(${CMAKE_CURRENT_SOURCE_DIR})
85
85
86 qt_wrap_cpp(GEN_MOC ${SOURCES_MOC})
86 qt_wrap_cpp(GEN_MOC ${SOURCES_MOC})
87 qt_add_resources(GEN_QRC ${SOURCES_QRC})
87 qt_add_resources(GEN_QRC ${SOURCES_QRC})
88
88
89 add_library(${PythonQt} SHARED ${SOURCES} ${GEN_MOC} ${GEN_QRC} ${HEADERS})
89 add_library(${PythonQt} SHARED ${SOURCES} ${GEN_MOC} ${GEN_QRC})
90 if(PythonQt_Qt5)
90 if(PythonQt_Qt5)
91 qt_use_modules(${PythonQt} Core Gui Widgets)
91 qt_use_modules(${PythonQt} Core Gui Widgets)
92 else()
92 else()
93 qt_use_modules(${PythonQt} Core Gui)
93 qt_use_modules(${PythonQt} Core Gui)
94 endif()
94 endif()
95 target_link_libraries(${PythonQt} ${PYTHON_LIBRARIES})
95 target_link_libraries(${PythonQt} ${PYTHON_LIBRARIES})
96
96
97 #
97 #
98 # That should solve linkage error on Mac when the project is used in a superbuild setup
98 # That should solve linkage error on Mac when the project is used in a superbuild setup
99 # See http://blog.onesadcookie.com/2008/01/installname-magic.html
99 # See http://blog.onesadcookie.com/2008/01/installname-magic.html
100 #
100 #
101 set_target_properties(${PythonQt} PROPERTIES INSTALL_NAME_DIR "${CMAKE_INSTALL_PREFIX}/lib")
101 set_target_properties(${PythonQt} PROPERTIES INSTALL_NAME_DIR "${CMAKE_INSTALL_PREFIX}/lib")
102
102
103 #-----------------------------------------------------------------------------
103 #-----------------------------------------------------------------------------
104 # Install library (on windows, put the dll in 'bin' and the archive in 'lib')
104 # Install library (on windows, put the dll in 'bin' and the archive in 'lib')
105
105
106 install(TARGETS ${PythonQt}
106 set_target_properties(${PythonQt} PROPERTIES PUBLIC_HEADER "${HEADERS}")
107 RUNTIME DESTINATION bin
107
108 LIBRARY DESTINATION lib
108 install(TARGETS ${PythonQt} EXPORT ${PythonQt}Targets COMPONENT core-dev
109 ARCHIVE DESTINATION lib)
109 RUNTIME DESTINATION bin COMPONENT core
110 install(FILES ${headers} DESTINATION include/PythonQt)
110 LIBRARY DESTINATION lib COMPONENT core
111 ARCHIVE DESTINATION lib COMPONENT core
112 PUBLIC_HEADER DESTINATION include/PythonQt)
113
114 #-----------------------------------------------------------------------------
115 # Export CMake Config
116
117 if(WIN32 AND NOT CYGWIN)
118 set(LIB_CMAKE_PATH "cmake")
119 else()
120 set(LIB_CMAKE_PATH "lib/cmake/${PythonQt}")
121 endif()
122
123 export(TARGETS ${PythonQt} FILE "${PROJECT_BINARY_DIR}/${PythonQt}Targets.cmake")
124 export(PACKAGE ${PythonQt})
125
126 # build tree
127 set(INCLUDE_DIRS "${PROJECT_SOURCE_DIR}" "${PROJECT_BINARY_DIR}")
128 configure_file(PythonQtConfig.cmake.in "${PROJECT_BINARY_DIR}/${PythonQt}Config.cmake" @ONLY)
129 # install tree
130 set(INCLUDE_DIRS "${CMAKE_INSTALL_PREFIX}/include/PythonQt")
131 configure_file(PythonQtConfig.cmake.in "${PROJECT_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/${PythonQt}Config.cmake" @ONLY)
132 # both
133 configure_file(PythonQtConfigVersion.cmake.in "${PROJECT_BINARY_DIR}/${PythonQt}ConfigVersion.cmake" @ONLY)
134
135 install(EXPORT ${PythonQt}Targets DESTINATION "${LIB_CMAKE_PATH}" COMPONENT core-dev)
136 install(FILES ${PROJECT_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/${PythonQt}Config.cmake
137 ${PROJECT_BINARY_DIR}/${PythonQt}ConfigVersion.cmake
138 DESTINATION "${LIB_CMAKE_PATH}" COMPONENT core-dev)
139
General Comments 0
You need to be logged in to leave comments. Login now