summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorPaulo Alcantara <pcacjr@gmail.com>2012-01-18 23:29:44 -0300
committerPaulo Alcantara <pcacjr@gmail.com>2012-01-18 23:49:08 -0300
commitde86825f7a0fc0315165eae37d005c6e69d5bd95 (patch)
tree59d57d55592fbe17b7e129606fce9094efd1da2a
parentf79304bb37a5a5ef4b7e6ca4ecba2d5f07b9361c (diff)
downloadshiboken-de86825f7a0fc0315165eae37d005c6e69d5bd95.tar.gz
shiboken-de86825f7a0fc0315165eae37d005c6e69d5bd95.tar.xz
shiboken-de86825f7a0fc0315165eae37d005c6e69d5bd95.zip
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>
-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 2b9cd098..7722d956 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()
-
-