diff --git a/CMakeLists.txt b/CMakeLists.txt index 6ae8562b..54d13519 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -29,16 +29,22 @@ message(${CMAKE_MODULE_PATH}) add_subdirectory(Detector) +# - install and export +install(FILES + "${PROJECT_SOURCE_DIR}/cmake/${PROJECT_NAME}Config.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}/" -# ) + +install(EXPORT ${PROJECT_NAME}Targets + NAMESPACE ${PROJECT_NAME}:: + FILE "${PROJECT_NAME}Targets.cmake" + DESTINATION "${CMAKE_INSTALL_LIBDIR}/cmake/${PROJECT_NAME}/" + ) #gaudi_install(CMAKE cmake/${PROJECT_NAME}Config.cmake) diff --git a/Detector/DetCommon/CMakeLists.txt b/Detector/DetCommon/CMakeLists.txt index 4a56b02b..d2a7c5e4 100644 --- a/Detector/DetCommon/CMakeLists.txt +++ b/Detector/DetCommon/CMakeLists.txt @@ -17,7 +17,7 @@ set_target_properties(DetCommon PROPERTIES PUBLIC_HEADER "${headers}") install(TARGETS DetCommon - EXPORT fccDetectorsTargets + EXPORT ${PROJECT_NAME}Targets RUNTIME DESTINATION "${CMAKE_INSTALL_BINDIR}" COMPONENT bin LIBRARY DESTINATION "${CMAKE_INSTALL_LIBDIR}" COMPONENT shlib PUBLIC_HEADER DESTINATION "${CMAKE_INSTALL_INCLUDEDIR}/DetCommon" diff --git a/Detector/DetSegmentation/CMakeLists.txt b/Detector/DetSegmentation/CMakeLists.txt index 99b41be6..f1e76897 100644 --- a/Detector/DetSegmentation/CMakeLists.txt +++ b/Detector/DetSegmentation/CMakeLists.txt @@ -17,7 +17,7 @@ set_target_properties(DetSegmentation PROPERTIES PUBLIC_HEADER "${headers}") install(TARGETS DetSegmentation - EXPORT fccDetectorsTargets + EXPORT ${PROJECT_NAME}Targets RUNTIME DESTINATION "${CMAKE_INSTALL_BINDIR}" COMPONENT bin LIBRARY DESTINATION "${CMAKE_INSTALL_LIBDIR}" COMPONENT shlib PUBLIC_HEADER DESTINATION "${CMAKE_INSTALL_INCLUDEDIR}/DetSegmentation" diff --git a/Detector/DetSensitive/CMakeLists.txt b/Detector/DetSensitive/CMakeLists.txt index 824abdd8..16609e66 100644 --- a/Detector/DetSensitive/CMakeLists.txt +++ b/Detector/DetSensitive/CMakeLists.txt @@ -18,7 +18,7 @@ set_target_properties(DetSensitive PROPERTIES PUBLIC_HEADER "${headers}") install(TARGETS DetSensitive - EXPORT fccDetectorsTargets + EXPORT ${PROJECT_NAME}Targets RUNTIME DESTINATION "${CMAKE_INSTALL_BINDIR}" COMPONENT bin LIBRARY DESTINATION "${CMAKE_INSTALL_LIBDIR}" COMPONENT shlib PUBLIC_HEADER DESTINATION "${CMAKE_INSTALL_INCLUDEDIR}/DetSensitive" diff --git a/cmake/FCCDetectorsConfig.cmake b/cmake/FCCDetectorsConfig.cmake new file mode 100644 index 00000000..0a5d3bf9 --- /dev/null +++ b/cmake/FCCDetectorsConfig.cmake @@ -0,0 +1,10 @@ + +#include(CMakeFindDependencyMacro) +#find_dependency(DD4hep REQUIRED) + +# - Include the targets file to create the imported targets that a client can +# link to (libraries) or execute (programs) +include("${CMAKE_CURRENT_LIST_DIR}/FCCDetectorsTargets.cmake") + +include(FindPackageHandleStandardArgs) +find_package_handle_standard_args(FCCDetectors DEFAULT_MSG CMAKE_CURRENT_LIST_FILE) diff --git a/cmake/k4SimGeant4Config.cmake b/cmake/k4SimGeant4Config.cmake deleted file mode 100644 index b86cff89..00000000 --- a/cmake/k4SimGeant4Config.cmake +++ /dev/null @@ -1,11 +0,0 @@ - -include(CMakeFindDependencyMacro) -find_dependency(Geant4 REQUIRED) -find_dependency(k4FWCore REQUIRED) - -# - Include the targets file to create the imported targets that a client can -# link to (libraries) or execute (programs) -include("${CMAKE_CURRENT_LIST_DIR}/k4SimGeant4Targets.cmake") - -include(FindPackageHandleStandardArgs) -find_package_handle_standard_args(k4Gen DEFAULT_MSG CMAKE_CURRENT_LIST_FILE)