[Kde-bindings] cmake and KDE/kdebindings/python
Simon Edwards
simon at simonzone.com
Sun Oct 28 10:49:51 UTC 2007
-------- Original Message --------
Subject: KDE/kdebindings/python
Date: Sun, 28 Oct 2007 10:38:30 +0000
From: Simon Edwards <simon at simonzone.com>
Reply-To: kde-commits at kde.org
To: kde-commits at kde.org
SVN commit 730276 by sedwards:
* Turned on PyKDE4 when building kdebindings with cmake.
* krosspython also uses the improved FindPythonLibrary.cmake.
M +30 -1 CMakeLists.txt
M +10 -0 pykde4/CMakeLists.txt
M +0 -1 pykde4/cmake/modules/FindPythonLibrary.cmake
--- trunk/KDE/kdebindings/python/CMakeLists.txt #730275:730276
@@ -1,5 +1,8 @@
-macro_optional_find_package(PythonLibs)
+GET_FILENAME_COMPONENT(_cmake_module_path ${CMAKE_CURRENT_LIST_FILE} PATH)
+SET(CMAKE_MODULE_PATH ${CMAKE_MODULE_PATH}
${_cmake_module_path}/pykde4/cmake/modules)
+macro_optional_find_package(PythonLibrary)
+
#####################################################################
# Kross Python
#
@@ -22,3 +25,29 @@
message(STATUS "Python Include Path: " ${PYTHON_INCLUDE_PATH})
endif(ENABLE_KROSSPYTHON)
message(STATUS "Build Kross Python... " ${KROSSPYTHON_ENABLED})
+
+OPTION(ENABLE_PYKDE4 "build PyKDE4" ON)
+set(PYKDE4_ENABLED "no")
+if(ENABLE_PYKDE4)
+ IF(PYTHON_LIBRARIES AND PYTHON_INCLUDE_PATH)
+
+ macro_optional_find_package(SIP)
+ IF(SIP_VERSION STRLESS "040701") # These version numbers
also appear in pykde4/CMakeLists.txt
+ MESSAGE(STATUS "The version of SIP found is too old. 4.7.1
or later is needed.")
+ SET(SIP_FOUND FALSE)
+ ENDIF(SIP_VERSION STRLESS "040701")
+ IF(SIP_FOUND)
+
+ macro_optional_find_package(PyQt4)
+ IF(PYQT4_VERSION STRLESS "040301") # These version numbers
also appear in pykde4/CMakeLists.txt
+ MESSAGE(STATUS "The version of PyQt found is too old.
4.3.1 or later is required.")
+ SET(PYQT4_FOUND FALSE)
+ ENDIF(PYQT4_VERSION STRLESS "040301")
+ IF(PYQT4_FOUND)
+ add_subdirectory(pykde4)
+ set(PYKDE4_ENABLED "yes")
+ ENDIF(PYQT4_FOUND)
+ ENDIF(SIP_FOUND)
+ ENDIF(PYTHON_LIBRARIES AND PYTHON_INCLUDE_PATH)
+endif(ENABLE_PYKDE4)
+message(STATUS "Build PyKDE4... " ${PYKDE4_ENABLED})
--- trunk/KDE/kdebindings/python/pykde4/CMakeLists.txt #730275:730276
@@ -1,5 +1,7 @@
PROJECT(pykde4)
+# This module can be built independant from the rest of kdebindings.
+
SET(CMAKE_MODULE_PATH ${pykde4_SOURCE_DIR}/cmake/modules )
FIND_PACKAGE(KDE4 REQUIRED)
@@ -8,9 +10,17 @@
INCLUDE(MacroLibrary)
FIND_PACKAGE(PythonLibrary REQUIRED)
INCLUDE(PythonMacros)
+
FIND_PACKAGE(SIP REQUIRED)
+IF(SIP_VERSION STRLESS "040701") # These version numbers also appear
in ../CMakeLists.txt
+ MESSAGE(FATAL_ERROR "The version of SIP found is too old. 4.7.1 or
later is needed.")
+ENDIF(SIP_VERSION STRLESS "040701")
INCLUDE(SIPMacros)
+
FIND_PACKAGE(PyQt4 REQUIRED)
+IF(PYQT4_VERSION STRLESS "040301") # These version numbers also appear
in ../CMakeLists.txt
+ MESSAGE(FATAL_ERROR "The version of PyQt found is too old. 4.3.1 or
later is required.")
+ENDIF(PYQT4_VERSION STRLESS "040301")
INCLUDE_DIRECTORIES(
${PYTHON_INCLUDE_PATH}
---
trunk/KDE/kdebindings/python/pykde4/cmake/modules/FindPythonLibrary.cmake
#730275:730276
@@ -28,7 +28,6 @@
ELSE(PYTHON_LIBRARY)
FIND_PACKAGE(PythonInterp REQUIRED)
-
GET_FILENAME_COMPONENT(_cmake_module_path ${CMAKE_CURRENT_LIST_FILE}
PATH)
EXECUTE_PROCESS(COMMAND ${PYTHON_EXECUTABLE}
${_cmake_module_path}/FindLibPython.py OUTPUT_VARIABLE python_config)
--
Simon Edwards | KDE-NL, Guidance tools, Guarddog Firewall
simon at simonzone.com | http://www.simonzone.com/software/
Nijmegen, The Netherlands | "ZooTV? You made the right choice."
More information about the Kde-bindings
mailing list