[kross-interpreters] /: KROSS_PYTHON only works with python 2.x so reject python3.

Michael Jansen kde at michael-jansen.biz
Mon Mar 18 19:26:49 UTC 2013


Git commit beb295d205e1ef2c9758cf38bf634ffb74abeafd by Michael Jansen.
Committed on 18/03/2013 at 20:24.
Pushed by mjansen into branch 'master'.

KROSS_PYTHON only works with python 2.x so reject python3.

CCMAIL: kde-buildsystem at kde.org
CCMAIL: kde-bindings at kde.org

M  +13   -1    CMakeLists.txt
M  +0    -1    python/CMakeLists.txt

http://commits.kde.org/kross-interpreters/beb295d205e1ef2c9758cf38bf634ffb74abeafd

diff --git a/CMakeLists.txt b/CMakeLists.txt
index c4fe9e4..1276019 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -12,7 +12,19 @@ include(MacroLibrary)
 add_definitions (${QT_DEFINITIONS} ${KDE4_DEFINITIONS} -DQT3_SUPPORT)
 include_directories (${KDE4_INCLUDES})
 
-find_package(PythonLibrary)
+# TODO: PYTHON3 Port: Use "find_package(PythonLibs 2 REQUIRED)" (CMAKE MODULE not KDELIBS)
+find_package(PythonLibrary 2 REQUIRED QUIET)
+if(PYTHONLIBRARY_FOUND)
+    if(PYTHON_VERSION_MAJOR EQUAL 3)
+        message(STATUS "Found Python: ${PYTHON_EXECUTABLE} (found version \"${PYTHON_VERSION_STRING}\") but only 2.x supported")
+        set(PYTHONINTERP_FOUND False)
+        set(PYTHONLIBRARY_FOUND False)
+    else()
+        message(STATUS "Found Python: ${PYTHON_EXECUTABLE} (found version \"${PYTHON_VERSION_STRING}\")")
+    endif()
+endif()
+
+
 find_package(FALCON)
 
 if(PYTHONLIBRARY_FOUND)
diff --git a/python/CMakeLists.txt b/python/CMakeLists.txt
index 3df4ebb..70191a3 100644
--- a/python/CMakeLists.txt
+++ b/python/CMakeLists.txt
@@ -1,6 +1,5 @@
 PROJECT(KROSSPYTHON)
 
-find_package(PythonLibrary REQUIRED)
 include(PythonMacros)
 
 include_directories(



More information about the Kde-buildsystem mailing list