Commit fcd4eb26 authored by Utkarsh Ayachit's avatar Utkarsh Ayachit

Handle INTERFACE_LIBRARY targets with no INTERFACE_LINK_LIBRARIES.

`vtkpegtl` INTERFACE_LIBRARY was causing the code to croak since it
assumed each INTERFACE_LIBRARY had valid INTERFACE_LINK_LIBRARIES. Fixed
that.
parent 73d5c953
......@@ -76,10 +76,14 @@ foreach (vtk_module IN LISTS VTK_MODULES_ENABLED extra_modules)
set(type)
get_property(type TARGET "${vtk_module_library}" PROPERTY TYPE)
if (type STREQUAL "INTERFACE_LIBRARY")
# note, this may set vtk_module_library to empty for interface
# libraries that have no INTERFACE_LINK_LIBRARIES.
get_property(vtk_module_library TARGET "${vtk_module_library}" PROPERTY INTERFACE_LINK_LIBRARIES)
endif ()
set(vtk_module_library_name)
get_property(vtk_module_library_name TARGET "${vtk_module_library}" PROPERTY OUTPUT_NAME)
if (vtk_module_library)
get_property(vtk_module_library_name TARGET "${vtk_module_library}" PROPERTY OUTPUT_NAME)
endif ()
if (NOT vtk_module_library_name)
set(vtk_module_library_name "${vtk_module_library}")
endif ()
......@@ -97,14 +101,20 @@ foreach (vtk_module IN LISTS VTK_MODULES_ENABLED extra_modules)
get_property(target_type TARGET "${vtk_module}" PROPERTY TYPE)
if (target_type MATCHES "_LIBRARY$")
if (target_type STREQUAL "INTERFACE_LIBRARY")
# note, this may set vtk_module_library to empty for interface
# libraries that have no INTERFACE_LINK_LIBRARIES.
get_property(vtk_module_library TARGET "${vtk_module}" PROPERTY INTERFACE_LINK_LIBRARIES)
else ()
set(vtk_module_library "${vtk_module}")
endif ()
set(vtk_module_library_name)
get_property(vtk_module_library_name TARGET "${vtk_module_library}" PROPERTY OUTPUT_NAME)
file(APPEND "${CMAKE_CURRENT_BINARY_DIR}/vtkModuleDependencies.h"
if (vtk_module_library)
get_property(vtk_module_library_name TARGET "${vtk_module_library}" PROPERTY OUTPUT_NAME)
endif ()
if (vtk_module_library_name)
file(APPEND "${CMAKE_CURRENT_BINARY_DIR}/vtkModuleDependencies.h"
"\"${vtk_module_library_name}\", ")
endif ()
endif ()
endif ()
......
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