mirror of
https://github.com/nasa/fprime.git
synced 2025-12-11 23:38:06 -06:00
Add option for installing static libs (#4277)
This commit is contained in:
parent
6c2698cea1
commit
7aa034c526
@ -173,6 +173,21 @@ option(FPRIME_SKIP_TOOLS_VERSION_CHECK "Skip the version checking of tools" OFF)
|
|||||||
####
|
####
|
||||||
option(FPRIME_CHECK_FRAMEWORK_VERSION "(Internal) Check framework version when building." OFF)
|
option(FPRIME_CHECK_FRAMEWORK_VERSION "(Internal) Check framework version when building." OFF)
|
||||||
|
|
||||||
|
####
|
||||||
|
# `FPRIME_INSTALL_STATIC_LIBRARIES`:
|
||||||
|
#
|
||||||
|
# Enables the installation of static libraries into the build-artifacts folder. This does not affect generation of the
|
||||||
|
# static libraries, only their installation. Shared library installation is always enabled. Default: ON, install static
|
||||||
|
# libraries.
|
||||||
|
#
|
||||||
|
# **Values:**
|
||||||
|
# - ON: (default) install static libraries
|
||||||
|
# - OFF: do not install static libraries
|
||||||
|
#
|
||||||
|
# e.g. `-DFPRIME_INSTALL_STATIC_LIBRARIES=OFF`
|
||||||
|
####
|
||||||
|
option(FPRIME_INSTALL_STATIC_LIBRARIES "Install static libraries" ON)
|
||||||
|
|
||||||
####
|
####
|
||||||
# `ENABLE_SANITIZER_ADDRESS:`
|
# `ENABLE_SANITIZER_ADDRESS:`
|
||||||
#
|
#
|
||||||
|
|||||||
@ -45,13 +45,22 @@ endfunction()
|
|||||||
function(install_add_deployment_target MODULE TARGET SOURCES DEPENDENCIES FULL_DEPENDENCIES)
|
function(install_add_deployment_target MODULE TARGET SOURCES DEPENDENCIES FULL_DEPENDENCIES)
|
||||||
set(CMAKE_SKIP_INSTALL_ALL_DEPENDENCY TRUE)
|
set(CMAKE_SKIP_INSTALL_ALL_DEPENDENCY TRUE)
|
||||||
_install_real_helper(INSTALL_DEPENDENCIES "${FULL_DEPENDENCIES}")
|
_install_real_helper(INSTALL_DEPENDENCIES "${FULL_DEPENDENCIES}")
|
||||||
install(TARGETS ${MODULE} ${INSTALL_DEPENDENCIES}
|
|
||||||
|
# Gate the installation of static libs behind a CMake option
|
||||||
|
set(STATIC_LIBS_INSTALL_ARGS)
|
||||||
|
if (FPRIME_INSTALL_STATIC_LIBRARIES)
|
||||||
|
list(APPEND STATIC_LIBS_INSTALL_ARGS ARCHIVE DESTINATION ${TOOLCHAIN_NAME}/${MODULE}/lib/static COMPONENT ${MODULE})
|
||||||
|
endif()
|
||||||
|
# List installation targets and remove duplicate entries
|
||||||
|
set(INSTALLATION_TARGETS ${MODULE} ${INSTALL_DEPENDENCIES})
|
||||||
|
list(REMOVE_DUPLICATES INSTALLATION_TARGETS)
|
||||||
|
|
||||||
|
install(TARGETS ${INSTALLATION_TARGETS}
|
||||||
RUNTIME DESTINATION ${TOOLCHAIN_NAME}/${MODULE}/bin
|
RUNTIME DESTINATION ${TOOLCHAIN_NAME}/${MODULE}/bin
|
||||||
COMPONENT ${MODULE}
|
COMPONENT ${MODULE}
|
||||||
LIBRARY DESTINATION ${TOOLCHAIN_NAME}/${MODULE}/lib
|
LIBRARY DESTINATION ${TOOLCHAIN_NAME}/${MODULE}/lib
|
||||||
COMPONENT ${MODULE}
|
COMPONENT ${MODULE}
|
||||||
ARCHIVE DESTINATION ${TOOLCHAIN_NAME}/${MODULE}/lib/static
|
${STATIC_LIBS_INSTALL_ARGS}
|
||||||
COMPONENT ${MODULE}
|
|
||||||
)
|
)
|
||||||
install(FILES ${CMAKE_BINARY_DIR}/hashes.txt DESTINATION ${CMAKE_INSTALL_PREFIX} COMPONENT ${MODULE})
|
install(FILES ${CMAKE_BINARY_DIR}/hashes.txt DESTINATION ${CMAKE_INSTALL_PREFIX} COMPONENT ${MODULE})
|
||||||
|
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user