Skip to content

Commit

Permalink
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Export version for downstream usage
Browse files Browse the repository at this point in the history
Move all downstream related config to one file
tmadlener committed Oct 8, 2024
1 parent f97f1ad commit cff6168
Showing 2 changed files with 16 additions and 9 deletions.
9 changes: 0 additions & 9 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -65,13 +65,4 @@ if(ENABLE_CPACK)
include(cmake/${PROJECT_NAME}CPack.cmake)
endif()


install(EXPORT ${PROJECT_NAME}Targets
NAMESPACE ${PROJECT_NAME}::
FILE "${PROJECT_NAME}Targets.cmake"
DESTINATION "${CMAKE_INSTALL_LIBDIR}/cmake/${PROJECT_NAME}/"
)

include(cmake/k4FWCoreCreateConfig.cmake)

gaudi_install(CMAKE ${PROJECT_BINARY_DIR}/k4FWCoreConfig.cmake)
16 changes: 16 additions & 0 deletions cmake/k4FWCoreCreateConfig.cmake
Original file line number Diff line number Diff line change
@@ -1,6 +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}/"
)

0 comments on commit cff6168

Please sign in to comment.