From 7a65a910b77ad191d69881098c47f9b0c852d92e Mon Sep 17 00:00:00 2001 From: root Date: Tue, 13 Aug 2013 01:33:19 -0700 Subject: Tue Aug 13 01:31:08 PDT 2013 --- community/freeorion/cmake_python.patch | 23 +++++++++++++++++++++++ 1 file changed, 23 insertions(+) create mode 100644 community/freeorion/cmake_python.patch (limited to 'community/freeorion/cmake_python.patch') diff --git a/community/freeorion/cmake_python.patch b/community/freeorion/cmake_python.patch new file mode 100644 index 000000000..b875fa844 --- /dev/null +++ b/community/freeorion/cmake_python.patch @@ -0,0 +1,23 @@ +--- a/client/AI/CMakeLists.txt 2012-09-10 00:11:18.659341865 +0200 ++++ b/client/AI/CMakeLists.txt 2012-09-10 00:12:37.659345189 +0200 +@@ -33,6 +33,20 @@ + find_package(PythonLibs) + if (PYTHONLIBS_FOUND) + include_directories(${PYTHON_INCLUDE_PATH}) ++ SET(_VERSION_REGEX ++ "^#define[ \t]+PY([A-Z_]*_VERSION)[ \t]+[\"]*([0-9A-Za-z\\.]+)[\"]*[ \t]*$") ++ FILE(STRINGS "${PYTHON_INCLUDE_DIR}/patchlevel.h" _VERSION_STRINGS ++ LIMIT_COUNT 10 REGEX ${_VERSION_REGEX}) ++ FOREACH(_VERSION_STRING ${_VERSION_STRINGS}) ++ STRING(REGEX REPLACE ${_VERSION_REGEX} "PYTHON\\1" ++ _VERSION_VARIABLE "${_VERSION_STRING}") ++ STRING(REGEX REPLACE ${_VERSION_REGEX} "\\2" ++ _VERSION_NUMBER "${_VERSION_STRING}") ++ SET(${_VERSION_VARIABLE} ${_VERSION_NUMBER}) ++ ENDFOREACH(_VERSION_STRING ${_VERSION_STRINGS}) ++ IF(PYTHON_MAJOR_VERSION EQUAL 3) ++ MESSAGE(FATAL_ERROR "Python 3 is not supported!") ++ ENDIF() + else () + message(FATAL_ERROR " library not found.") + endif () -- cgit v1.2.3-54-g00ecf