CMake IMPORTED module targets are incomplete
The imported targets for each VTK module are missing information like include directories, compile definitions, etc. For example, currently for vtkCommonMath
there is the following in VTKTargets*.cmake
:
# Create imported target vtkCommonMath
add_library(vtkCommonMath SHARED IMPORTED)
set_target_properties(vtkCommonMath PROPERTIES
INTERFACE_COMPILE_FEATURES "cxx_nullptr"
INTERFACE_LINK_LIBRARIES "vtkCommonCore"
)
# Import target "vtkCommonMath" for configuration "RelWithDebInfo"
set_property(TARGET vtkCommonMath APPEND PROPERTY IMPORTED_CONFIGURATIONS RELWITHDEBINFO)
set_target_properties(vtkCommonMath PROPERTIES
IMPORTED_IMPLIB_RELWITHDEBINFO "${_IMPORT_PREFIX}/lib/vtkCommonMath-8.0.lib"
IMPORTED_LOCATION_RELWITHDEBINFO "${_IMPORT_PREFIX}/bin/vtkCommonMath-8.0.dll"
)
list(APPEND _IMPORT_CHECK_TARGETS vtkCommonMath )
list(APPEND _IMPORT_CHECK_FILES_FOR_vtkCommonMath "${_IMPORT_PREFIX}/lib/vtkCommonMath-8.0.lib" "${_IMPORT_PREFIX}/bin/vtkCommonMath-8.0.dll" )
What's missing is something like:
set_target_properties(vtkCommonMath PROPERTIES
INTERFACE_INCLUDE_DIRECTORIES "${vtkCommonMath_INCLUDE_DIRS}"
)
set_target_properties(vtkCommonMath PROPERTIES
INTERFACE_COMPILE_DEFINITIONS "${vtkCommonMath_DEFINITIONS}"
)