Skip to content

Commit

Permalink
Strip some absolute paths, to keep cpack on windows happy.
Browse files Browse the repository at this point in the history
  • Loading branch information
Kasper Peeters committed Sep 21, 2024
1 parent 2116594 commit 7f53cab
Showing 1 changed file with 7 additions and 7 deletions.
14 changes: 7 additions & 7 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -305,7 +305,7 @@ if(WIN32)
set(PYTHON_SITE_PATH ${CMAKE_INSTALL_PREFIX}/bin/lib/python${Python_VERSION_MAJOR}.${Python_VERSION_MINOR}/site-packages)
# NOTE: if you change the CDB_BIN_PATH, you also need to change the stripping
# logic in InstallPrefix.cc.
set(CDB_BIN_PATH ${CMAKE_INSTALL_PREFIX})
set(CDB_BIN_PATH "")
else()
set(CDB_BIN_PATH bin)
if(PACKAGING_MODE AND IS_DEBIAN_PACKAGE)
Expand Down Expand Up @@ -431,14 +431,14 @@ if(WIN32)
# run on the '*.pyd' file, but if we rename or copy it to have extension '.dll'
# all goes through fine...
add_custom_command(
OUTPUT ${CMAKE_BINARY_DIR}/ldd_dependencies.txt
OUTPUT ldd_dependencies.txt
COMMAND cp core/cadabra2.pyd core/cadabra2.dll
COMMAND ldd core/cadabra2.dll ${EXECUTABLES} > ldd_dependencies.txt
COMMAND rm core/cadabra2.dll
DEPENDS core/cadabra2.pyd ${EXECUTABLES}
COMMENT "Running ldd to gather shared library dependencies for ${EXECUTABLES}"
)
add_custom_target("LDD_deps" ALL echo -n DEPENDS ${CMAKE_BINARY_DIR}/ldd_dependencies.txt)
add_custom_target("LDD_deps" ALL echo -n DEPENDS ldd_dependencies.txt)

# Read ldd output and install dependencies
install(CODE [[
Expand All @@ -451,17 +451,17 @@ if(WIN32)
# message(STATUS "Found dependency: ${CMAKE_MATCH_1}")
execute_process(COMMAND cygpath -m ${CMAKE_MATCH_1} OUTPUT_VARIABLE WINPATH OUTPUT_STRIP_TRAILING_WHITESPACE)
# message(STATUS "Copying dependency: ${WINPATH}")
file(INSTALL ${WINPATH} DESTINATION ${CMAKE_INSTALL_PREFIX}/)
file(INSTALL ${WINPATH} DESTINATION "")
endif()
endforeach()
]])

# 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 ${CMAKE_INSTALL_PREFIX}/)
install(FILES C:/msys64/ucrt64/bin/gspawn-win64-helper.exe DESTINATION ${CMAKE_INSTALL_PREFIX}/)
install(FILES C:/msys64/ucrt64/bin/gspawn-win64-helper-console.exe DESTINATION ${CMAKE_INSTALL_PREFIX}/)
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 "")
endif()

#---------------------------------------------------------------------------
Expand Down

0 comments on commit 7f53cab

Please sign in to comment.