summaryrefslogtreecommitdiffstats
path: root/cmake
diff options
context:
space:
mode:
authorMarcelo Lira <marcelo.lira@openbossa.org>2010-07-21 17:10:48 -0300
committerMarcelo Lira <marcelo.lira@openbossa.org>2010-07-21 17:15:14 -0300
commite5042dc193bbcb4b1566594d832076adfef5fd94 (patch)
tree54ab6fc2b853deb7323b54d64447a53f942ef444 /cmake
parentcb7d3e95a27392e504f3b99deacddb3a3e0a8a56 (diff)
downloadpyside-e5042dc193bbcb4b1566594d832076adfef5fd94.tar.gz
pyside-e5042dc193bbcb4b1566594d832076adfef5fd94.tar.xz
pyside-e5042dc193bbcb4b1566594d832076adfef5fd94.zip
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.cmake21
1 files changed, 21 insertions, 0 deletions
diff --git a/cmake/Modules/FindPythonInterpWithDebug.cmake b/cmake/Modules/FindPythonInterpWithDebug.cmake
new file mode 100644
index 0000000..264dd5d
--- /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()
+