Skip to content

Commit

Permalink
python: Add debug output
Browse files Browse the repository at this point in the history
  • Loading branch information
jorisv committed Nov 2, 2023
1 parent 7ed114a commit eafcead
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion python.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -112,7 +112,7 @@ macro(FINDPYTHON)
endif()
endif()

if(NOT DEFINED Python_EXCUTABLE)
if(NOT DEFINED Python_EXECUTABLE)
set(Python_EXECUTABLE ${PYTHON_EXECUTABLE})
endif()
else()
Expand Down Expand Up @@ -218,9 +218,11 @@ macro(FINDPYTHON)
message(STATUS "PythonInterp: ${PYTHON_EXECUTABLE}")

# Set PYTHON_INCLUDE_DIR variables if it is not defined by the user
message(STATUS "PYTHON_EXECUTABLE ${PYTHON_EXECUTABLE}")
if(DEFINED PYTHON_EXECUTABLE)
# Retrieve the corresponding value of PYTHON_INCLUDE_DIR if it is not
# defined
message(STATUS "PYTHON_INCLUDE_DIR ${PYTHON_INCLUDE_DIR}")
if(NOT DEFINED PYTHON_INCLUDE_DIR)
if(PYTHON_VERSION_MAJOR EQUAL "2")
set(_PYTHON_INCLUDE_DIR_CMD
Expand All @@ -230,10 +232,12 @@ macro(FINDPYTHON)
set(_PYTHON_INCLUDE_DIR_CMD
"import sysconfig; print(sysconfig.get_path('include'))")
endif()
message(STATUS "_PYTHON_INCLUDE_DIR_CMD ${_PYTHON_INCLUDE_DIR_CMD}")
execute_process(
COMMAND "${PYTHON_EXECUTABLE}" "-c" ${_PYTHON_INCLUDE_DIR_CMD}
OUTPUT_VARIABLE PYTHON_INCLUDE_DIR
ERROR_QUIET)
message(STATUS "PYTHON_INCLUDE_DIR ${PYTHON_INCLUDE_DIR}")
string(STRIP "${PYTHON_INCLUDE_DIR}" PYTHON_INCLUDE_DIR)
endif()
set(PYTHON_INCLUDE_DIRS ${PYTHON_INCLUDE_DIR})
Expand Down

0 comments on commit eafcead

Please sign in to comment.