From 9e8a44f3d46544a65b29c2eb27ae17443bf70172 Mon Sep 17 00:00:00 2001 From: David Nathan Brown Date: Tue, 19 May 2026 15:36:08 -0500 Subject: [PATCH] Add explicit keyword when defining link libraries --- Detector/CMakeLists.txt | 4 ++-- Examples/CMakeLists.txt | 4 ++-- Fit/CMakeLists.txt | 4 ++-- General/CMakeLists.txt | 4 ++-- Geometry/CMakeLists.txt | 4 ++-- Tests/CMakeLists.txt | 2 +- Trajectory/CMakeLists.txt | 4 ++-- 7 files changed, 13 insertions(+), 13 deletions(-) diff --git a/Detector/CMakeLists.txt b/Detector/CMakeLists.txt index d3897073..906df93b 100644 --- a/Detector/CMakeLists.txt +++ b/Detector/CMakeLists.txt @@ -11,12 +11,12 @@ add_library(Detector SHARED #message( "source dir detector " ${CMAKE_SOURCE_DIR}/..) # set top-level directory as include root -target_include_directories(Detector PUBLIC +target_include_directories(Detector PUBLIC $ $) # link this library with ROOT libraries and other KinKal libraries -target_link_libraries(Detector Trajectory General ${ROOT_LIBRARIES}) +target_link_libraries(Detector PUBLIC Trajectory General ${ROOT_LIBRARIES}) # set shared library version equal to project version set_target_properties(Detector PROPERTIES VERSION ${PROJECT_VERSION} PREFIX ${CMAKE_SHARED_LIBRARY_PREFIX}) diff --git a/Examples/CMakeLists.txt b/Examples/CMakeLists.txt index f85aca48..1cb3721c 100644 --- a/Examples/CMakeLists.txt +++ b/Examples/CMakeLists.txt @@ -18,11 +18,11 @@ add_library(Examples SHARED ExamplesDict ) target_include_directories(Examples PRIVATE ${CMAKE_CURRENT_SOURCE_DIR}) -target_include_directories(Examples PUBLIC +target_include_directories(Examples PUBLIC $ $) # link ROOT libraries -target_link_libraries(Examples ${ROOT_LIBRARIES}) +target_link_libraries(Examples PUBLIC ${ROOT_LIBRARIES}) # set shared library version equal to project version set_target_properties(Examples PROPERTIES VERSION ${PROJECT_VERSION} PREFIX ${CMAKE_SHARED_LIBRARY_PREFIX}) diff --git a/Fit/CMakeLists.txt b/Fit/CMakeLists.txt index 60299016..713dd129 100644 --- a/Fit/CMakeLists.txt +++ b/Fit/CMakeLists.txt @@ -12,12 +12,12 @@ add_library(Fit SHARED ) # set top-level directory as include root -target_include_directories(Fit PUBLIC +target_include_directories(Fit PUBLIC $ $) # link this library with ROOT libraries -target_link_libraries(Fit Detector Trajectory General ${ROOT_LIBRARIES}) +target_link_libraries(Fit PUBLIC Detector Trajectory General ${ROOT_LIBRARIES}) # set shared library version equal to project version set_target_properties(Fit PROPERTIES VERSION ${PROJECT_VERSION} PREFIX ${CMAKE_SHARED_LIBRARY_PREFIX}) diff --git a/General/CMakeLists.txt b/General/CMakeLists.txt index 556b054b..b018a732 100644 --- a/General/CMakeLists.txt +++ b/General/CMakeLists.txt @@ -34,12 +34,12 @@ ROOT_GENERATE_DICTIONARY(GeneralDict ) # set top-level directory as include root -target_include_directories(General PUBLIC +target_include_directories(General PUBLIC $ $) # link this library with ROOT libraries -target_link_libraries(General ${ROOT_LIBRARIES}) +target_link_libraries(General PUBLIC ${ROOT_LIBRARIES}) # set shared library version equal to project version set_target_properties(General PROPERTIES VERSION ${PROJECT_VERSION} PREFIX ${CMAKE_SHARED_LIBRARY_PREFIX}) diff --git a/Geometry/CMakeLists.txt b/Geometry/CMakeLists.txt index 2c706a64..1fecb787 100644 --- a/Geometry/CMakeLists.txt +++ b/Geometry/CMakeLists.txt @@ -21,12 +21,12 @@ add_library(Geometry SHARED set(CMAKE_SHARED_LIBRARY_PREFIX "libKinKal_") # set top-level directory as include root -target_include_directories(Geometry PUBLIC +target_include_directories(Geometry PUBLIC $ $) # link this library with ROOT libraries -target_link_libraries(Geometry General ${ROOT_LIBRARIES}) +target_link_libraries(Geometry PUBLIC General ${ROOT_LIBRARIES}) # set shared library version equal to project version set_target_properties(Geometry PROPERTIES VERSION ${PROJECT_VERSION} PREFIX ${CMAKE_SHARED_LIBRARY_PREFIX}) diff --git a/Tests/CMakeLists.txt b/Tests/CMakeLists.txt index 0aab2c23..fb9fd50a 100644 --- a/Tests/CMakeLists.txt +++ b/Tests/CMakeLists.txt @@ -43,7 +43,7 @@ foreach( testsourcefile ${TEST_SOURCE_FILES} ) # add the project root as an include directory # link all unit tests to KinKal, MatEnv, and ROOT libraries. target_include_directories(Test_${testname} PRIVATE ${PROJECT_SOURCE_DIR}/..) - target_link_libraries( Test_${testname} General Trajectory Geometry Detector Fit MatEnv Examples ${ROOT_LIBRARIES} ) + target_link_libraries( Test_${testname} PRIVATE General Trajectory Geometry Detector Fit MatEnv Examples ${ROOT_LIBRARIES} ) # ensure the unit test executable filename is just its test name set_target_properties( Test_${testname} PROPERTIES OUTPUT_NAME ${testname}) diff --git a/Trajectory/CMakeLists.txt b/Trajectory/CMakeLists.txt index 1042195c..21b61d16 100644 --- a/Trajectory/CMakeLists.txt +++ b/Trajectory/CMakeLists.txt @@ -24,12 +24,12 @@ ROOT_GENERATE_DICTIONARY(TrajectoryDict ) # set top-level directory as include root -target_include_directories(Trajectory PUBLIC +target_include_directories(Trajectory PUBLIC $ $) # link this library with ROOT libraries -target_link_libraries(Trajectory Geometry General ${ROOT_LIBRARIES}) +target_link_libraries(Trajectory PUBLIC Geometry General ${ROOT_LIBRARIES}) # set shared library version equal to project version set_target_properties(Trajectory PROPERTIES VERSION ${PROJECT_VERSION} PREFIX ${CMAKE_SHARED_LIBRARY_PREFIX})