RUNTIME_DEPENDENCY_SET requires 3.21

This commit is contained in:
AnyOldName3
2026-10-05 01:43:27 +01:00
parent 054b021709
commit 7ca3f9959c
13 changed files with 30 additions and 28 deletions
+17 -11
View File
@@ -28,6 +28,15 @@ endif ()
option(DEPLOY_QT_TRANSLATIONS "Deploy standard Qt translations to resources folder. Needed when OpenMW applications are deployed with Qt libraries" ${DEPLOY_QT_TRANSLATIONS_DEFAULT})
option(OPENMW_DEPLOY_RUNTIME_DEPENDENCIES "Deploy runtime dependency libraries. Needed when not relying on a system-wide insallation of these libraries existing" ${deploy_runtime_dependencies_default})
set(runtime_dependency_arguments)
if (OPENMW_DEPLOY_RUNTIME_DEPENDENCIES)
if (CMAKE_VERSION VERSION_LESS 3.21)
message(FATAL_ERROR "OPENMW_DEPLOY_RUNTIME_DEPENDENCIES requires at least CMake 3.21")
endif()
# when the version check is made obsolete, we can just pass this whether or not we're using it
set(runtime_dependency_arguments RUNTIME_DEPENDENCY_SET openmw-dependencies)
endif ()
# Apps and tools
option(BUILD_OPENMW "Build OpenMW" ON)
option(BUILD_LAUNCHER "Build Launcher" ON)
@@ -499,12 +508,14 @@ if(OPENMW_USE_SYSTEM_OSG)
endif()
endforeach()
if(WIN32)
set(osg_plugin_destination "${CMAKE_INSTALL_BINDIR}")
else()
set(osg_plugin_destination "${CMAKE_INSTALL_LIBDIR}")
if(NOT OSG_STATIC)
if(WIN32)
set(osg_plugin_destination "${CMAKE_INSTALL_BINDIR}")
else()
set(osg_plugin_destination "${CMAKE_INSTALL_LIBDIR}")
endif()
install(IMPORTED_RUNTIME_ARTIFACTS ${USED_OSG_PLUGINS} DESTINATION "${osg_plugin_destination}/osgPlugins-${OPENSCENEGRAPH_VERSION}" RUNTIME_DEPENDENCY_SET openmw-dependencies)
endif()
install(IMPORTED_RUNTIME_ARTIFACTS ${USED_OSG_PLUGINS} DESTINATION "${osg_plugin_destination}/osgPlugins-${OPENSCENEGRAPH_VERSION}" RUNTIME_DEPENDENCY_SET openmw-dependencies)
endif()
endif()
@@ -871,12 +882,7 @@ if (NOT APPLE AND OPENMW_DEPLOY_RUNTIME_DEPENDENCIES)
set(systemroot "$ENV{SystemRoot}")
# documentation says to use lower-case regex, but drive letter is upper-case and I can't be bothered preserving the case of just one character right now
#string(TOLOWER "${systemroot}" systemroot)
if (CMAKE_VERSION VERSION_GREATER_EQUAL 3.20)
cmake_path(NORMAL_PATH systemroot)
else ()
file(TO_CMAKE_PATH "${systemroot}" systemroot)
# and just hope there's no mess with double slashes or dots
endif ()
cmake_path(NORMAL_PATH systemroot)
escape_regex_control_characters(systemroot "${systemroot}")
set(post_exclude_regexes ^${systemroot}/)
# CMP0207 will avoid the need for this
+1 -1
View File
@@ -23,7 +23,7 @@ if (BUILD_WITH_CODE_COVERAGE)
endif()
if (NOT APPLE)
install(TARGETS bsatool RUNTIME_DEPENDENCY_SET openmw-dependencies)
install(TARGETS bsatool ${runtime_dependency_arguments})
endif()
if (MSVC AND PRECOMPILE_HEADERS_WITH_MSVC)
+1 -1
View File
@@ -20,7 +20,7 @@ if (BUILD_WITH_CODE_COVERAGE)
endif()
if (NOT APPLE)
install(TARGETS openmw-bulletobjecttool RUNTIME_DEPENDENCY_SET openmw-dependencies)
install(TARGETS openmw-bulletobjecttool ${runtime_dependency_arguments})
endif()
if (MSVC AND PRECOMPILE_HEADERS_WITH_MSVC)
+1 -1
View File
@@ -30,7 +30,7 @@ if (BUILD_WITH_CODE_COVERAGE)
endif()
if (NOT APPLE)
install(TARGETS esmtool RUNTIME_DEPENDENCY_SET openmw-dependencies)
install(TARGETS esmtool ${runtime_dependency_arguments})
endif()
if (MSVC AND PRECOMPILE_HEADERS_WITH_MSVC)
+1 -1
View File
@@ -47,7 +47,7 @@ if (BUILD_WITH_CODE_COVERAGE)
endif()
if (NOT APPLE)
install(TARGETS openmw-essimporter RUNTIME_DEPENDENCY_SET openmw-dependencies)
install(TARGETS openmw-essimporter ${runtime_dependency_arguments})
endif()
if (MSVC AND PRECOMPILE_HEADERS_WITH_MSVC)
+1 -1
View File
@@ -63,7 +63,7 @@ openmw_add_qt_executable(openmw-launcher
add_dependencies(openmw-launcher qm-files)
if (NOT APPLE)
install(TARGETS openmw-launcher RUNTIME_DEPENDENCY_SET openmw-dependencies)
install(TARGETS openmw-launcher ${runtime_dependency_arguments})
generate_deploy_script_for_qt_app(openmw-launcher)
endif ()
+1 -1
View File
@@ -23,7 +23,7 @@ if (WIN32)
endif()
if (NOT APPLE)
install(TARGETS openmw-iniimporter RUNTIME_DEPENDENCY_SET openmw-dependencies)
install(TARGETS openmw-iniimporter ${runtime_dependency_arguments})
endif()
if (MINGW)
+1 -1
View File
@@ -30,7 +30,7 @@ if (BUILD_WITH_CODE_COVERAGE)
endif()
if (NOT APPLE)
install(TARGETS openmw-navmeshtool RUNTIME_DEPENDENCY_SET openmw-dependencies)
install(TARGETS openmw-navmeshtool ${runtime_dependency_arguments})
endif()
if (MSVC AND PRECOMPILE_HEADERS_WITH_MSVC)
+1 -1
View File
@@ -22,7 +22,7 @@ if (BUILD_WITH_CODE_COVERAGE)
endif()
if (NOT APPLE)
install(TARGETS niftest RUNTIME_DEPENDENCY_SET openmw-dependencies)
install(TARGETS niftest ${runtime_dependency_arguments})
endif()
if (MSVC AND PRECOMPILE_HEADERS_WITH_MSVC)
+1 -1
View File
@@ -250,7 +250,7 @@ if (WIN32)
endif()
if (NOT APPLE AND BUILD_OPENCS)
install(TARGETS openmw-cs RUNTIME_DEPENDENCY_SET openmw-dependencies)
install(TARGETS openmw-cs ${runtime_dependency_arguments})
INSTALL(FILES "$<TARGET_FILE_DIR:openmw-cs>/defaults-cs.bin" DESTINATION "${CMAKE_INSTALL_SYSCONFDIR}")
generate_deploy_script_for_qt_app(openmw-cs)
+1 -1
View File
@@ -272,5 +272,5 @@ if (BUILD_WITH_CODE_COVERAGE)
endif()
if (NOT APPLE AND BUILD_OPENMW)
install(TARGETS openmw RUNTIME_DEPENDENCY_SET openmw-dependencies)
install(TARGETS openmw ${runtime_dependency_arguments})
endif()
+1 -1
View File
@@ -92,7 +92,7 @@ if (BUILD_WITH_CODE_COVERAGE)
endif()
if (NOT APPLE)
install(TARGETS openmw-wizard RUNTIME_DEPENDENCY_SET openmw-dependencies)
install(TARGETS openmw-wizard ${runtime_dependency_arguments})
generate_deploy_script_for_qt_app(openmw-wizard)
endif()
+2 -6
View File
@@ -162,16 +162,12 @@ macro (openmw_add_qt_executable target)
endmacro (openmw_add_qt_executable)
function (generate_deploy_script_for_qt_app target)
if (LINUX AND OPENMW_DEPLOY_RUNTIME_DEPENDENCIES)
if (UNIX AND NOT APPLE AND OPENMW_DEPLOY_RUNTIME_DEPENDENCIES)
if (Qt6Core_VERSION VERSION_LESS 6.10)
message(FATAL_ERROR "Deployment of Qt on Linux requires at least 6.10 (for the INCLUDE_PLUGINS argument)")
endif ()
# don't bother with this on Windows yet as windeployqt includes a bunch of DLLs we don't use
if (CMAKE_VERSION VERSION_GREATER_EQUAL 3.20)
cmake_path(NORMAL_PATH QT_DIR OUTPUT_VARIABLE QT_BASE_DIR)
else ()
# just hope it's close enough
endif()
cmake_path(NORMAL_PATH QT_DIR OUTPUT_VARIABLE QT_BASE_DIR)
string(REGEX REPLACE "(.+)/lib/cmake/Qt[0-9]+" "\\1" QT_BASE_DIR "${QT_BASE_DIR}")
escape_regex_control_characters(QT_BASE_REGEX "${QT_BASE_DIR}")
qt_generate_deploy_app_script(TARGET ${target}