aboutsummaryrefslogtreecommitdiffstats
path: root/cmake
diff options
context:
space:
mode:
authorPaulo Alcantara <pcacjr@gmail.com>2012-01-18 23:29:44 -0300
committerHugo Parente Lima <hugo.pl@gmail.com>2012-03-09 16:50:33 -0300
commit01a092b1453aced87eb10454fb03ea2f9a085cf3 (patch)
tree12eac6b9fe4a34efb6954eac75240302d5697f37 /cmake
parentf4e5ec5018b948cf774f2ef20dd46faced13d18e (diff)
On Fedora systems we usually have the binary of the Python interpreter compiled with debug as "python2.7-debug" for example. So we also need to check its suffix as debug, not only as dbg (which is a Debian specific case).
Signed-off-by: Paulo Alcantara <pcacjr@gmail.com> Reviewed-by: Hugo Parente Lima <hugo.pl@gmail.com>
Diffstat (limited to 'cmake')
-rw-r--r--cmake/Modules/FindPythonInterpWithDebug.cmake20
1 files changed, 12 insertions, 8 deletions
diff --git a/cmake/Modules/FindPythonInterpWithDebug.cmake b/cmake/Modules/FindPythonInterpWithDebug.cmake
index 2b9cd0980..7722d9569 100644
--- a/cmake/Modules/FindPythonInterpWithDebug.cmake
+++ b/cmake/Modules/FindPythonInterpWithDebug.cmake
@@ -1,17 +1,23 @@
find_program(PYTHON_EXECUTABLE NAMES python2.7 python2.6 python2.5)
-if(NOT PYTHON_EXECUTABLE)
+if (NOT PYTHON_EXECUTABLE)
find_package(PythonInterp REQUIRED)
else()
set(PYTHONINTERP_FOUND 1)
endif()
-if(PYTHONINTERP_FOUND AND UNIX AND CMAKE_BUILD_TYPE STREQUAL "Debug")
+if (PYTHONINTERP_FOUND AND UNIX AND CMAKE_BUILD_TYPE STREQUAL "Debug")
# This is for Debian
set(PYTHON_EXECUTABLE_TMP "${PYTHON_EXECUTABLE}-dbg")
- # Fall back to the standard interpreter.
- if(NOT EXISTS "${PYTHON_EXECUTABLE_TMP}")
+ if (NOT EXISTS "${PYTHON_EXECUTABLE_TMP}")
+ # On Fedora we usually have the suffix as debug. As we didn't
+ # find python interpreter with the suffix dbg we'll fall back
+ # to the suffix as debug.
+ set(PYTHON_EXECUTABLE_TMP "${PYTHON_EXECUTABLE}-debug")
+ endif()
+ # Falling back to the standard interpreter.
+ if (NOT EXISTS "${PYTHON_EXECUTABLE_TMP}")
set(PYTHON_EXECUTABLE_TMP "${PYTHON_EXECUTABLE}")
endif()
@@ -34,8 +40,8 @@ execute_process(
OUTPUT_VARIABLE PYTHON_SUFFIX
OUTPUT_STRIP_TRAILING_WHITESPACE)
-#Fix missing variable on UNIX env
-if(NOT PYTHON_DEBUG_LIBRARIES AND UNIX)
+# Fix missing variable on UNIX env
+if (NOT PYTHON_DEBUG_LIBRARIES AND UNIX)
string(REPLACE "-dbg" "" PYTHON_NAME_TMP ${PYTHON_SUFFIX})
string(REPLACE "-python" "python" PYTHON_NAME ${PYTHON_NAME_TMP})
find_library(LIBRARY_FOUND ${PYTHON_NAME}_d)
@@ -45,5 +51,3 @@ if(NOT PYTHON_DEBUG_LIBRARIES AND UNIX)
set(PYTHON_DEBUG_LIBRARIES "${PYTHON_LIBRARIES}")
endif()
endif()
-
-