Skip to content

Commit 8a4dd39

Browse files
committed
ENH: Update to use PRIVATE and PUBLIC linking modes
Replaces the legacy LINK_PUBLIC, LINK_PRIVATE to preferred keywords.
1 parent 22d4ff4 commit 8a4dd39

15 files changed

Lines changed: 23 additions & 27 deletions

File tree

CMake/ITKModuleTest.cmake

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -81,7 +81,7 @@ EM_ASM(
8181
)
8282
target_link_libraries(
8383
${KIT}TestDriver
84-
LINK_PUBLIC
84+
PUBLIC
8585
${KIT_LIBS}
8686
${ITKTestKernel_LIBRARIES}
8787
)

Modules/Core/Common/src/CMakeLists.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -242,7 +242,7 @@ endif()
242242
### generating libraries
243243
itk_module_add_library(ITKCommon ${ITKCommon_SRCS})
244244

245-
target_link_libraries(ITKCommon LINK_PUBLIC itksys)
245+
target_link_libraries(ITKCommon PUBLIC itksys)
246246

247247
if(UNIX)
248248
target_link_libraries(

Modules/Core/Common/test/CMakeLists.txt

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -220,7 +220,7 @@ target_link_options(
220220
"$<$<AND:$<C_COMPILER_ID:AppleClang>,$<VERSION_GREATER_EQUAL:$<C_COMPILER_VERSION>,15.0>>:LINKER:-no_warn_duplicate_libraries>"
221221
)
222222
itk_module_target_label(itkMathTest)
223-
target_link_libraries(itkMathTest LINK_PUBLIC ${ITKCommon-Test_LIBRARIES})
223+
target_link_libraries(itkMathTest PUBLIC ${ITKCommon-Test_LIBRARIES})
224224
itk_add_test(NAME itkMathTest COMMAND itkMathTest)
225225

226226
add_executable(itkSystemInformation itkSystemInformation.cxx)
@@ -1843,8 +1843,8 @@ if(ITK_BUILD_SHARED_LIBS AND ITK_DYNAMIC_LOADING)
18431843
buildclienttestlibrary(A SHARED)
18441844
buildclienttestlibrary(B MODULE)
18451845
buildclienttestlibrary(C SHARED)
1846-
target_link_libraries(ITKCommon2TestDriver LINK_PUBLIC ClientTestLibraryA)
1847-
target_link_libraries(ITKCommon2TestDriver LINK_PUBLIC ClientTestLibraryC)
1846+
target_link_libraries(ITKCommon2TestDriver PUBLIC ClientTestLibraryA)
1847+
target_link_libraries(ITKCommon2TestDriver PUBLIC ClientTestLibraryC)
18481848
itk_add_test(
18491849
NAME itkDownCastTest
18501850
COMMAND

Modules/Core/GPUCommon/src/CMakeLists.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,5 +16,5 @@ if(ITK_USE_GPU)
1616
write_gpu_kernels("${ITKGPUCommon_Kernels}" ITKGPUCommon_SRCS)
1717

1818
itk_module_add_library(ITKGPUCommon ${ITKGPUCommon_SRCS})
19-
target_link_libraries(ITKGPUCommon LINK_PUBLIC OpenCL::OpenCL)
19+
target_link_libraries(ITKGPUCommon PUBLIC OpenCL::OpenCL)
2020
endif()

Modules/Core/TestKernel/src/CMakeLists.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ itk_module_add_library(ITKTestKernel ${ITKTestKernel_SRCS})
1010

1111
if(NOT DO_NOT_BUILD_ITK_TEST_DRIVER)
1212
add_executable(itkTestDriver itkTestDriver.cxx)
13-
target_link_libraries(itkTestDriver LINK_PRIVATE ${ITKTestKernel_LIBRARIES})
13+
target_link_libraries(itkTestDriver PRIVATE ${ITKTestKernel_LIBRARIES})
1414

1515
itk_module_target_label(itkTestDriver)
1616
itk_module_target_export(itkTestDriver)

Modules/Filtering/FFT/src/CMakeLists.txt

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -18,20 +18,20 @@ if(ITK_USE_FFTWF OR ITK_USE_FFTWD AND NOT ITK_USE_CUFFTW)
1818
if(ITK_USE_FFTWD)
1919
if(NOT ITK_USE_SYSTEM_FFTW)
2020
add_dependencies(ITKFFT fftwd) # Ensure that local FFTW is built before using
21-
target_link_libraries(ITKFFT LINK_PUBLIC ${ITK_FFTWD_LIBRARIES_NAMES})
21+
target_link_libraries(ITKFFT PUBLIC ${ITK_FFTWD_LIBRARIES_NAMES})
2222
else()
2323
target_include_directories(ITKFFT PUBLIC ${FFTW_INCLUDE})
24-
target_link_libraries(ITKFFT LINK_PUBLIC ${FFTWD_LIBRARIES})
24+
target_link_libraries(ITKFFT PUBLIC ${FFTWD_LIBRARIES})
2525
endif()
2626
endif()
2727

2828
if(ITK_USE_FFTWF)
2929
if(NOT ITK_USE_SYSTEM_FFTW)
3030
add_dependencies(ITKFFT fftwf) # Esnsure that local FFTW is build before using
31-
target_link_libraries(ITKFFT LINK_PUBLIC ${ITK_FFTWF_LIBRARIES_NAMES})
31+
target_link_libraries(ITKFFT PUBLIC ${ITK_FFTWF_LIBRARIES_NAMES})
3232
else()
3333
target_include_directories(ITKFFT PUBLIC ${FFTW_INCLUDE})
34-
target_link_libraries(ITKFFT LINK_PUBLIC ${FFTWF_LIBRARIES})
34+
target_link_libraries(ITKFFT PUBLIC ${FFTWF_LIBRARIES})
3535
endif()
3636
endif()
3737
endif()

Modules/IO/ImageBase/test/CMakeLists.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -918,7 +918,7 @@ if(ITK_BUILD_SHARED_LIBS)
918918
)
919919
add_library(FileFreeTestLib MODULE ${FileFreeTest_Source})
920920
itk_module_target_label(FileFreeTestLib)
921-
target_link_libraries(FileFreeTestLib LINK_PUBLIC ${ITKIOImageBase_LIBRARIES})
921+
target_link_libraries(FileFreeTestLib PUBLIC ${ITKIOImageBase_LIBRARIES})
922922
set_property(
923923
TARGET
924924
FileFreeTestLib

Modules/IO/NIFTI/test/CMakeLists.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@ add_library(ITKIONIFTI-TestSupport itkNiftiImageIOTestHelper.cxx)
2929
itk_module_target_label(ITKIONIFTI-TestSupport)
3030
target_link_libraries(
3131
ITKIONIFTI-TestSupport
32-
LINK_PUBLIC
32+
PUBLIC
3333
${ITKIONIFTI-Test_LIBRARIES}
3434
)
3535

Modules/IO/TransformMINC/test/CMakeLists.txt

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -15,11 +15,7 @@ set(
1515
)
1616

1717
createtestdriver(ITKIOTransformMINC "${ITKIOTransformMINC-Test_LIBRARIES}" "${ITKIOTransformMINCTests}")
18-
target_link_libraries(
19-
ITKIOTransformMINCTestDriver
20-
LINK_PUBLIC
21-
ITKIOTransformBase
22-
)
18+
target_link_libraries(ITKIOTransformMINCTestDriver PUBLIC ITKIOTransformBase)
2319

2420
itk_add_test(
2521
NAME itkIOTransformMINCTest

Modules/Nonunit/IntegratedTest/test/CMakeLists.txt

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ target_link_options(
2626
itk_module_target_label(itkAlgorithmsPrintTest)
2727
target_link_libraries(
2828
itkAlgorithmsPrintTest
29-
LINK_PUBLIC
29+
PUBLIC
3030
${ITKIntegratedTest-Test_LIBRARIES}
3131
)
3232
itk_add_test(NAME itkAlgorithmsPrintTest COMMAND itkAlgorithmsPrintTest)
@@ -40,7 +40,7 @@ target_link_options(
4040
itk_module_target_label(itkAlgorithmsPrintTest2)
4141
target_link_libraries(
4242
itkAlgorithmsPrintTest2
43-
LINK_PUBLIC
43+
PUBLIC
4444
${ITKIntegratedTest-Test_LIBRARIES}
4545
)
4646
itk_add_test(NAME itkAlgorithmsPrintTest2 COMMAND itkAlgorithmsPrintTest)
@@ -54,7 +54,7 @@ target_link_options(
5454
itk_module_target_label(itkAlgorithmsPrintTest3)
5555
target_link_libraries(
5656
itkAlgorithmsPrintTest3
57-
LINK_PUBLIC
57+
PUBLIC
5858
${ITKIntegratedTest-Test_LIBRARIES}
5959
)
6060
itk_add_test(NAME itkAlgorithmsPrintTest3 COMMAND itkAlgorithmsPrintTest)
@@ -68,7 +68,7 @@ target_link_options(
6868
itk_module_target_label(itkAlgorithmsPrintTest4)
6969
target_link_libraries(
7070
itkAlgorithmsPrintTest4
71-
LINK_PUBLIC
71+
PUBLIC
7272
${ITKIntegratedTest-Test_LIBRARIES}
7373
)
7474
itk_add_test(NAME itkAlgorithmsPrintTest4 COMMAND itkAlgorithmsPrintTest)

0 commit comments

Comments
 (0)