-
Notifications
You must be signed in to change notification settings - Fork 26
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
cmake: Overhaul downstream config to properly export version and depe…
…ndencies (#230) Co-authored-by: Mateusz Jakub Fila <[email protected]>
- Loading branch information
Showing
5 changed files
with
71 additions
and
20 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,34 @@ | ||
############################################################################### | ||
# k4FWCore CMake Config | ||
# | ||
# Exported Targets | ||
# - k4FWCore::k4FWCore The core library containing the PodioDataSvc | ||
# and the KeepDropSwitch | ||
# - k4FWCore::k4FWCorePlugins The plugin library for the core plugins | ||
# provided by k4FWCore. Includes all major | ||
# services for I/O and as well as some utility | ||
# algorithms | ||
# - k4FWCore::k4Interface The (header-only) target containing all | ||
# interface definitions | ||
# | ||
############################################################################### | ||
@PACKAGE_INIT@ | ||
|
||
set_and_check(k4FWCore_INCLUDE_DIR "@PACKAGE_CMAKE_INSTALL_INCLUDEDIR@") | ||
set_and_check(k4FWCore_LIBRARY_DIR "@PACKAGE_CMAKE_INSTALL_LIBDIR@") | ||
|
||
include(CMakeFindDependencyMacro) | ||
find_dependency(podio @podio_VERSION@) | ||
find_dependency(Gaudi @Gaudi_VERSION@) | ||
find_dependency(EDM4HEP @EDM4HEP_VERSION@) | ||
find_dependency(ROOT @ROOT_VERSION@ COMPONENTS RIO Tree) | ||
|
||
if(NOT TARGET k4FWCore::k4FWCore) | ||
include("${CMAKE_CURRENT_LIST_DIR}/k4FWCoreTargets.cmake") | ||
endif() | ||
|
||
check_required_components(k4FWCore) | ||
|
||
include(FindPackageHandleStandardArgs) | ||
get_property(TEST_K4FWCORE_LIBRARY TARGET k4FWCore::k4FWCore PROPERTY LOCATION) | ||
find_package_handle_standard_args(k4FWCore DEFAULT_MSG CMAKE_CURRENT_LIST_FILE TEST_K4FWCORE_LIBRARY) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,22 @@ | ||
include(CMakePackageConfigHelpers) | ||
|
||
# Version file is same wherever we are | ||
write_basic_package_version_file(${PROJECT_BINARY_DIR}/k4FWCoreConfigVersion.cmake | ||
VERSION ${k4FWCore_VERSION} | ||
COMPATIBILITY SameMajorVersion) | ||
|
||
|
||
configure_package_config_file(${PROJECT_SOURCE_DIR}/cmake/k4FWCoreConfig.cmake.in | ||
${PROJECT_BINARY_DIR}/k4FWCoreConfig.cmake | ||
INSTALL_DESTINATION ${CMAKE_INSTALL_LIBDIR}/cmake/k4FWCore | ||
PATH_VARS CMAKE_INSTALL_INCLUDEDIR CMAKE_INSTALL_LIBDIR) | ||
|
||
install(FILES ${CMAKE_CURRENT_BINARY_DIR}/k4FWCoreConfig.cmake | ||
${CMAKE_CURRENT_BINARY_DIR}/k4FWCoreConfigVersion.cmake | ||
DESTINATION ${CMAKE_INSTALL_LIBDIR}/cmake/${PROJECT_NAME} ) | ||
|
||
install(EXPORT ${PROJECT_NAME}Targets | ||
NAMESPACE ${PROJECT_NAME}:: | ||
FILE "${PROJECT_NAME}Targets.cmake" | ||
DESTINATION "${CMAKE_INSTALL_LIBDIR}/cmake/${PROJECT_NAME}/" | ||
) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters