Skip to content

Commit 5efc2e5

Browse files
blowekampthewtex
authored andcommitted
ENH: Disable cast_xml usage of directory level properties
Compile definitions and include directories are no longer obtained from the directory. This is replaced by usage of target level properties. Retain support for WRAPPER_LIBRARY_INCLUDE_DIRECTORIES and WRAPPER_LIBRARY_LINK_LIBRARIES to control behavior.
1 parent 7a59c6d commit 5efc2e5

1 file changed

Lines changed: 1 addition & 26 deletions

File tree

Wrapping/macro_files/itk_auto_load_submodules.cmake

Lines changed: 1 addition & 26 deletions
Original file line numberDiff line numberDiff line change
@@ -102,8 +102,7 @@ function(generate_castxml_commandline_flags)
102102
## ============================
103103

104104
# create the files used to pass the file to include to castxml
105-
get_directory_property(include_dir_list INCLUDE_DIRECTORIES)
106-
list(APPEND include_dir_list ${ITK_INCLUDE_DIRS})
105+
set(include_dir_list ${WRAPPER_LIBRARY_INCLUDE_DIRECTORIES})
107106
list(REMOVE_DUPLICATES include_dir_list)
108107

109108
# CONFIG_CASTXML_INC_CONTENTS - variable used for building contents to write with file(GENERATE)
@@ -132,7 +131,6 @@ function(generate_castxml_commandline_flags)
132131
)
133132
endif()
134133
endforeach()
135-
unset(_module_depends)
136134
set(
137135
CONFIG_CASTXML_INC_CONTENTS
138136
"${CONFIG_CASTXML_INC_CONTENTS}-Qunused-arguments\n"
@@ -146,29 +144,6 @@ function(generate_castxml_commandline_flags)
146144
"${CONFIG_CASTXML_INC_CONTENTS}-DITK_MANUAL_INSTANTIATION\n"
147145
)
148146

149-
# Get the compile_definitions of the module added with add_compile_definitions
150-
# From the wrapping folder (current)
151-
get_directory_property(compile_definition_list COMPILE_DEFINITIONS)
152-
# And from the top module folder
153-
set(module_folder "${WRAPPER_LIBRARY_SOURCE_DIR}/..")
154-
get_directory_property(
155-
compile_definition_list_at_module
156-
DIRECTORY "${module_folder}"
157-
COMPILE_DEFINITIONS
158-
)
159-
unset(module_folder)
160-
# Merge and remove duplicates
161-
list(APPEND compile_definition_list ${compile_definition_list_at_module})
162-
unset(compile_definition_list_at_module)
163-
list(REMOVE_DUPLICATES compile_definition_list)
164-
165-
foreach(def ${compile_definition_list})
166-
set(
167-
CONFIG_CASTXML_INC_CONTENTS
168-
"${CONFIG_CASTXML_INC_CONTENTS}\"-D${def}\"\n"
169-
)
170-
endforeach()
171-
unset(compile_definition_list)
172147
foreach(include_file ${WRAPPER_INCLUDE_FILES})
173148
if("${include_file}" MATCHES "<.*>")
174149
string(APPEND CASTXML_INCLUDES "#include ${include_file}\n")

0 commit comments

Comments
 (0)