##// END OF EJS Templates
More PythonQt*Config.cmake fixes
Orochimarufan -
r213:89db53e7cd3e
parent child
Show More
@@ -1,6 +1,10
1 1 project(PythonQt)
2 2 cmake_minimum_required(VERSION 2.8.10)
3 3
4 IF(POLICY CMP0020)
5 cmake_policy(SET CMP0020 NEW)
6 ENDIF()
7
4 8 include(CTestUseLaunchers OPTIONAL)
5 9
6 10 set(CMAKE_MODULE_PATH ${PROJECT_SOURCE_DIR}/cmake ${CMAKE_MODULE_PATH})
@@ -132,17 +132,23 ELSE()
132 132 SET(_PYTHON_SC_INCLUDE "distutils.sysconfig.get_python_inc()")
133 133 ENDIF()
134 134
135 EXECUTE_PROCESS(
136 COMMAND "${PYTHON_EXECUTABLE}" -c "import ${_PYTHON_SYSCONFIG}; import sys; sys.stdout.write(${_PYTHON_SYSCONFIG}.get_config_var('LIBDIR'))"
137 OUTPUT_VARIABLE _PYTHON_LIBRARY_PATH
138 )
139 135 IF(WIN32)
140 136 EXECUTE_PROCESS(
141 COMMAND "${PYTHON_EXECUTABLE}" -c "import ${_PYTHON_SYSCONFIG}; import sys; sys.stdout.write(${_PYTHON_SYSCONFIG}.get_config_var('LIBRARY'))"
142 OUTPUT_VARIABLE _PYTHON_LIBRARY_NAME
137 COMMAND "${PYTHON_EXECUTABLE}" -c "import ${_PYTHON_SYSCONFIG}; import sys; sys.stdout.write(${_PYTHON_SYSCONFIG}.get_config_var('prefix'))"
138 OUTPUT_VARIABLE _PYTHON_PREFIX
139 )
140 EXECUTE_PROCESS(
141 COMMAND "${PYTHON_EXECUTABLE}" -c "import ${_PYTHON_SYSCONFIG}; import sys; sys.stdout.write(${_PYTHON_SYSCONFIG}.get_config_var('py_version_nodot'))"
142 OUTPUT_VARIABLE _PYTHON_VERSION_MAJOR
143 143 )
144 SET(_PYTHON_LIBRARY_PATH ${_PYTHON_PREFIX}/libs)
145 SET(_PYTHON_LIBRARY_NAME libpython${_PYTHON_VERSION_MAJOR}.a)
144 146 ELSE(WIN32)
145 147 EXECUTE_PROCESS(
148 COMMAND "${PYTHON_EXECUTABLE}" -c "import ${_PYTHON_SYSCONFIG}; import sys; sys.stdout.write(${_PYTHON_SYSCONFIG}.get_config_var('LIBDIR'))"
149 OUTPUT_VARIABLE _PYTHON_LIBRARY_PATH
150 )
151 EXECUTE_PROCESS(
146 152 COMMAND "${PYTHON_EXECUTABLE}" -c "import ${_PYTHON_SYSCONFIG}; import sys; sys.stdout.write(${_PYTHON_SYSCONFIG}.get_config_var('LDLIBRARY'))"
147 153 OUTPUT_VARIABLE _PYTHON_LIBRARY_NAME
148 154 )
@@ -179,7 +179,7 export(PACKAGE ${PythonQt_QtAll})
179 179 set(INCLUDE_DIRS "${PROJECT_SOURCE_DIR}" "${PROJECT_BINARY_DIR}")
180 180 configure_file(PythonQt_QtAllConfig.cmake.in "${PROJECT_BINARY_DIR}/${PythonQt_QtAll}Config.cmake" @ONLY)
181 181 # install tree
182 set(INCLUDE_DIRS "${CMAKE_INSTALL_PREFIX}/include")
182 set(INCLUDE_DIRS "${CMAKE_INSTALL_PREFIX}/include/PythonQt")
183 183 configure_file(PythonQt_QtAllConfig.cmake.in "${PROJECT_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/${PythonQt_QtAll}Config.cmake" @ONLY)
184 184 # both
185 185 configure_file(PythonQt_QtAllConfigVersion.cmake.in "${PROJECT_BINARY_DIR}/${PythonQt_QtAll}ConfigVersion.cmake" @ONLY)
@@ -1,6 +1,5
1 1 # - Config file for the PythonQt package
2 2 # It defines the following variables
3 # PythonQt - the PythonQt core target (PythonQt PythonQt_3 PythonQt5 PythonQt5_3)
4 3 # PythonQt_QtAll - the PythonQt QtAll target
5 4 # PythonQt_QtAll_INCLUDE_DIRS - include directories for PythonQt
6 5 # PythonQt_QtAll_LIBRARIES - libraries to link against
@@ -9,8 +8,6
9 8 set(PythonQt_QtAll @PythonQt_QtAll@)
10 9 set(PythonQt_QtAll_QT @QT@)
11 10
12 find_package(@PythonQt@)
13
14 11 # Compute paths
15 12 get_filename_component(PYTHONQT_QTALL_CMAKE_DIR "${CMAKE_CURRENT_LIST_FILE}" PATH)
16 13 set(PythonQt_QtAll_INCLUDE_DIRS "@INCLUDE_DIRS@")
@@ -20,5 +17,7 if(NOT TARGET @PythonQt_QtAll@)
20 17 include("${PYTHONQT_QTALL_CMAKE_DIR}/@PythonQt_QtAll@Targets.cmake")
21 18 endif()
22 19
20 find_package(@PythonQt@)
21
23 22 # These are IMPORTED targets created by @PythonQt_QtAll@Targets.cmake
24 set(PythonQt_QtAll_LIBRARIES @PythonQt_QtAll@ @PythonQt@)
23 set(PythonQt_QtAll_LIBRARIES @PythonQt_QtAll@)
@@ -1,5 +1,4
1 1 project(PythonQt_Core)
2 cmake_minimum_required(VERSION 2.8.10)
3 2
4 3 #-----------------------------------------------------------------------------
5 4 # Sources
@@ -80,6 +79,7 set(SOURCES_QRC )
80 79 #-----------------------------------------------------------------------------
81 80 # Build the library
82 81 include_directories(${CMAKE_CURRENT_SOURCE_DIR})
82 add_definitions(-DPYTHONQT_EXPORTS)
83 83
84 84 qt_wrap_cpp(GEN_MOC ${SOURCES_MOC})
85 85 qt_add_resources(GEN_QRC ${SOURCES_QRC})
@@ -125,7 +125,7 export(PACKAGE ${PythonQt})
125 125 set(INCLUDE_DIRS "${PROJECT_SOURCE_DIR}" "${PROJECT_BINARY_DIR}")
126 126 configure_file(PythonQtConfig.cmake.in "${PROJECT_BINARY_DIR}/${PythonQt}Config.cmake" @ONLY)
127 127 # install tree
128 set(INCLUDE_DIRS "${CMAKE_INSTALL_PREFIX}/include")
128 set(INCLUDE_DIRS "${CMAKE_INSTALL_PREFIX}/include/PythonQt")
129 129 configure_file(PythonQtConfig.cmake.in "${PROJECT_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/${PythonQt}Config.cmake" @ONLY)
130 130 # both
131 131 configure_file(PythonQtConfigVersion.cmake.in "${PROJECT_BINARY_DIR}/${PythonQt}ConfigVersion.cmake" @ONLY)
General Comments 0
You need to be logged in to leave comments. Login now