aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorRenato Filho <renato.filho@openbossa.org>2011-09-28 15:41:11 -0300
committerHugo Parente Lima <hugo.pl@gmail.com>2012-03-08 16:18:17 -0300
commit26672bda4a67e69c81b8a385d222d56419f286ff (patch)
tree02c19ac1f3cab5736fb896a119b69a75f3028815
parent2d47b4ec2e4f8119b11cdabe0e56ca55152c120d (diff)
Fix CMake FinPython3 script.
-rw-r--r--cmake/Modules/FindPython3Interp.cmake11
-rw-r--r--cmake/Modules/FindPython3InterpWithDebug.cmake6
2 files changed, 15 insertions, 2 deletions
diff --git a/cmake/Modules/FindPython3Interp.cmake b/cmake/Modules/FindPython3Interp.cmake
index a77029160..373982e21 100644
--- a/cmake/Modules/FindPython3Interp.cmake
+++ b/cmake/Modules/FindPython3Interp.cmake
@@ -27,11 +27,22 @@ FIND_PROGRAM(PYTHON3_EXECUTABLE
[HKEY_LOCAL_MACHINE\\SOFTWARE\\Python\\PythonCore\\3.0\\InstallPath]
)
+FIND_PROGRAM(PYTHON3_DBG_EXECUTABLE
+ NAMES python3.2dmu python3.2dm python3.2du python3.2d python3.1-dbg python3.0-dbg python3-dbg
+ PATHS
+ [HKEY_LOCAL_MACHINE\\SOFTWARE\\Python\\PythonCore\\3.2\\InstallPath]
+ [HKEY_LOCAL_MACHINE\\SOFTWARE\\Python\\PythonCore\\3.1\\InstallPath]
+ [HKEY_LOCAL_MACHINE\\SOFTWARE\\Python\\PythonCore\\3.0\\InstallPath]
+ )
+
+
# handle the QUIETLY and REQUIRED arguments and set PYTHONINTERP_FOUND to TRUE if
# all listed variables are TRUE
INCLUDE(FindPackageHandleStandardArgs)
FIND_PACKAGE_HANDLE_STANDARD_ARGS(Python3Interp DEFAULT_MSG PYTHON3_EXECUTABLE)
+FIND_PACKAGE_HANDLE_STANDARD_ARGS(Python3InterpDbg DEFAULT_MSG PYTHON3_DBG_EXECUTABLE)
MARK_AS_ADVANCED(PYTHON3_EXECUTABLE)
+MARK_AS_ADVANCED(PYTHON3_DBG_EXECUTABLE)
diff --git a/cmake/Modules/FindPython3InterpWithDebug.cmake b/cmake/Modules/FindPython3InterpWithDebug.cmake
index 8791718b1..23087e653 100644
--- a/cmake/Modules/FindPython3InterpWithDebug.cmake
+++ b/cmake/Modules/FindPython3InterpWithDebug.cmake
@@ -3,9 +3,9 @@ INCLUDE(FindPython3Libs)
find_package(Python3Interp REQUIRED)
-if(PYTHON3INTERP_FOUND AND UNIX AND CMAKE_BUILD_TYPE STREQUAL "Debug")
+if(CMAKE_BUILD_TYPE STREQUAL "Debug")
# This is for Debian
- set(PYTHON3_EXECUTABLE_TMP "${PYTHON3_EXECUTABLE}-dbg")
+ set(PYTHON3_EXECUTABLE_TMP "${PYTHON3_DBG_EXECUTABLE}")
# Fall back to the standard interpreter.
if(NOT EXISTS "${PYTHON3_EXECUTABLE_TMP}")
@@ -22,6 +22,8 @@ execute_process(
OUTPUT_VARIABLE PYTHON_WITH_DEBUG
OUTPUT_STRIP_TRAILING_WHITESPACE)
+message("PYTHON WITH DEBUG: ${PYTHON3_EXECUTABLE}")
+
execute_process(
COMMAND ${PYTHON3_EXECUTABLE} -c "import sys; \\
from distutils import sysconfig; \\