CMake: Add install target

Do **not** use this with /usr or /usr/local. It creates subdirectories
for resources/translations in the install prefix.

It's intended for creating a relocatable, self-contained bundle, which
can be packaged.
This commit is contained in:
Stenzek
2024-08-12 18:49:28 +10:00
parent 7745c9ef43
commit 72fc81a705
6 changed files with 33 additions and 0 deletions

View File

@ -221,3 +221,9 @@ function(get_scm_version)
set(SCM_VERSION ${LOCAL_SCM_VERSION} PARENT_SCOPE)
endif()
endfunction()
function(install_imported_dep_library name)
get_target_property(SONAME "${name}" IMPORTED_SONAME_RELEASE)
get_target_property(LOCATION "${name}" IMPORTED_LOCATION_RELEASE)
install(FILES "${LOCATION}" RENAME "${SONAME}" DESTINATION "${CMAKE_INSTALL_PREFIX}")
endfunction()