diff options
author | Marcelo Lira <marcelo.lira@openbossa.org> | 2010-07-20 15:30:31 -0300 |
---|---|---|
committer | Marcelo Lira <marcelo.lira@openbossa.org> | 2010-07-21 17:14:34 -0300 |
commit | 2194250dbb9d8863d70b90e167b4d3527ff832ed (patch) | |
tree | 7a22ff7607040da9961e2a0c300bd478c4b7f823 /cmake | |
parent | 10828a918d387d34cafb8709cea18f02d1af7af2 (diff) |
Added a custom cmake file to help finding Python debug provisions.
Reviewed by Luciano Wolf <luciano.wolf@openbossa.org>
Reviewed by Renato Araújo <renato.filho@openbossa.org>
Diffstat (limited to 'cmake')
-rw-r--r-- | cmake/Modules/FindPythonInterpWithDebug.cmake | 21 |
1 files changed, 21 insertions, 0 deletions
diff --git a/cmake/Modules/FindPythonInterpWithDebug.cmake b/cmake/Modules/FindPythonInterpWithDebug.cmake new file mode 100644 index 000000000..264dd5d81 --- /dev/null +++ b/cmake/Modules/FindPythonInterpWithDebug.cmake @@ -0,0 +1,21 @@ +INCLUDE(FindPythonInterp) + +find_package(PythonInterp REQUIRED) + +#Fix missing variable on UNIX env +if(NOT PYTHON_DEBUG_LIBRARIES AND UNIX) + set(PYTHON_DEBUG_LIBRARIES "${PYTHON_LIBRARIES}") +endif() + +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}") + set(PYTHON_EXECUTABLE_TMP "${PYTHON_EXECUTABLE}") + endif() + + set(PYTHON_EXECUTABLE "${PYTHON_EXECUTABLE_TMP}") +endif() + |