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