From d095d4885f4394d49b3877ef5213cfb0647abc88 Mon Sep 17 00:00:00 2001 From: Nathan Brei Date: Fri, 9 Aug 2024 12:44:54 -0400 Subject: [PATCH] Prune plugin dependencies that should be inherited instead --- .../InteractiveStreamingExample/CMakeLists.txt | 4 ++-- src/libraries/JANA/CMakeLists.txt | 18 +++++++++--------- src/plugins/JTest/CMakeLists.txt | 2 -- src/plugins/janarate/CMakeLists.txt | 3 --- src/plugins/janaview/CMakeLists.txt | 6 ------ src/plugins/regressiontest/CMakeLists.txt | 2 -- 6 files changed, 11 insertions(+), 24 deletions(-) diff --git a/src/examples/InteractiveStreamingExample/CMakeLists.txt b/src/examples/InteractiveStreamingExample/CMakeLists.txt index 2f12c0213..8b58400d6 100644 --- a/src/examples/InteractiveStreamingExample/CMakeLists.txt +++ b/src/examples/InteractiveStreamingExample/CMakeLists.txt @@ -11,8 +11,8 @@ if (${USE_ROOT} AND ${USE_ZEROMQ}) SOURCES ${InteractiveStreamingExample_SOURCES} PUBLIC_HEADER ${InteractiveStreamingExample_HEADERS}) - target_include_directories(InteractiveStreamingExample PUBLIC ${ROOT_INCLUDE_DIRS} ${ZeroMQ_INCLUDE_DIRS}) - target_link_libraries(InteractiveStreamingExample PUBLIC ${ZeroMQ_LIBRARIES} ${ROOT_LIBRARIES}) + target_include_directories(InteractiveStreamingExample PUBLIC ${ZeroMQ_INCLUDE_DIRS}) + target_link_libraries(InteractiveStreamingExample PUBLIC ${ZeroMQ_LIBRARIES}) else() diff --git a/src/libraries/JANA/CMakeLists.txt b/src/libraries/JANA/CMakeLists.txt index 552d7eeab..e7c59008a 100644 --- a/src/libraries/JANA/CMakeLists.txt +++ b/src/libraries/JANA/CMakeLists.txt @@ -149,12 +149,12 @@ add_library(jana2 OBJECT ${JANA2_SOURCES}) find_package(Threads REQUIRED) set(THREADS_PREFER_PTHREAD_FLAG ON) -target_link_libraries(jana2 ${CMAKE_DL_LIBS} Threads::Threads) +target_link_libraries(jana2 PUBLIC ${CMAKE_DL_LIBS} Threads::Threads) if (${USE_PODIO}) - target_link_libraries(jana2 podio::podio podio::podioRootIO ${ROOT_LIBRARIES}) + target_link_libraries(jana2 PUBLIC podio::podio podio::podioRootIO ${ROOT_LIBRARIES}) elseif (${USE_ROOT}) - target_link_libraries(jana2 ${ROOT_LIBRARIES}) + target_link_libraries(jana2 PUBLIC ${ROOT_LIBRARIES}) endif() @@ -163,12 +163,12 @@ add_library(jana2_static_lib STATIC $) set_target_properties(jana2_static_lib PROPERTIES PREFIX "lib" OUTPUT_NAME "JANA") target_include_directories(jana2_static_lib PUBLIC $) -target_link_libraries(jana2_static_lib ${CMAKE_DL_LIBS} Threads::Threads) +target_link_libraries(jana2_static_lib PUBLIC ${CMAKE_DL_LIBS} Threads::Threads) if (${USE_PODIO}) - target_link_libraries(jana2_static_lib podio::podio podio::podioRootIO ${ROOT_LIBRARIES}) + target_link_libraries(jana2_static_lib PUBLIC podio::podio podio::podioRootIO ${ROOT_LIBRARIES}) elseif (${USE_ROOT}) - target_link_libraries(jana2_static_lib ${ROOT_LIBRARIES}) + target_link_libraries(jana2_static_lib PUBLIC ${ROOT_LIBRARIES}) endif() install(TARGETS jana2_static_lib EXPORT jana2_targets DESTINATION lib) @@ -180,12 +180,12 @@ if (BUILD_SHARED_LIBS) set_target_properties(jana2_shared_lib PROPERTIES PREFIX "lib" OUTPUT_NAME "JANA") target_include_directories(jana2_shared_lib PUBLIC $) - target_link_libraries(jana2_shared_lib ${CMAKE_DL_LIBS} Threads::Threads) + target_link_libraries(jana2_shared_lib PUBLIC ${CMAKE_DL_LIBS} Threads::Threads) if (${USE_PODIO}) - target_link_libraries(jana2_shared_lib podio::podio podio::podioRootIO ${ROOT_LIBRARIES}) + target_link_libraries(jana2_shared_lib PUBLIC podio::podio podio::podioRootIO ${ROOT_LIBRARIES}) elseif (${USE_ROOT}) - target_link_libraries(jana2_shared_lib ${ROOT_LIBRARIES}) + target_link_libraries(jana2_shared_lib PUBLIC ${ROOT_LIBRARIES}) endif() install(TARGETS jana2_shared_lib EXPORT jana2_targets DESTINATION lib) diff --git a/src/plugins/JTest/CMakeLists.txt b/src/plugins/JTest/CMakeLists.txt index 7587211d9..069998b5a 100644 --- a/src/plugins/JTest/CMakeLists.txt +++ b/src/plugins/JTest/CMakeLists.txt @@ -5,6 +5,4 @@ add_jana_plugin(JTest) add_test(NAME jana-plugin-jtest-tests COMMAND jana -Pplugins=JTest -Pjana:nevents=20) -find_package(Threads REQUIRED) -target_link_libraries(JTest PUBLIC Threads::Threads) diff --git a/src/plugins/janarate/CMakeLists.txt b/src/plugins/janarate/CMakeLists.txt index b0f7be996..813bed96b 100644 --- a/src/plugins/janarate/CMakeLists.txt +++ b/src/plugins/janarate/CMakeLists.txt @@ -4,9 +4,6 @@ if (${USE_ROOT}) add_jana_plugin(janarate) - target_include_directories(janarate PUBLIC ${ROOT_INCLUDE_DIRS}) - target_link_libraries(janarate PUBLIC ${ROOT_LIBRARIES}) - else() message(STATUS "Skipping plugins/janarate because USE_ROOT=Off") diff --git a/src/plugins/janaview/CMakeLists.txt b/src/plugins/janaview/CMakeLists.txt index 1d0d4fcc9..5a1c5943a 100644 --- a/src/plugins/janaview/CMakeLists.txt +++ b/src/plugins/janaview/CMakeLists.txt @@ -12,12 +12,6 @@ if(USE_ROOT) PUBLIC_HEADER ${JANAVIEW_HEADERS} ) - target_include_directories(janaview PUBLIC ${ROOT_INCLUDE_DIRS}) - target_link_libraries(janaview PUBLIC ${ROOT_LIBRARIES}) - - find_package(Threads REQUIRED) - target_link_libraries(janaview PUBLIC Threads::Threads) - install(FILES ${CMAKE_CURRENT_BINARY_DIR}/libjv_mainframe_rdict.pcm DESTINATION lib/JANA/plugins) install(FILES ${CMAKE_CURRENT_BINARY_DIR}/libjv_mainframe.rootmap DESTINATION lib/JANA/plugins) diff --git a/src/plugins/regressiontest/CMakeLists.txt b/src/plugins/regressiontest/CMakeLists.txt index a6dc0489d..d74e52382 100644 --- a/src/plugins/regressiontest/CMakeLists.txt +++ b/src/plugins/regressiontest/CMakeLists.txt @@ -3,6 +3,4 @@ add_jana_plugin(regressiontest SOURCES JEventProcessor_regressiontest.cc PUBLIC_HEADER JEventProcessor_regressiontest.h) -find_package(Threads REQUIRED) -target_link_libraries(regressiontest PUBLIC Threads::Threads)