Support installing multiple build types of libts
Enable heaving multiple libts build types installed in the same system.
This simplifies debugging and coverage measurement of projects using
libts. After this change integrators shall still choose a single release
build type, as these use conflicting naming.
A build type specific letter is appended to the binary name:
- d: Debug
- c: DebugCoverage
- <empty>: release, MinSizeRel, RevWithDebInfo
Signed-off-by: Gabor Toth <gabor.toth2@arm.com>
Signed-off-by: Gyorgy Szing <gyorgy.szing@arm.com>
Change-Id: Id404ff7abe8ba79ffa8929f0ad801721ebfc60e0
diff --git a/tools/cmake/common/ExportLibrary.cmake b/tools/cmake/common/ExportLibrary.cmake
index c171c5b..22ed313 100644
--- a/tools/cmake/common/ExportLibrary.cmake
+++ b/tools/cmake/common/ExportLibrary.cmake
@@ -44,6 +44,7 @@
string(TOLOWER "${MY_PARAMS_LIB_NAME}" LC_LIB_NAME)
+ set(_version_file_name "${LC_LIB_NAME}ConfigVersion.cmake")
# Set default install location if none specified
if (CMAKE_INSTALL_PREFIX_INITIALIZED_TO_DEFAULT)
@@ -76,7 +77,7 @@
include(CMakePackageConfigHelpers)
get_target_property(_ver ${MY_PARAMS_TARGET} VERSION)
write_basic_package_version_file(
- "${CMAKE_CURRENT_BINARY_DIR}/${LC_LIB_NAME}ConfigVersion.cmake"
+ "${CMAKE_CURRENT_BINARY_DIR}/${_version_file_name}"
VERSION "${_ver}"
COMPATIBILITY SameMajorVersion
)
@@ -87,6 +88,7 @@
get_filename_component(_configured_pkgcfg_name "${MY_PARAMS_PKG_CONFIG_FILE}" NAME_WLE)
set(_configured_pkgcfg_name "${CMAKE_CURRENT_BINARY_DIR}/${_configured_pkgcfg_name}")
+
configure_package_config_file(
"${MY_PARAMS_PKG_CONFIG_FILE}"
"${_configured_pkgcfg_name}"
@@ -108,7 +110,7 @@
install(
FILES
"${_configured_pkgcfg_name}"
- "${CMAKE_CURRENT_BINARY_DIR}/${LC_LIB_NAME}ConfigVersion.cmake"
+ "${CMAKE_CURRENT_BINARY_DIR}/${_version_file_name}"
DESTINATION
${ConfigPackageLocation}
COMPONENT