Skip to content

Commit

Permalink
Do not assume that msys is on the C drive.
Browse files Browse the repository at this point in the history
  • Loading branch information
Kasper Peeters committed Sep 27, 2024
1 parent 0796034 commit 02f224e
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 7 deletions.
16 changes: 10 additions & 6 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -293,13 +293,17 @@ include(GNUInstallDirs)

set(Python_POSTFIX "3")
if(WIN32)
# Set the PYTHON_EXECUTABLE variable explicitly to ensure
# that we use the msys2 python, not anything else that may
# be floating around too (like on github runners...).
# set(Python_EXECUTABLE "/usr/bin/python3")
# set(PYTHON_EXECUTABLE "/usr/bin/python3")
# Set a hint for finding Python, so we hopefully get the msys
# version. This otherwise breaks on github runners.
execute_process(
COMMAND cygpath -m /ucrt64/usr/bin/
OUTPUT_VARIABLE PYTHON_HINT
OUTPUT_STRIP_TRAILING_WHITESPACE
)
find_package(Python COMPONENTS Interpreter Development HINTS ${PYTHON_HINT})
else()
find_package(Python COMPONENTS Interpreter Development)
endif()
find_package(Python COMPONENTS Interpreter Development)
find_package(pybind11 CONFIG)
if (NOT pybind11_FOUND)
message(STATUS "Using included pybind11.")
Expand Down
2 changes: 1 addition & 1 deletion cmake/functions.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,6 @@ endmacro()
# Macro just like `install`, but converting the path from a unix
# path to a windows path using `cygpath`.
macro(winstall TMP1 FILE TMP2 DEST)
execute_process(COMMAND cygpath -m ${FILE} OUTPUT_VARIABLE WFILE)
execute_process(COMMAND cygpath -m ${FILE} OUTPUT_VARIABLE WFILE OUTPUT_STRIP_TRAILING_WHITESPACE)
install(FILES ${WFILE} DESTINATION ${DEST})
endmacro()

0 comments on commit 02f224e

Please sign in to comment.