Add optional support for the cmake per user package registry.
Default is OFF to conform to latest cmake standard (3.15) and because this feature can cause some confusion for unaware developers. Change-Id: I6fdbd5ab76c90b73ac6451a383334a83cabef438 Signed-off-by: Sean Keely <Sean.Keely@amd.com>
Dieser Commit ist enthalten in:
1 Ursprung
06add334b9
Commit
f0b0555996
1 Datei geändert
+14
@@ -198,6 +198,20 @@ install(FILES
|
||||
${CMAKE_INSTALL_LIBDIR}/cmake/${HSAKMT_TARGET}
|
||||
COMPONENT devel)
|
||||
|
||||
# Optionally record the package's find module in the user's package cache.
|
||||
if ( NOT DEFINED EXPORT_TO_USER_PACKAGE_REGISTRY )
|
||||
set ( EXPORT_TO_USER_PACKAGE_REGISTRY "off" )
|
||||
endif()
|
||||
set ( EXPORT_TO_USER_PACKAGE_REGISTRY ${EXPORT_TO_USER_PACKAGE_REGISTRY} CACHE BOOL "Add cmake package config location to the user's cmake package registry.")
|
||||
if(${EXPORT_TO_USER_PACKAGE_REGISTRY})
|
||||
# Enable writing to the registry
|
||||
set(CMAKE_EXPORT_PACKAGE_REGISTRY ON)
|
||||
# Generate a target file for the build
|
||||
export(TARGETS ${HSAKMT_TARGET} NAMESPACE ${HSAKMT_TARGET}:: FILE ${HSAKMT_TARGET}Targets.cmake)
|
||||
# Record the package in the user's cache.
|
||||
export(PACKAGE ${HSAKMT_TARGET})
|
||||
endif()
|
||||
|
||||
# CPACK_PACKAGING_INSTALL_PREFIX is needed in libhsakmt.pc.in
|
||||
# TODO: Add support for relocatable packages.
|
||||
configure_file ( libhsakmt.pc.in libhsakmt.pc @ONLY )
|
||||
|
||||
In neuem Issue referenzieren
Einen Benutzer sperren