From 8297f16ae21d668dcb5e5e819647a655bcde7568 Mon Sep 17 00:00:00 2001 From: AnyOldName3 Date: Thu, 19 Dec 2024 15:27:51 +0000 Subject: [PATCH 1/3] Update and alphabetise install exclude paths --- CMakeLists.txt | 24 ++++++++++++++++++++---- 1 file changed, 20 insertions(+), 4 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index 728ba2ef22..7954a852a3 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -945,23 +945,39 @@ elseif(NOT APPLE) if(WIN32) INSTALL(DIRECTORY "${INSTALL_SOURCE}/" DESTINATION "." FILES_MATCHING PATTERN "*.dll" - PATTERN "deps" EXCLUDE + PATTERN ".cmake" EXCLUDE + PATTERN ".qt" EXCLUDE + PATTERN "_deps" EXCLUDE PATTERN "apps" EXCLUDE + PATTERN "bin" EXCLUDE PATTERN "CMakeFiles" EXCLUDE PATTERN "components" EXCLUDE + PATTERN "deps" EXCLUDE PATTERN "docs" EXCLUDE PATTERN "extern" EXCLUDE PATTERN "files" EXCLUDE - PATTERN "Testing" EXCLUDE) + PATTERN "lib" EXCLUDE + PATTERN "SymStore" EXCLUDE + PATTERN "symstore-venv" EXCLUDE + PATTERN "Testing" EXCLUDE + PATTERN "try-compile") INSTALL(DIRECTORY "${INSTALL_SOURCE}/" DESTINATION "." CONFIGURATIONS Debug;RelWithDebInfo FILES_MATCHING PATTERN "*.pdb" - PATTERN "deps" EXCLUDE + PATTERN ".cmake" EXCLUDE + PATTERN ".qt" EXCLUDE + PATTERN "_deps" EXCLUDE PATTERN "apps" EXCLUDE + PATTERN "bin" EXCLUDE PATTERN "CMakeFiles" EXCLUDE PATTERN "components" EXCLUDE + PATTERN "deps" EXCLUDE PATTERN "docs" EXCLUDE PATTERN "extern" EXCLUDE PATTERN "files" EXCLUDE - PATTERN "Testing" EXCLUDE) + PATTERN "lib" EXCLUDE + PATTERN "SymStore" EXCLUDE + PATTERN "symstore-venv" EXCLUDE + PATTERN "Testing" EXCLUDE + PATTERN "try-compile") INSTALL(FILES "${INSTALL_SOURCE}/openmw.cfg.install" DESTINATION "." RENAME "openmw.cfg") INSTALL(FILES "${OpenMW_SOURCE_DIR}/CHANGELOG.md" DESTINATION "." RENAME "CHANGELOG.txt") INSTALL(FILES "${OpenMW_SOURCE_DIR}/README.md" DESTINATION "." RENAME "README.txt") From 36c922ededd47821333e68668d7d0f129afede18 Mon Sep 17 00:00:00 2001 From: AnyOldName3 Date: Thu, 19 Dec 2024 17:44:24 +0000 Subject: [PATCH 2/3] More exclusions --- CMakeLists.txt | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/CMakeLists.txt b/CMakeLists.txt index 7954a852a3..a2de61ae75 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -947,6 +947,7 @@ elseif(NOT APPLE) INSTALL(DIRECTORY "${INSTALL_SOURCE}/" DESTINATION "." FILES_MATCHING PATTERN "*.dll" PATTERN ".cmake" EXCLUDE PATTERN ".qt" EXCLUDE + PATTERN "_CPack_Packages" EXCLUDE PATTERN "_deps" EXCLUDE PATTERN "apps" EXCLUDE PATTERN "bin" EXCLUDE @@ -960,10 +961,12 @@ elseif(NOT APPLE) PATTERN "SymStore" EXCLUDE PATTERN "symstore-venv" EXCLUDE PATTERN "Testing" EXCLUDE + PATTERN "tests_output" EXCLUDE PATTERN "try-compile") INSTALL(DIRECTORY "${INSTALL_SOURCE}/" DESTINATION "." CONFIGURATIONS Debug;RelWithDebInfo FILES_MATCHING PATTERN "*.pdb" PATTERN ".cmake" EXCLUDE PATTERN ".qt" EXCLUDE + PATTERN "_CPack_Packages" EXCLUDE PATTERN "_deps" EXCLUDE PATTERN "apps" EXCLUDE PATTERN "bin" EXCLUDE @@ -977,6 +980,7 @@ elseif(NOT APPLE) PATTERN "SymStore" EXCLUDE PATTERN "symstore-venv" EXCLUDE PATTERN "Testing" EXCLUDE + PATTERN "tests_output" EXCLUDE PATTERN "try-compile") INSTALL(FILES "${INSTALL_SOURCE}/openmw.cfg.install" DESTINATION "." RENAME "openmw.cfg") INSTALL(FILES "${OpenMW_SOURCE_DIR}/CHANGELOG.md" DESTINATION "." RENAME "CHANGELOG.txt") From 6efef81635bf85fe1ec4e1af9b88b8bb67f4d876 Mon Sep 17 00:00:00 2001 From: AnyOldName3 Date: Thu, 19 Dec 2024 17:46:16 +0000 Subject: [PATCH 3/3] Delete redist installer once it's installed Also make the redist installation code filename-agnostic so it's easier to test with a dummy redist or eventually support Windows on Arm64 --- CMakeLists.txt | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index a2de61ae75..bb401d38e6 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -1029,7 +1029,11 @@ elseif(NOT APPLE) SET(VCREDIST64 "${OpenMW_BINARY_DIR}/vcredist_x64.exe" CACHE FILEPATH "Path to vcredist_x64.exe") if(EXISTS ${VCREDIST64}) INSTALL(FILES ${VCREDIST64} DESTINATION "redist") - SET(CPACK_NSIS_EXTRA_INSTALL_COMMANDS "ExecWait '\\\"$INSTDIR\\\\redist\\\\vcredist_x64.exe\\\" /q /norestart'" ) + get_filename_component(REDIST_FILENAME "${VCREDIST64}" NAME) + SET(CPACK_NSIS_EXTRA_INSTALL_COMMANDS " + ExecWait '\\\"$INSTDIR\\\\redist\\\\${REDIST_FILENAME}\\\" /q /norestart' + RMDir /r \\\"$INSTDIR\\\\redist\\\" + ") endif(EXISTS ${VCREDIST64}) if(CMAKE_CL_64)