diff --git a/.github/workflows/windows.yml b/.github/workflows/windows.yml index 6d85472ebf..0e354f649f 100644 --- a/.github/workflows/windows.yml +++ b/.github/workflows/windows.yml @@ -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 diff --git a/CMakeLists.txt b/CMakeLists.txt index 72930f4e0e..5bd1436486 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -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) @@ -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() #--------------------------------------------------------------------------- diff --git a/cmake/functions.cmake b/cmake/functions.cmake index 6b959e467f..9d9a35ce7d 100644 --- a/cmake/functions.cmake +++ b/cmake/functions.cmake @@ -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()