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 400cee4 commit 21fd943
Show file tree
Hide file tree
Showing 3 changed files with 31 additions and 25 deletions.
1 change: 1 addition & 0 deletions .github/workflows/windows.yml
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,7 @@ jobs:
curl
git
mingw-w64-ucrt-x86_64-gcc
mingw-w64-ucrt-x86_64-python
mingw-w64-ucrt-x86_64-gtkmm3
mingw-w64-ucrt-x86_64-boost
mingw-w64-ucrt-x86_64-sqlite3
Expand Down
48 changes: 24 additions & 24 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -296,8 +296,8 @@ 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(Python_EXECUTABLE "/usr/bin/python3")
# set(PYTHON_EXECUTABLE "/usr/bin/python3")
endif()
find_package(Python COMPONENTS Interpreter Development)
find_package(pybind11 CONFIG)
Expand Down Expand Up @@ -475,33 +475,33 @@ if(WIN32)
install(DIRECTORY deps/ DESTINATION . FILES_MATCHING PATTERN "*.dll")

# And install a few more which, for reasons unknown, are not reported by dll.
install(FILES C:/msys64/ucrt64/bin/libcharset-1.dll DESTINATION .)
install(FILES C:/msys64/ucrt64/bin/librsvg-2-2.dll DESTINATION .)
install(FILES C:/msys64/ucrt64/bin/libxml2-2.dll DESTINATION .)
install(FILES C:/msys64/ucrt64/bin/liblzma-5.dll DESTINATION .)
winstall(FILES /ucrt64/bin/libcharset-1.dll DESTINATION .)
winstall(FILES /ucrt64/bin/librsvg-2-2.dll DESTINATION .)
winstall(FILES /ucrt64/bin/libxml2-2.dll DESTINATION .)
winstall(FILES /ucrt64/bin/liblzma-5.dll DESTINATION .)
# FIXME: these can be found by running ldd on numpy and matplotlib dlls.
install(FILES C:/msys64/ucrt64/bin/libopenblas.dll DESTINATION .)
install(FILES C:/msys64/ucrt64/bin/libgomp-1.dll DESTINATION .)
install(FILES C:/msys64/ucrt64/bin/libgfortran-5.dll DESTINATION .)
install(FILES C:/msys64/ucrt64/bin/libquadmath-0.dll DESTINATION .)
install(FILES C:/msys64/ucrt64/bin/libsharpyuv-0.dll DESTINATION .)
install(FILES C:/msys64/ucrt64/bin/libjpeg-8.dll DESTINATION .)
install(FILES C:/msys64/ucrt64/bin/libtiff-6.dll DESTINATION .)
install(FILES C:/msys64/ucrt64/bin/libdeflate.dll DESTINATION .)
install(FILES C:/msys64/ucrt64/bin/libjbig-0.dll DESTINATION .)
install(FILES C:/msys64/ucrt64/bin/libLerc.dll DESTINATION .)
install(FILES C:/msys64/ucrt64/bin/libwebp-7.dll DESTINATION .)
install(FILES C:/msys64/ucrt64/bin/libzstd.dll DESTINATION .)
install(FILES C:/msys64/ucrt64/bin/imagequant.dll DESTINATION .)
install(FILES C:/msys64/ucrt64/bin/libopenjp2-7.dll DESTINATION .)
winstall(FILES /ucrt64/bin/libopenblas.dll DESTINATION .)
winstall(FILES /ucrt64/bin/libgomp-1.dll DESTINATION .)
winstall(FILES /ucrt64/bin/libgfortran-5.dll DESTINATION .)
winstall(FILES /ucrt64/bin/libquadmath-0.dll DESTINATION .)
winstall(FILES /ucrt64/bin/libsharpyuv-0.dll DESTINATION .)
winstall(FILES /ucrt64/bin/libjpeg-8.dll DESTINATION .)
winstall(FILES /ucrt64/bin/libtiff-6.dll DESTINATION .)
winstall(FILES /ucrt64/bin/libdeflate.dll DESTINATION .)
winstall(FILES /ucrt64/bin/libjbig-0.dll DESTINATION .)
winstall(FILES /ucrt64/bin/libLerc.dll DESTINATION .)
winstall(FILES /ucrt64/bin/libwebp-7.dll DESTINATION .)
winstall(FILES /ucrt64/bin/libzstd.dll DESTINATION .)
winstall(FILES /ucrt64/bin/imagequant.dll DESTINATION .)
winstall(FILES /ucrt64/bin/libopenjp2-7.dll DESTINATION .)

# We need gdbus to setup the dbus, needed by Glib, otherwise anything
# gtk-related will just bail out at start. We also need the helper
# program to spawn programs using Glib.
install(FILES C:/msys64/ucrt64/bin/gdbus.exe DESTINATION .)
install(FILES C:/msys64/ucrt64/bin/gspawn-win64-helper.exe DESTINATION .)
install(FILES C:/msys64/ucrt64/bin/gspawn-win64-helper-console.exe DESTINATION .)
install(FILES C:/msys64/ucrt64/bin/gdk-pixbuf-query-loaders.exe DESTINATION .)
winstall(FILES /ucrt64/bin/gdbus.exe DESTINATION .)
winstall(FILES /ucrt64/bin/gspawn-win64-helper.exe DESTINATION .)
winstall(FILES /ucrt64/bin/gspawn-win64-helper-console.exe DESTINATION .)
winstall(FILES /ucrt64/bin/gdk-pixbuf-query-loaders.exe DESTINATION .)
endif()

#---------------------------------------------------------------------------
Expand Down
7 changes: 6 additions & 1 deletion cmake/functions.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -21,4 +21,9 @@ macro(install_directory_permissions DIR)
)
endmacro()


# Macro just like `install`, but converting the path from a unix
# path to a windows path using `cygpath`.
macro(install_for_win TMP1 FILE TMP2 DEST)
execute_process(COMMAND cygpath -m ${FILE} OUTPUT_VARIABLE WFILE)
install(FILES ${WFILE} DESTINATION ${DEST})
endmacro()

0 comments on commit 21fd943

Please sign in to comment.