summaryrefslogtreecommitdiffstats
path: root/cmake/Modules/FindPythonInterpWithDebug.cmake
blob: 264dd5d818a75026c9e31aaa2e58e202b173b83f (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
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()