Skip to content

Commit bf53198

Browse files
committed
ENH: enable multiple call to itk_generate_factory_registration
Each time itk_generate_factory_registration, the include directories for the meta factory module is called the include paths are reset to the latest.
1 parent bf8090d commit bf53198

File tree

1 file changed

+8
-4
lines changed

1 file changed

+8
-4
lines changed

CMake/ITKFactoryRegistration.cmake

Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -187,10 +187,14 @@ function(_itk_configure_FactoryRegisterManager factory_type formats)
187187
if(aliased_target_name)
188188
set(_meta_module ${aliased_target_name})
189189
endif()
190-
target_include_directories(
191-
${_meta_module}
192-
INTERFACE
193-
"$<BUILD_INTERFACE:${CMAKE_CURRENT_BINARY_DIR}/ITKFactoryRegistration>"
190+
# Override the include directories to the current generated FactoryRegistration path.
191+
# Enables multiple calls to adding factories with different sets of factories, in a project.
192+
set_property(
193+
TARGET
194+
${_meta_module}
195+
PROPERTY
196+
INTERFACE_INCLUDE_DIRECTORIES
197+
"$<BUILD_INTERFACE:${CMAKE_CURRENT_BINARY_DIR}/ITKFactoryRegistration>"
194198
)
195199
endfunction()
196200

0 commit comments

Comments
 (0)