From 633b35eb32fe98dc6a4f1843bac77983960fe802 Mon Sep 17 00:00:00 2001 From: tmadlener Date: Fri, 12 Apr 2024 16:07:54 +0200 Subject: [PATCH 1/3] Rename utils library to avoid an overly generic libutils.so --- cmake/EDM4HEPConfig.cmake.in | 4 ++++ utils/CMakeLists.txt | 9 ++++----- 2 files changed, 8 insertions(+), 5 deletions(-) diff --git a/cmake/EDM4HEPConfig.cmake.in b/cmake/EDM4HEPConfig.cmake.in index 7bf6d54f2..cc176de83 100644 --- a/cmake/EDM4HEPConfig.cmake.in +++ b/cmake/EDM4HEPConfig.cmake.in @@ -21,4 +21,8 @@ include("${CMAKE_CURRENT_LIST_DIR}/EDM4HEPTargets.cmake") # print the default "Found:" message and check library location include(FindPackageHandleStandardArgs) get_property(TEST_EDM4HEP_LIBRARY TARGET EDM4HEP::edm4hep PROPERTY LOCATION) + +# For backwards compatibility and for slightly less typing +add_library(EDM4HEP::utils ALIAS EDM4HEP::edm4hepUtils) + find_package_handle_standard_args(EDM4HEP DEFAULT_MSG CMAKE_CURRENT_LIST_FILE TEST_EDM4HEP_LIBRARY) diff --git a/utils/CMakeLists.txt b/utils/CMakeLists.txt index 232d0ffce..fa816c51a 100644 --- a/utils/CMakeLists.txt +++ b/utils/CMakeLists.txt @@ -8,10 +8,9 @@ target_include_directories(kinematics target_link_libraries(kinematics PUBLIC INTERFACE ROOT::Core) target_compile_features(kinematics INTERFACE cxx_std_17) -add_library(utils INTERFACE) -add_library(EDM4HEP::utils ALIAS utils) -target_link_libraries(utils INTERFACE kinematics) - +add_library(edm4hepUtils INTERFACE) +add_library(EDM4HEP::utils ALIAS edm4hepUtils) +target_link_libraries(edm4hepUtils INTERFACE kinematics) set(sources src/dataframe.cc) set(headers include/edm4hep/utils/dataframe.h) @@ -26,7 +25,7 @@ target_link_libraries(edm4hepRDF PUBLIC edm4hep ROOT::Physics ROOT::ROOTVecOps) install(DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR}/include/ DESTINATION ${CMAKE_INSTALL_INCLUDEDIR} PATTERN "CMakeLists.txt" EXCLUDE) -install(TARGETS utils kinematics edm4hepRDF +install(TARGETS edm4hepUtils kinematics edm4hepRDF EXPORT EDM4HEPTargets RUNTIME DESTINATION "${CMAKE_INSTALL_BINDIR}" COMPONENT bin RUNTIME DESTINATION "${CMAKE_INSTALL_LIBDIR}" COMPONENT shlib From 4446105d7710547a7a76fdf93ac7a89b8773d96b Mon Sep 17 00:00:00 2001 From: tmadlener Date: Thu, 18 Apr 2024 17:06:34 +0200 Subject: [PATCH 2/3] Use OUTPUT_NAME to give the library a different name than the target --- cmake/EDM4HEPConfig.cmake.in | 3 --- utils/CMakeLists.txt | 9 +++++---- 2 files changed, 5 insertions(+), 7 deletions(-) diff --git a/cmake/EDM4HEPConfig.cmake.in b/cmake/EDM4HEPConfig.cmake.in index cc176de83..bb2f4da3b 100644 --- a/cmake/EDM4HEPConfig.cmake.in +++ b/cmake/EDM4HEPConfig.cmake.in @@ -22,7 +22,4 @@ include("${CMAKE_CURRENT_LIST_DIR}/EDM4HEPTargets.cmake") include(FindPackageHandleStandardArgs) get_property(TEST_EDM4HEP_LIBRARY TARGET EDM4HEP::edm4hep PROPERTY LOCATION) -# For backwards compatibility and for slightly less typing -add_library(EDM4HEP::utils ALIAS EDM4HEP::edm4hepUtils) - find_package_handle_standard_args(EDM4HEP DEFAULT_MSG CMAKE_CURRENT_LIST_FILE TEST_EDM4HEP_LIBRARY) diff --git a/utils/CMakeLists.txt b/utils/CMakeLists.txt index fa816c51a..dbaf372dd 100644 --- a/utils/CMakeLists.txt +++ b/utils/CMakeLists.txt @@ -8,9 +8,10 @@ target_include_directories(kinematics target_link_libraries(kinematics PUBLIC INTERFACE ROOT::Core) target_compile_features(kinematics INTERFACE cxx_std_17) -add_library(edm4hepUtils INTERFACE) -add_library(EDM4HEP::utils ALIAS edm4hepUtils) -target_link_libraries(edm4hepUtils INTERFACE kinematics) +add_library(utils INTERFACE) +set_target_properties(utils PROPERTIES OUTPUT_NAME "edm4hepUtils") +add_library(EDM4HEP::utils ALIAS utils) +target_link_libraries(utils INTERFACE kinematics) set(sources src/dataframe.cc) set(headers include/edm4hep/utils/dataframe.h) @@ -25,7 +26,7 @@ target_link_libraries(edm4hepRDF PUBLIC edm4hep ROOT::Physics ROOT::ROOTVecOps) install(DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR}/include/ DESTINATION ${CMAKE_INSTALL_INCLUDEDIR} PATTERN "CMakeLists.txt" EXCLUDE) -install(TARGETS edm4hepUtils kinematics edm4hepRDF +install(TARGETS utils kinematics edm4hepRDF EXPORT EDM4HEPTargets RUNTIME DESTINATION "${CMAKE_INSTALL_BINDIR}" COMPONENT bin RUNTIME DESTINATION "${CMAKE_INSTALL_LIBDIR}" COMPONENT shlib From 7b63ac10d908f1cb30b3df1c674b1b8e9e3f822c Mon Sep 17 00:00:00 2001 From: Thomas Madlener Date: Thu, 18 Apr 2024 17:15:19 +0200 Subject: [PATCH 3/3] No superfluous whitespace changes --- cmake/EDM4HEPConfig.cmake.in | 1 - utils/CMakeLists.txt | 1 + 2 files changed, 1 insertion(+), 1 deletion(-) diff --git a/cmake/EDM4HEPConfig.cmake.in b/cmake/EDM4HEPConfig.cmake.in index bb2f4da3b..7bf6d54f2 100644 --- a/cmake/EDM4HEPConfig.cmake.in +++ b/cmake/EDM4HEPConfig.cmake.in @@ -21,5 +21,4 @@ include("${CMAKE_CURRENT_LIST_DIR}/EDM4HEPTargets.cmake") # print the default "Found:" message and check library location include(FindPackageHandleStandardArgs) get_property(TEST_EDM4HEP_LIBRARY TARGET EDM4HEP::edm4hep PROPERTY LOCATION) - find_package_handle_standard_args(EDM4HEP DEFAULT_MSG CMAKE_CURRENT_LIST_FILE TEST_EDM4HEP_LIBRARY) diff --git a/utils/CMakeLists.txt b/utils/CMakeLists.txt index dbaf372dd..8194ae0a0 100644 --- a/utils/CMakeLists.txt +++ b/utils/CMakeLists.txt @@ -13,6 +13,7 @@ set_target_properties(utils PROPERTIES OUTPUT_NAME "edm4hepUtils") add_library(EDM4HEP::utils ALIAS utils) target_link_libraries(utils INTERFACE kinematics) + set(sources src/dataframe.cc) set(headers include/edm4hep/utils/dataframe.h)