@@ -30,6 +30,7 @@ macro(_itk_module_config_recurse ns mod)
3030 list (APPEND _${ns} _USED_MODULES ${mod} )
3131 itk_module_load("${mod} " )
3232 list (APPEND ${ns} _LIBRARIES ${${mod} _LIBRARIES})
33+ list (APPEND ${ns} _INTERFACE_LIBRARIES ${${mod} _INTERFACE_LIBRARY})
3334 list (APPEND ${ns} _INCLUDE_DIRS ${${mod} _INCLUDE_DIRS})
3435 list (APPEND ${ns} _LIBRARY_DIRS ${${mod} _LIBRARY_DIRS})
3536 list (APPEND ${ns} _RUNTIME_LIBRARY_DIRS ${${mod} _RUNTIME_LIBRARY_DIRS})
@@ -75,6 +76,7 @@ endmacro()
7576# <module>_TRANSITIVE_DEPENDS = List of dependencies on other modules (public link, compile)
7677# <module>_PRIVATE_DEPENDS = List of dependencies on other modules (private link)
7778# <module>_LIBRARIES = Libraries to link
79+ # <module>_INTERFACE_LIBRARY = Interface library for module
7880# <module>_INCLUDE_DIRS = Header search path
7981# <module>_LIBRARY_DIRS = Library search path (for outside dependencies)
8082# <module>_RUNTIME_LIBRARY_DIRS = Runtime linker search path
@@ -88,7 +90,15 @@ macro(itk_module_load mod)
8890 # than ITKTargets.cmake are created when modules are built externally. Do not
8991 # include the targets file inside the module itself -- which occurs in a module's
9092 # test configuration.
91- if (EXISTS "${${mod} _TARGETS_FILE}" AND NOT itk-module STREQUAL mod)
93+ if (
94+ EXISTS
95+ "${${mod} _TARGETS_FILE}"
96+ AND
97+ NOT
98+ "${itk-module}"
99+ STREQUAL
100+ "${mod} "
101+ )
92102 include ("${${mod} _TARGETS_FILE}" )
93103 endif ()
94104 endif ()
@@ -97,7 +107,8 @@ endmacro()
97107# itk_module_config(<namespace> [modules...])
98108#
99109# Configures variables describing the given modules and their dependencies:
100- # <namespace>_LIBRARIES = Libraries to link
110+ # <namespace>_LIBRARIES = Libraries
111+ # <namespace>_INTERFACE_LIBRARIES = Interface libraries to link with public interfaces
101112# <namespace>_INCLUDE_DIRS = Header search path
102113# <namespace>_LIBRARY_DIRS = Library search path (for outside dependencies)
103114# <namespace>_RUNTIME_LIBRARY_DIRS = Runtime linker search path
@@ -123,6 +134,7 @@ endmacro()
123134# future. For more details, read documentation in CMake/UseITK.cmake.
124135macro (itk_module_config ns)
125136 set (${ns} _LIBRARIES "" )
137+ set (${ns} _INTERFACE_LIBRARIES "" )
126138 set (${ns} _INCLUDE_DIRS "" )
127139 set (${ns} _LIBRARY_DIRS "" )
128140 set (${ns} _RUNTIME_LIBRARY_DIRS "" )
@@ -143,6 +155,7 @@ macro(itk_module_config ns)
143155 foreach (
144156 v
145157 ${ns} _LIBRARIES
158+ ${ns} _INTERFACE_LIBRARIES
146159 ${ns} _INCLUDE_DIRS
147160 ${ns} _LIBRARY_DIRS
148161 ${ns} _RUNTIME_LIBRARY_DIRS
@@ -153,6 +166,7 @@ macro(itk_module_config ns)
153166 list (REMOVE_DUPLICATES ${v} )
154167 endif ()
155168 endforeach ()
169+
156170 foreach (_factory ${${ns} _FACTORY_LIST})
157171 list (SORT ${ns} _${_factory} ) # Sort to ensure a deterministic order
158172 endforeach ()
0 commit comments