Commit ed6c07d0 authored by Brad King's avatar Brad King
Browse files

COMP: Cleanup CMP0022 and CMP0023 warnings

CMake 2.8.12 introduces policies CMP0022 and CMP0023 that trigger
warnings in some of VTK's CMake code.  Fix them as follows.  The result
is a cleaner and more explicit link specification anyway.

CMP0022 warns when we set the LINK_INTERFACE_LIBRARIES property directly
without also setting the newly introduced INTERFACE_LINK_LIBRARIES
property directly.  Simply drop these settings because they are achieved
already by use of the keyword-based target_link_libraries signature.

CMP0023 warns when we use both the plain and keyword signatures of the
target_link_libraries command for a single target.  The module macros
use the keyword signature (LINK_PUBLIC/LINK_PRIVATE), so any direct
calls to the plain target_link_libraries signature are doing "private"
linking.  Add the LINK_PRIVATE keyword to such calls to make this
explicit and avoid the warning.

Change-Id: I1e5bf687733e3f19462da698c0d5e3899439bf02
parent b3e976bf
......@@ -42,7 +42,7 @@ set_source_files_properties(
list(APPEND Module_SRCS ${Module_CUDA_C_SRCS})
vtk_module_library(vtkAcceleratorsPiston ${Module_SRCS})
target_link_libraries(vtkAcceleratorsPiston ${CUDA_LIBRARIES})
target_link_libraries(vtkAcceleratorsPiston LINK_PRIVATE ${CUDA_LIBRARIES})
if(APPLE)
target_link_libraries(vtkAcceleratorsPiston /usr/local/cuda/lib/libtlshook.dylib)
target_link_libraries(vtkAcceleratorsPiston LINK_PRIVATE /usr/local/cuda/lib/libtlshook.dylib)
endif()
......@@ -412,7 +412,7 @@ macro(vtk_module_test_executable test_exe_name)
vtk_module_test()
# No forwarding or export for test executables.
add_executable(${test_exe_name} MACOSX_BUNDLE ${ARGN})
target_link_libraries(${test_exe_name} ${${vtk-module-test}-Cxx_LIBRARIES})
target_link_libraries(${test_exe_name} LINK_PRIVATE ${${vtk-module-test}-Cxx_LIBRARIES})
if(${vtk-module-test}-Cxx_DEFINITIONS)
set_property(TARGET ${test_exe_name} APPEND PROPERTY COMPILE_DEFINITIONS
......
......@@ -513,5 +513,4 @@ endif()
vtk_module_library(vtkCommonCore ${Module_SRCS})
target_link_libraries(vtkCommonCore ${CMAKE_THREAD_LIBS_INIT})
set_target_properties(vtkCommonCore PROPERTIES LINK_INTERFACE_LIBRARIES "")
target_link_libraries(vtkCommonCore LINK_PRIVATE ${CMAKE_THREAD_LIBS_INIT})
......@@ -62,4 +62,4 @@ configure_file(${VTK_CMAKE_DIR}/vtkObjectFactory.cxx.in
vtk_module_library(vtkFiltersStatisticsGnuR ${Module_SRCS})
target_link_libraries(vtkFiltersStatisticsGnuR ${R_LIBRARIES})
target_link_libraries(vtkFiltersStatisticsGnuR LINK_PRIVATE ${R_LIBRARIES})
......@@ -20,7 +20,7 @@ set(MFC_SRCS
vtk_module_library(${vtk-module} ${VTK_MFC_LIB_TYPE} ${MFC_SRCS})
if(VTK_MFC_EXTRA_LIBS)
target_link_libraries(${vtk-module} ${VTK_MFC_EXTRA_LIBS})
target_link_libraries(${vtk-module} LINK_PRIVATE ${VTK_MFC_EXTRA_LIBS})
endif(VTK_MFC_EXTRA_LIBS)
if(WIN32)
......
......@@ -91,12 +91,12 @@ vtk_module_library(${vtk-module}
target_link_libraries(${vtk-module} LINK_PUBLIC ${QT_LIBRARIES})
if(VTK_USE_X)
target_link_libraries(${vtk-module} ${X11_LIBRARIES})
target_link_libraries(${vtk-module} LINK_PRIVATE ${X11_LIBRARIES})
endif()
if(APPLE)
if(VTK_USE_CARBON)
target_link_libraries(${vtk-module} "-framework Carbon" )
target_link_libraries(${vtk-module} LINK_PRIVATE "-framework Carbon" )
endif()
endif()
......
......@@ -27,4 +27,4 @@ endif()
set(${vtk-module}_NO_HeaderTest 1)
vtk_module_library(${vtk-module} ${LibSrcs} ${LibMocSrcs})
target_link_libraries(${vtk-module} ${QT_LIBRARIES})
target_link_libraries(${vtk-module} LINK_PRIVATE ${QT_LIBRARIES})
......@@ -37,4 +37,4 @@ if(VTK_LIBRARY_PROPERTIES)
set_target_properties(${vtk-module} PROPERTIES ${VTK_LIBRARY_PROPERTIES})
endif()
target_link_libraries(${vtk-module} ${QT_LIBRARIES})
target_link_libraries(${vtk-module} LINK_PRIVATE ${QT_LIBRARIES})
......@@ -33,4 +33,4 @@ endif()
set(${vtk-module}_NO_HeaderTest 1)
vtk_module_library(${vtk-module} ${LibSrcs} ${UI_FILES} ${LibMocSrcs})
target_link_libraries(${vtk-module} ${QT_LIBRARIES})
target_link_libraries(${vtk-module} LINK_PRIVATE ${QT_LIBRARIES})
......@@ -31,4 +31,4 @@ endif()
vtk_module_library(vtkIOFFMPEG ${Module_SRCS})
target_link_libraries(vtkIOFFMPEG ${_ffmpeg_libs})
target_link_libraries(vtkIOFFMPEG LINK_PRIVATE ${_ffmpeg_libs})
......@@ -7,4 +7,4 @@ include_directories(${GDAL_INCLUDE_DIRS})
vtk_module_library(vtkIOGDAL ${GDAL_SRCS})
target_link_libraries(vtkIOGDAL ${GDAL_LIBRARY})
target_link_libraries(vtkIOGDAL LINK_PRIVATE ${GDAL_LIBRARY})
......@@ -37,5 +37,5 @@ set(vtkIOMovie_HDRS
vtk_module_library(vtkIOMovie ${Module_SRCS})
if(WIN32 AND VTK_USE_VIDEO_FOR_WINDOWS)
target_link_libraries(vtkIOMovie vfw32)
target_link_libraries(vtkIOMovie LINK_PRIVATE vfw32)
endif()
......@@ -14,4 +14,4 @@ include_directories(${MYSQL_INCLUDE_DIRECTORIES})
vtk_module_library(vtkIOMySQL ${MySQL_SRCS})
target_link_libraries(vtkIOMySQL ${MYSQL_LIBRARY} ${MYSQL_EXTRA_LIBRARIES})
target_link_libraries(vtkIOMySQL LINK_PRIVATE ${MYSQL_LIBRARY} ${MYSQL_EXTRA_LIBRARIES})
......@@ -10,5 +10,4 @@ set(Module_SRCS
vtk_module_library(vtkIONetCDF ${Module_SRCS})
target_link_libraries(vtkIONetCDF vtkNetCDF_cxx)
set_target_properties(vtkIONetCDF PROPERTIES LINK_INTERFACE_LIBRARIES "")
target_link_libraries(vtkIONetCDF LINK_PRIVATE vtkNetCDF_cxx)
......@@ -12,4 +12,4 @@ include_directories(${ODBC_INCLUDE_DIRECTORIES})
vtk_module_library(vtkIOODBC ${ODBC_SRCS})
target_link_libraries(vtkIOODBC ${ODBC_LIBRARIES})
target_link_libraries(vtkIOODBC LINK_PRIVATE ${ODBC_LIBRARIES})
......@@ -15,4 +15,4 @@ include_directories(${PostgreSQL_INCLUDE_DIRS})
vtk_module_library(vtkIOPostgreSQL ${PostgreSQL_SRCS})
target_link_libraries(vtkIOPostgreSQL ${PostgreSQL_LIBRARY})
target_link_libraries(vtkIOPostgreSQL LINK_PRIVATE ${PostgreSQL_LIBRARY})
......@@ -18,5 +18,5 @@ vtk_module_library(vtkIOVideo ${Module_SRCS})
if(WIN32 AND VTK_USE_VIDEO_FOR_WINDOWS)
target_link_libraries(vtkIOVideo vfw32)
target_link_libraries(vtkIOVideo LINK_PRIVATE vfw32)
endif()
......@@ -6,6 +6,6 @@ include_directories(${Boost_INCLUDE_DIRS})
vtk_module_test_executable(TestVariantSerialization TestVariantSerialization.cxx
)
target_link_libraries(TestVariantSerialization ${Boost_SERIALIZATION_LIBRARY})
target_link_libraries(TestVariantSerialization LINK_PRIVATE ${Boost_SERIALIZATION_LIBRARY})
add_test(NAME ${vtk-module}-TestVariantSerialization COMMAND TestVariantSerialization)
......@@ -18,4 +18,4 @@ set(Module_SRCS
)
vtk_module_library(vtkInfovisParallel ${Module_SRCS})
target_link_libraries(vtkInfovisParallel ${Boost_LIBRARIES})
target_link_libraries(vtkInfovisParallel LINK_PRIVATE ${Boost_LIBRARIES})
......@@ -40,4 +40,4 @@ configure_file(${VTK_CMAKE_DIR}/vtkObjectFactory.cxx.in
vtk_module_library(${vtk-module} ${Module_SRCS})
target_link_libraries(${vtk-module} ${FONTCONFIG_LIBRARIES})
target_link_libraries(${vtk-module} LINK_PRIVATE ${FONTCONFIG_LIBRARIES})
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment