diff options
author | Orcan Ogetbil <oget.fedora@gmail.com> | 2012-07-08 15:28:08 +0000 |
---|---|---|
committer | Orcan Ogetbil <oget.fedora@gmail.com> | 2012-07-08 15:28:08 +0000 |
commit | 7926d216fc1f483b2cfb9b368ea3ae45c3ff8463 (patch) | |
tree | e669e363bbd0bf8c5b38812de008926b2d5967df /muse2 | |
parent | 164c30b96d94561ba71c770eb0598d0195728615 (diff) |
smarter detection of python with older cmake
Diffstat (limited to 'muse2')
-rw-r--r-- | muse2/CMakeLists.txt | 9 |
1 files changed, 9 insertions, 0 deletions
diff --git a/muse2/CMakeLists.txt b/muse2/CMakeLists.txt index a10c7a6d..79f75e66 100644 --- a/muse2/CMakeLists.txt +++ b/muse2/CMakeLists.txt @@ -249,6 +249,15 @@ endif (ENABLE_OSC) if (ENABLE_PYTHON) include(FindPythonLibs) if (PYTHONLIBS_FOUND) +# Older cmake does not define PYTHON_INCLUDE_DIRS and PYTHONLIBS_VERSION_STRING. +# We need to define them ourselves to do a version comparison + if(DEFINED PYTHON_INCLUDE_PATH AND NOT DEFINED PYTHON_INCLUDE_DIRS) + set(PYTHON_INCLUDE_DIRS ${PYTHON_INCLUDE_PATH}) + endif(DEFINED PYTHON_INCLUDE_PATH AND NOT DEFINED PYTHON_INCLUDE_DIRS) + if(NOT DEFINED PYTHONLIBS_VERSION_STRING) + STRING(REGEX REPLACE ".*python(2\\.[0-9]+)" "\\1" + PYTHONLIBS_VERSION_STRING "${PYTHON_INCLUDE_DIRS}") + endif(NOT DEFINED PYTHONLIBS_VERSION_STRING) if (NOT PYTHONLIBS_VERSION_STRING VERSION_LESS 2.4) set(PYTHON_SUPPORT ON) endif (NOT PYTHONLIBS_VERSION_STRING VERSION_LESS 2.4) |