aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorChristian Tismer <ctismer@gmail.com>2015-06-09 20:23:56 +0200
committerChristian Tismer <ctismer@gmail.com>2015-06-09 20:23:56 +0200
commitf0998ec3bc2b838a147bdc69f98097a4d290fa08 (patch)
treecdf472ec4df560056b7ebfc635a5d516e9f3bb0c
parent0c64d1b2c6e5e0951675ad9b22294db4a10741c7 (diff)
do first adaptations of the cmake files, so that the first compilation is attempted
-rw-r--r--CMakeLists.txt36
-rw-r--r--cmake/Macros/FindQt5Extra.cmake (renamed from cmake/Macros/FindQt4Extra.cmake)28
-rw-r--r--libpyside/CMakeLists.txt2
-rw-r--r--tests/CMakeLists.txt13
-rw-r--r--tests/pysidetest/CMakeLists.txt4
5 files changed, 28 insertions, 55 deletions
diff --git a/CMakeLists.txt b/CMakeLists.txt
index 9e0e3d07e..c5f371ee2 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -2,13 +2,18 @@ include(cmake/Macros/icecc.cmake) # this must be the first line!
project(pysidebindings)
-cmake_minimum_required(VERSION 2.6)
+cmake_minimum_required(VERSION 3.1.3)
+cmake_policy(VERSION 3.1.3)
+
set(CMAKE_MODULE_PATH ${CMAKE_SOURCE_DIR}/cmake/Macros/
${CMAKE_MODULE_PATH})
-find_package(Shiboken 1.2.0 REQUIRED)
-find_package(Qt4 4.5.0 REQUIRED)
+find_package(Shiboken 2.0.0 REQUIRED)
+find_package(Qt5 REQUIRED COMPONENTS Core)
+add_definitions(${Qt5Core_DEFINITIONS})
+
find_file(GL_H "gl.h" PATH_SUFFIXES "GL")
-include(FindQt4Extra)
+message("result:" "${GL_H}")
+include(FindQt5Extra)
set(XVFB_EXEC "")
option(USE_XVFB "Uses xvfb-run with the unit tests to avoid QtGui tests popping windows on the screen." FALSE)
@@ -78,32 +83,23 @@ if(ENABLE_VERSION_SUFFIX)
set(pyside_SUFFIX "-${BINDING_API_MAJOR_VERSION}.${BINDING_API_MINOR_VERSION}")
endif()
-include(${QT_USE_FILE})
-if (${QTVERSION} VERSION_LESS 4.5.0)
- message(FATAL_ERROR "You need Qt4.5, found ${QTVERSION}.")
-endif()
+# no more supported: include(${QT_USE_FILE})
# Configure OS support
set(ENABLE_X11 "0")
set(ENABLE_MAC "0")
set(ENABLE_WIN "0")
set(ENABLE_SIMULATOR "0")
-if(Q_WS_X11)
- set(ENABLE_X11 "1")
- if(Q_WS_MAEMO_5)
- set(AUTO_OS "maemo")
- else()
- set(AUTO_OS "x11")
- endif()
-elseif(Q_WS_MAC)
+
+# no more Maemo, no more simulator
+if(CMAKE_HOST_APPLE)
set(ENABLE_MAC "1")
set(AUTO_OS "mac")
-elseif(Q_WS_WIN)
+elseif(CMAKE_HOST_WIN32)
set(ENABLE_WIN "1")
set(AUTO_OS "win")
-elseif(Q_WS_SIMULATOR)
- set(ENABLE_SIMULATOR "1")
- set(AUTO_OS "simulator")
+elseif(CMAKE_HOST_UNIX)
+ set(AUTO_OS "x11")
else()
message(FATAL_ERROR "OS not supported")
endif()
diff --git a/cmake/Macros/FindQt4Extra.cmake b/cmake/Macros/FindQt5Extra.cmake
index dc7e5c4bf..9ea6d36c9 100644
--- a/cmake/Macros/FindQt4Extra.cmake
+++ b/cmake/Macros/FindQt5Extra.cmake
@@ -1,7 +1,12 @@
#
# Try to find QtMultimedia
# TODO: Remove this hack when cmake support QtMultimedia module
-if (NOT QT_QTMULTIMEDIA_FOUND AND ${QTVERSION} VERSION_GREATER 4.5.9)
+# CT: maybe we can remove this.
+# For now, I just use the mapping to Qt5
+
+find_package(Qt5Multimedia)
+
+if (NOT Qt5Multimedia_FOUND)
find_path(QT_QTMULTIMEDIA_INCLUDE_DIR QtMultimedia
PATHS ${QT_HEADERS_DIR}/QtMultimedia
${QT_LIBRARY_DIR}/QtMultimedia.framework/Headers
@@ -16,27 +21,12 @@ if (NOT QT_QTMULTIMEDIA_FOUND AND ${QTVERSION} VERSION_GREATER 4.5.9)
endif()
endif ()
-# Try to find QtMaemo5 - it has to be done before QtGui to enable some QtMaemo5 flags
-# TODO: Remove this hack when cmake support QtMaemo5 module
-if (NOT QT_QTMAEMO5_FOUND AND ${QTVERSION} VERSION_GREATER 4.5.9)
- find_path(QT_QTMAEMO5_INCLUDE_DIR QtMaemo5
- PATHS ${QT_HEADERS_DIR}/QtMaemo5
- ${QT_LIBRARY_DIR}/QtMaemo5.framework/Headers
- NO_DEFAULT_PATH)
- find_library(QT_QTMAEMO5_LIBRARY QtMaemo5 PATHS ${QT_LIBRARY_DIR} NO_DEFAULT_PATH)
- if (QT_QTMAEMO5_INCLUDE_DIR AND QT_QTMAEMO5_LIBRARY)
- set(QT_QTMAEMO5_FOUND ON)
- set(Q_WS_MAEMO_5 ON)
- else()
- #Replace this on documentation
- set(if_Maemo5 "<!--")
- set(end_Maemo5 "-->")
- endif()
-endif ()
+# Maemo is no longer supported
# Try to find QtDeclarative
# TODO: Remove this hack when cmake support QtDeclarative module
-if (NOT QT_QTDECLARATIVE_FOUND AND ${QTVERSION} VERSION_GREATER 4.6.0)
+find_package(Qt5Declarative)
+if (NOT Qt5Declarative_FOUND)
find_path(QT_QTDECLARATIVE_INCLUDE_DIR QtDeclarative
PATHS ${QT_HEADERS_DIR}/QtDeclarative
${QT_LIBRARY_DIR}/QtDeclarative.framework/Headers
diff --git a/libpyside/CMakeLists.txt b/libpyside/CMakeLists.txt
index 4fa878f37..294d5c5d3 100644
--- a/libpyside/CMakeLists.txt
+++ b/libpyside/CMakeLists.txt
@@ -1,7 +1,7 @@
project(libpyside)
-qt4_wrap_cpp(DESTROYLISTENER_MOC "destroylistener.h")
+qt5_wrap_cpp(DESTROYLISTENER_MOC "destroylistener.h")
set(libpyside_SRC
dynamicqmetaobject.cpp
diff --git a/tests/CMakeLists.txt b/tests/CMakeLists.txt
index 282e4b7e4..8adf6df41 100644
--- a/tests/CMakeLists.txt
+++ b/tests/CMakeLists.txt
@@ -45,19 +45,6 @@ else()
ENVIRONMENT "PYTHONPATH=${TEST_PYTHONPATH};${LIBRARY_PATH_VAR}=${TEST_LIBRARY_PATH}")
endmacro()
- # Try to find QtMultimedia
- # TODO: Remove this hack when cmake support QtMultimedia module
- if (NOT QT_QTMULTIMEDIA_FOUND AND ${QTVERSION} VERSION_GREATER 4.5.9)
- find_path(QT_QTMULTIMEDIA_INCLUDE_DIR QtMultimedia
- PATHS ${QT_HEADERS_DIR}/QtMultimedia
- ${QT_LIBRARY_DIR}/QtMultimedia.framework/Headers
- NO_DEFAULT_PATH)
- find_library(QT_QTMULTIMEDIA_LIBRARY QtMultimedia PATHS ${QT_LIBRARY_DIR} NO_DEFAULT_PATH)
- if (QT_QTMULTIMEDIA_INCLUDE_DIR AND QT_QTMULTIMEDIA_LIBRARY)
- set(QT_QTMULTIMEDIA_FOUND ON)
- endif()
- endif ()
-
add_subdirectory(pysidetest)
add_subdirectory(signals)
TEST_QT_MODULE(QT_QTCORE_FOUND QtCore)
diff --git a/tests/pysidetest/CMakeLists.txt b/tests/pysidetest/CMakeLists.txt
index 7097c4e98..2667ff850 100644
--- a/tests/pysidetest/CMakeLists.txt
+++ b/tests/pysidetest/CMakeLists.txt
@@ -4,7 +4,7 @@ project(testbinding)
cmake_minimum_required(VERSION 2.6)
set(QT_USE_QTCORE 1)
-include(${QT_USE_FILE})
+# no more supported: include(${QT_USE_FILE})
add_definitions(${QT_DEFINITIONS})
add_definitions(-DQT_SHARED)
add_definitions(-DRXX_ALLOCATOR_INIT_0)
@@ -21,7 +21,7 @@ testview.h
hiddenobject.h
)
-qt4_wrap_cpp(pysidetest_MOC_SRC ${pysidetest_MOC_HEADERS})
+qt5_wrap_cpp(pysidetest_MOC_SRC ${pysidetest_MOC_HEADERS})
set(testbinding_SRC
${CMAKE_CURRENT_BINARY_DIR}/testbinding/testobject_wrapper.cpp