##// END OF EJS Templates
fix PythonQt*Config.cmake _again_
fix PythonQt*Config.cmake _again_

File last commit:

r214:10ef09a17283 master
r214:10ef09a17283 master
Show More
CMakeLists.txt
184 lines | 5.5 KiB | text/plain | TextLexer
florianlink
merged contributions from https://github.com/commontk/PythonQt/compare/svn-mirror...patched...
r166 project(PythonQt)
Orochimarufan
Redo CMake build system, get Qt5 support...
r205 cmake_minimum_required(VERSION 2.8.10)
florianlink
merged contributions from https://github.com/commontk/PythonQt/compare/svn-mirror...patched...
r166
Orochimarufan
More PythonQt*Config.cmake fixes
r213 IF(POLICY CMP0020)
cmake_policy(SET CMP0020 NEW)
ENDIF()
florianlink
integrated changes from https://github.com/commontk/PythonQt#patched-2...
r202 include(CTestUseLaunchers OPTIONAL)
Orochimarufan
Redo CMake build system, get Qt5 support...
r205 set(CMAKE_MODULE_PATH ${PROJECT_SOURCE_DIR}/cmake ${CMAKE_MODULE_PATH})
florianlink
merged contributions from https://github.com/commontk/PythonQt/compare/svn-mirror...patched...
r166
Orochimarufan
Fix PythonQt*Config*.cmake
r212 #-----------------------------------------------------------------------------
Orochimarufan
fix PythonQt*Config.cmake _again_
r214 # Version
Orochimarufan
Fix PythonQt*Config*.cmake
r212 SET(PythonQt_VERSION 2.2.0)
florianlink
merged contributions from https://github.com/commontk/PythonQt/compare/svn-mirror...patched...
r166 #-----------------------------------------------------------------------------
Orochimarufan
Redo CMake build system, get Qt5 support...
r205 # Debug
florianlink
merged contributions from https://github.com/commontk/PythonQt/compare/svn-mirror...patched...
r166 option(PythonQt_DEBUG "Enable/Disable PythonQt debug output" OFF)
if(PythonQt_DEBUG)
Orochimarufan
Redo CMake build system, get Qt5 support...
r205 add_definitions(-DPYTHONQT_DEBUG)
florianlink
merged contributions from https://github.com/commontk/PythonQt/compare/svn-mirror...patched...
r166 else()
Orochimarufan
Redo CMake build system, get Qt5 support...
r205 remove_definitions(-DPYTHONQT_DEBUG)
florianlink
merged contributions from https://github.com/commontk/PythonQt/compare/svn-mirror...patched...
r166 endif()
Orochimarufan
Add PythonQt*Config.cmake
r211 if(NOT CMAKE_BUILD_TYPE)
set(CMAKE_BUILD_TYPE Release)
endif()
florianlink
merged contributions from https://github.com/commontk/PythonQt/compare/svn-mirror...patched...
r166 #-----------------------------------------------------------------------------
Orochimarufan
Redo CMake build system, get Qt5 support...
r205 # Qt
Orochimarufan
Fix PythonQt*Config*.cmake
r212 option(PythonQt_Qt5 "Use Qt 5.x" OFF)
Orochimarufan
Redo CMake build system, get Qt5 support...
r205 if(PythonQt_Qt5)
include(PythonQt_Qt_5x)
else(PythonQt_Qt5)
include(PythonQt_Qt_4x)
endif(PythonQt_Qt5)
florianlink
merged contributions from https://github.com/commontk/PythonQt/compare/svn-mirror...patched...
r166
florianlink
integrated changes from https://github.com/commontk/PythonQt#patched-2...
r202 #-----------------------------------------------------------------------------
Orochimarufan
Redo CMake build system, get Qt5 support...
r205 # The variable "generated_cpp_suffix" allows to conditionnally compile the generated wrappers
florianlink
integrated changes from https://github.com/commontk/PythonQt#patched-2...
r202 # associated with the Qt version being used.
Orochimarufan
Now Works with Python 2 & 3, Qt 4 & 5....
r208 set(generated_cpp_suffix "_${QT_VERSION_MAJOR}${QT_VERSION_MINOR}")
Orochimarufan
Redo CMake build system, get Qt5 support...
r205
florianlink
integrated changes from https://github.com/commontk/PythonQt#patched-2...
r202 if("${generated_cpp_suffix}" STREQUAL "_48")
Orochimarufan
Redo CMake build system, get Qt5 support...
r205 set(generated_cpp_suffix "")
florianlink
integrated changes from https://github.com/commontk/PythonQt#patched-2...
r202 endif()
if("${generated_cpp_suffix}" STREQUAL "_46")
Orochimarufan
Redo CMake build system, get Qt5 support...
r205 set(generated_cpp_suffix "_47") # Also use 4.7 wrappers for 4.6.x version
endif()
if("${generated_cpp_suffix}" STREQUAL "_51")
set(generated_cpp_suffix "_50")
florianlink
integrated changes from https://github.com/commontk/PythonQt#patched-2...
r202 endif()
florianlink
merged contributions from https://github.com/commontk/PythonQt/compare/svn-mirror...patched...
r166 #-----------------------------------------------------------------------------
Orochimarufan
Redo CMake build system, get Qt5 support...
r205 # Generator
Orochimarufan
Start Python 3.x Port...
r206 if(PythonQt_Qt5)
add_subdirectory(generator_50 EXCLUDE_FROM_ALL)
add_custom_target(generator)
add_dependencies(generator pythonqt_generator)
endif()
florianlink
merged contributions from https://github.com/commontk/PythonQt/compare/svn-mirror...patched...
r166
Orochimarufan
Redo CMake build system, get Qt5 support...
r205 # TODO
florianlink
merged contributions from https://github.com/commontk/PythonQt/compare/svn-mirror...patched...
r166
#-----------------------------------------------------------------------------
Orochimarufan
Redo CMake build system, get Qt5 support...
r205 # Build options
florianlink
merged contributions from https://github.com/commontk/PythonQt/compare/svn-mirror...patched...
r166
Orochimarufan
Redo CMake build system, get Qt5 support...
r205 #option(PythonQt_Wrap_QtAll "Make all Qt components available in python" OFF)
#
#set(qtlibs core gui network opengl sql svg uitools webkit xml xmlpatterns)
#foreach(qtlib ${qtlibs})
# OPTION(PythonQt_Wrap_Qt${qtlib} "Make all of Qt${qtlib} available in python" OFF)
#endforeach()
florianlink
merged contributions from https://github.com/commontk/PythonQt/compare/svn-mirror...patched...
r166
Orochimarufan
Redo CMake build system, get Qt5 support...
r205 # Force option if it applies
#if(PythonQt_Wrap_QtAll)
# list(REMOVE_ITEM qtlibs xmlpatterns) # xmlpatterns wrapper does *NOT* build at all :(
# foreach(qtlib ${qtlibs})
# if(NOT ${PythonQt_Wrap_Qt${qtlib}})
# set(PythonQt_Wrap_Qt${qtlib} ON CACHE BOOL "Make all of Qt${qtlib} available in python" FORCE)
# message(STATUS "Enabling [PythonQt_Wrap_Qt${qtlib}] because of [PythonQt_Wrap_QtAll] evaluates to True")
# endif()
# endforeach()
#endif()
florianlink
merged contributions from https://github.com/commontk/PythonQt/compare/svn-mirror...patched...
r166
#-----------------------------------------------------------------------------
# Add extra sources
Orochimarufan
Redo CMake build system, get Qt5 support...
r205 #foreach(qtlib core gui network opengl sql svg uitools webkit xml xmlpatterns)
#
# if (${PythonQt_Wrap_Qt${qtlib}})
#
# ADD_DEFINITIONS(-DPYTHONQT_WRAP_Qt${qtlib})
#
# set(file_prefix generated_cpp${generated_cpp_suffix}/com_trolltech_qt_${qtlib}/com_trolltech_qt_${qtlib})
#
# foreach(index RANGE 0 11)
#
# # Source files
# if(EXISTS ${CMAKE_CURRENT_SOURCE_DIR}/${file_prefix}${index}.cpp)
# list(APPEND sources ${file_prefix}${index}.cpp)
# endif()
#
# # Headers that should run through moc
# if(EXISTS ${CMAKE_CURRENT_SOURCE_DIR}/${file_prefix}${index}.h)
# list(APPEND moc_sources ${file_prefix}${index}.h)
# endif()
#
# endforeach()
#
# list(APPEND sources ${file_prefix}_init.cpp)
#
# endif()
#endforeach()
florianlink
merged contributions from https://github.com/commontk/PythonQt/compare/svn-mirror...patched...
r166
#-----------------------------------------------------------------------------
Orochimarufan
Redo CMake build system, get Qt5 support...
r205 # Find Python
option(PythonQt_Python3 "Use Python 3.x (3.3+)" OFF)
Orochimarufan
Fix __getattr__ problems.
r207 option(PythonQt_Python "Use specific Python Version" OFF)
if(PythonQt_Python)
find_package(Python ${PythonQt_Python} REQUIRED EXACT)
elseif(PythonQt_Python3)
find_package(Python 3.3 REQUIRED)
else()
find_package(Python 2.6 REQUIRED)
Orochimarufan
Redo CMake build system, get Qt5 support...
r205 endif()
florianlink
merged contributions from https://github.com/commontk/PythonQt/compare/svn-mirror...patched...
r166
Orochimarufan
Add PythonQt*Config.cmake
r211 if(NOT ${PYTHON_VERSION} VERSION_LESS 3)
set(PythonQt_Python3 ON)
else()
set(PythonQt_Python3 OFF)
endif()
Orochimarufan
Redo CMake build system, get Qt5 support...
r205 include_directories(${PYTHON_INCLUDE_DIRS})
add_definitions(-DPYTHONQT_USE_RELEASE_PYTHON_FALLBACK)
florianlink
merged contributions from https://github.com/commontk/PythonQt/compare/svn-mirror...patched...
r166
Orochimarufan
Now Works with Python 2 & 3, Qt 4 & 5....
r208 #-----------------------------------------------------------------------------
# Library Name
Orochimarufan
Fix PythonQt*Config*.cmake
r212 # The variable PythonQt contains the PythonQt core library name
Orochimarufan
Now Works with Python 2 & 3, Qt 4 & 5....
r208 # It incorporates library mayor versions
Orochimarufan
Fix PythonQt*Config*.cmake
r212 set(PythonQt PythonQt)
Orochimarufan
Now Works with Python 2 & 3, Qt 4 & 5....
r208
if(PythonQt_Qt5)
Orochimarufan
Fix PythonQt*Config*.cmake
r212 set(PythonQt ${PythonQt}5)
Orochimarufan
Now Works with Python 2 & 3, Qt 4 & 5....
r208 endif()
Orochimarufan
Add PythonQt*Config.cmake
r211 if(PythonQt_Python3)
Orochimarufan
Fix PythonQt*Config*.cmake
r212 set(PythonQt ${PythonQt}_3)
Orochimarufan
Now Works with Python 2 & 3, Qt 4 & 5....
r208 endif()
Orochimarufan
Fix PythonQt*Config*.cmake
r212 set(CMAKE_DEBUG_POSTFIX "_d")
Orochimarufan
Now Works with Python 2 & 3, Qt 4 & 5....
r208
Orochimarufan
Fix PythonQt*Config*.cmake
r212 message(STATUS "Building ${PythonQt} (Qt ${QT_VERSION_MAJOR}.${QT_VERSION_MINOR}.${QT_VERSION_PATCH} + Python ${PYTHON_VERSION} | ${CMAKE_BUILD_TYPE})")
Orochimarufan
Now Works with Python 2 & 3, Qt 4 & 5....
r208
Orochimarufan
Fix __getattr__ problems.
r207 #-----------------------------------------------------------------------------
# Core
Orochimarufan
Redo CMake build system, get Qt5 support...
r205 add_subdirectory(src)
florianlink
merged contributions from https://github.com/commontk/PythonQt/compare/svn-mirror...patched...
r166
#-----------------------------------------------------------------------------
Orochimarufan
Redo CMake build system, get Qt5 support...
r205 # Tests
add_subdirectory(tests EXCLUDE_FROM_ALL)
# test alias
add_custom_target(test COMMAND tests/PythonQtTest WORKING_DIRECTORY ${CURRENT_BINARY_DIR})
add_dependencies(test PythonQtTest)
florianlink
merged contributions from https://github.com/commontk/PythonQt/compare/svn-mirror...patched...
r166
#-----------------------------------------------------------------------------
Orochimarufan
Redo CMake build system, get Qt5 support...
r205 # Extenseions (QtAll)
Orochimarufan
Add PythonQt*Config.cmake
r211 add_subdirectory(extensions)
Orochimarufan
Redo CMake build system, get Qt5 support...
r205 # QtAll alias
add_custom_target(QtAll)
Orochimarufan
Add PythonQt*Config.cmake
r211 add_dependencies(QtAll ${PythonQt_QtAll})
florianlink
merged contributions from https://github.com/commontk/PythonQt/compare/svn-mirror...patched...
r166
Orochimarufan
Redo CMake build system, get Qt5 support...
r205 #-----------------------------------------------------------------------------
# Examples
include_directories(src)
include_directories(extensions/PythonQt_QtAll)
add_subdirectory(examples EXCLUDE_FROM_ALL)
Orochimarufan
Add PythonQt*Config.cmake
r211
#-----------------------------------------------------------------------------
# uninstall target
configure_file(
"${CMAKE_CURRENT_SOURCE_DIR}/cmake/cmake_uninstall.cmake.in"
"${CMAKE_CURRENT_BINARY_DIR}/cmake_uninstall.cmake"
IMMEDIATE @ONLY)
add_custom_target(uninstall
COMMAND ${CMAKE_COMMAND} -P ${CMAKE_CURRENT_BINARY_DIR}/cmake_uninstall.cmake)