From 15f42edc31f25700cbd65111a15f04de5d58fda5 Mon Sep 17 00:00:00 2001 From: Antoine Laudrain <17805338+alaudrain@users.noreply.github.com> Date: Mon, 15 Jan 2024 06:03:18 +0100 Subject: [PATCH] Explicit PUBLIC/PRIVATE in LINK_LIBRARY. (#186) Repeated instructions for the same target rquire to have an explicit PUBLIC/PRIVATE indication. Co-authored-by: Antoine Laudrain --- src/cpp/CMakeLists.txt | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/cpp/CMakeLists.txt b/src/cpp/CMakeLists.txt index d59001c0f..a89f8d716 100644 --- a/src/cpp/CMakeLists.txt +++ b/src/cpp/CMakeLists.txt @@ -264,7 +264,7 @@ target_include_directories(lcio PUBLIC $ ) -TARGET_LINK_LIBRARIES( lcio ${CMAKE_THREAD_LIBS_INIT} ) +TARGET_LINK_LIBRARIES( lcio PUBLIC ${CMAKE_THREAD_LIBS_INIT} ) TARGET_LINK_LIBRARIES( lcio PRIVATE SIO::sio ) ADD_CUSTOM_TARGET( lib DEPENDS lcio ) @@ -443,7 +443,7 @@ MACRO( ADD_LCIO_EXAMPLE file ) ADD_DEPENDENCIES( examples bin_${file} ) #MESSAGE( STATUS "ADD_LCIO_EXAMPLE: ${file} ./src/EXAMPLE/${file}.cc" ) SET_TARGET_PROPERTIES( bin_${file} PROPERTIES OUTPUT_NAME ${file} ) - TARGET_LINK_LIBRARIES( bin_${file} lcio ) + TARGET_LINK_LIBRARIES( bin_${file} PRIVATE lcio ) INSTALL( TARGETS bin_${file} DESTINATION "${CMAKE_INSTALL_BINDIR}" ) ENDMACRO() @@ -468,7 +468,7 @@ ADD_LCIO_EXAMPLE( lcio_parallel_processing ) IF( BUILD_ROOTDICT ) ADD_LCIO_EXAMPLE( lcio_io_benchmark ) - TARGET_LINK_LIBRARIES( bin_lcio_io_benchmark ${ROOT_LIBRARIES} ) + TARGET_LINK_LIBRARIES( bin_lcio_io_benchmark PRIVATE ${ROOT_LIBRARIES} ) ENDIF() IF( BUILD_LCIO_EXAMPLES )