Skip to content

Commit 02d895c

Browse files
committed
[CMake] Use modern target_link_library syntax for exectuables.
1 parent c9793a5 commit 02d895c

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

cmake/modules/RootMacros.cmake

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1294,7 +1294,7 @@ function(ROOT_EXECUTABLE executable)
12941294
set(exe_srcs ${exe_srcs} ${ROOT_RC_SCRIPT})
12951295
endif()
12961296
add_executable(${executable} ${_all} ${exe_srcs})
1297-
target_link_libraries(${executable} ${ARG_LIBRARIES})
1297+
target_link_libraries(${executable} PRIVATE ${ARG_LIBRARIES})
12981298

12991299
if(WIN32 AND ${executable} MATCHES \\.exe)
13001300
set_target_properties(${executable} PROPERTIES SUFFIX "")
@@ -1659,7 +1659,7 @@ function(ROOT_ADD_GTEST test_suite)
16591659
# against. For example, tests in Core should link only against libCore. This could be tricky
16601660
# to implement because some ROOT components create more than one library.
16611661
ROOT_EXECUTABLE(${test_suite} ${source_files} LIBRARIES ${ARG_LIBRARIES})
1662-
target_link_libraries(${test_suite} gtest gtest_main gmock gmock_main ROOTUnitTestSupport)
1662+
target_link_libraries(${test_suite} PRIVATE gtest gtest_main gmock gmock_main ROOTUnitTestSupport)
16631663
target_include_directories(${test_suite} PRIVATE ${CMAKE_CURRENT_BINARY_DIR})
16641664
if (ARG_INCLUDE_DIRS)
16651665
target_include_directories(${test_suite} PRIVATE ${ARG_INCLUDE_DIRS})

0 commit comments

Comments
 (0)