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:
@ -9,6 +9,7 @@ option(BUILD_TESTS "Build unit tests" OFF)
|
||||
if(LINUX OR BSD)
|
||||
option(ENABLE_X11 "Support X11 window system" ON)
|
||||
option(ENABLE_WAYLAND "Support Wayland window system" ON)
|
||||
option(ALLOW_INSTALL "Allow installation to CMAKE_INSTALL_PREFIX" OFF)
|
||||
endif()
|
||||
if(APPLE)
|
||||
option(SKIP_POSTPROCESS_BUNDLE "Disable bundle post-processing, including Qt additions" OFF)
|
||||
|
||||
@ -24,6 +24,12 @@ if(BUILD_TESTS)
|
||||
message(STATUS "Building unit tests.")
|
||||
endif()
|
||||
|
||||
if(ALLOW_INSTALL)
|
||||
message(WARNING "Install target is enabled. This will install all DuckStation files into:
|
||||
${CMAKE_INSTALL_PREFIX}
|
||||
It does **not** use the LSB subdirectories of bin, share, etc, so you should disable this option if it is set to /usr or /usr/local.")
|
||||
endif()
|
||||
|
||||
if(NOT IS_SUPPORTED_COMPILER)
|
||||
message(WARNING "
|
||||
*************** UNSUPPORTED CONFIGURATION ***************
|
||||
|
||||
@ -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()
|
||||
|
||||
Reference in New Issue
Block a user