Skip to content

Commit

Permalink
Prune plugin dependencies that should be inherited instead
Browse files Browse the repository at this point in the history
  • Loading branch information
nathanwbrei committed Aug 9, 2024
1 parent 3356232 commit d095d48
Show file tree
Hide file tree
Showing 6 changed files with 11 additions and 24 deletions.
4 changes: 2 additions & 2 deletions src/examples/InteractiveStreamingExample/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -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()

Expand Down
18 changes: 9 additions & 9 deletions src/libraries/JANA/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -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()


Expand All @@ -163,12 +163,12 @@ add_library(jana2_static_lib STATIC $<TARGET_OBJECTS:jana2>)
set_target_properties(jana2_static_lib PROPERTIES PREFIX "lib" OUTPUT_NAME "JANA")

target_include_directories(jana2_static_lib PUBLIC $<INSTALL_INTERFACE:include>)
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)

Expand All @@ -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 $<INSTALL_INTERFACE:include>)
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)
Expand Down
2 changes: 0 additions & 2 deletions src/plugins/JTest/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -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)

3 changes: 0 additions & 3 deletions src/plugins/janarate/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -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")

Expand Down
6 changes: 0 additions & 6 deletions src/plugins/janaview/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -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)

Expand Down
2 changes: 0 additions & 2 deletions src/plugins/regressiontest/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -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)

0 comments on commit d095d48

Please sign in to comment.