Skip to content

Commit ea03967

Browse files
kian-weimerhjmjohnson
authored andcommitted
STYLE: Inlined single call macro
Macro itk_load_submodule was only called once. Its body was moved inline to the itk_auto_load_submodules to improve readability. Macro itk_end_wrap_submodule_swig_interface was only called once. Its body was moved inline to the itk_auto_load_submodules to improve readability. Macro itk_wrap_module_castxml was only called once. Its body was moved inline to the itk_wrap_module to improve readability.
1 parent ea77266 commit ea03967

File tree

3 files changed

+232
-246
lines changed

3 files changed

+232
-246
lines changed

Wrapping/Generators/CastXML/CMakeLists.txt

Lines changed: 0 additions & 40 deletions
Original file line numberDiff line numberDiff line change
@@ -269,43 +269,3 @@ macro(itk_end_wrap_submodule_castxml module)
269269
list(APPEND CastXML_OUTPUT_FILES ${xml_file})
270270

271271
endmacro()
272-
273-
274-
macro(itk_wrap_module_castxml library_name)
275-
# create the files used to pass the file to include to castxml
276-
set(castxml_inc_file "${WRAPPER_LIBRARY_OUTPUT_DIR}/${library_name}.castxml.inc")
277-
get_directory_property(include_dir_list INCLUDE_DIRECTORIES)
278-
list(REMOVE_DUPLICATES include_dir_list)
279-
280-
# Get the compile_definitions of the module added with add_compile_definitions
281-
# From the wrapping folder (current)
282-
get_directory_property(compile_definition_list COMPILE_DEFINITIONS)
283-
# And from the top module folder
284-
set(module_folder "${WRAPPER_LIBRARY_SOURCE_DIR}/..")
285-
get_directory_property(compile_definition_list_at_module
286-
DIRECTORY "${module_folder}"
287-
COMPILE_DEFINITIONS)
288-
# Merge and remove duplicates
289-
list(APPEND compile_definition_list ${compile_definition_list_at_module})
290-
list(REMOVE_DUPLICATES compile_definition_list)
291-
292-
set(CONFIG_CASTXML_INC_CONTENTS)
293-
foreach(dir ${include_dir_list})
294-
set(CONFIG_CASTXML_INC_CONTENTS "${CONFIG_CASTXML_INC_CONTENTS}\"-I${dir}\"\n")
295-
endforeach()
296-
set(CONFIG_CASTXML_INC_CONTENTS "${CONFIG_CASTXML_INC_CONTENTS}-Qunused-arguments\n")
297-
set(CONFIG_CASTXML_INC_CONTENTS "${CONFIG_CASTXML_INC_CONTENTS}-DITK_WRAPPING_PARSER\n")
298-
set(CONFIG_CASTXML_INC_CONTENTS "${CONFIG_CASTXML_INC_CONTENTS}-DITK_MANUAL_INSTANTIATION\n")
299-
foreach(def ${compile_definition_list})
300-
set(CONFIG_CASTXML_INC_CONTENTS "${CONFIG_CASTXML_INC_CONTENTS}\"-D${def}\"\n")
301-
endforeach()
302-
303-
configure_file("${ITK_WRAP_CASTXML_SOURCE_DIR}/cast_xml.inc.in" "${castxml_inc_file}" @ONLY)
304-
unset(CONFIG_CASTXML_INC_CONTENTS)
305-
unset(compile_definition_list_at_module)
306-
unset(module_folder)
307-
unset(compile_definition_list)
308-
unset(include_dir_list)
309-
310-
set(CastXML_OUTPUT_FILES )
311-
endmacro()

Wrapping/Generators/SwigInterface/CMakeLists.txt

Lines changed: 0 additions & 33 deletions
Original file line numberDiff line numberDiff line change
@@ -272,40 +272,7 @@ set(IGENERATOR "${CMAKE_CURRENT_SOURCE_DIR}/igenerator.py" CACHE INTERNAL "igen
272272

273273

274274
macro(itk_end_wrap_submodule_swig_interface module)
275-
# Global variables used:
276-
# WRAPPER_LIBRARY_OUTPUT_DIR
277-
# SWIG_INTERFACE_INCLUDES
278-
# Global variables set:
279-
# SWIG_INTERFACE_MDX_CONTENT:
280-
# SWIG_INTERFACE_MDX_CONTENT
281-
# SWIG_INTERFACE_MODULES
282-
283-
set(SWIG_INTERFACE_INCLUDES_CONTENT )
284-
if(SWIG_INTERFACE_INCLUDES)
285-
list(REMOVE_DUPLICATES SWIG_INTERFACE_INCLUDES)
286-
foreach(include_file ${SWIG_INTERFACE_INCLUDES})
287-
if("${include_file}" MATCHES "<.*>")
288-
set(SWIG_INTERFACE_INCLUDES_CONTENT "${SWIG_INTERFACE_INCLUDES_CONTENT}#include ${include_file}\n")
289-
else()
290-
set(SWIG_INTERFACE_INCLUDES_CONTENT "${SWIG_INTERFACE_INCLUDES_CONTENT}#include \"${include_file}\"\n")
291-
endif()
292-
endforeach()
293-
endif()
294-
295-
# create the file which stores all of the includes
296-
set(includes_file "${WRAPPER_LIBRARY_OUTPUT_DIR}/${module}SwigInterface.h.in")
297-
configure_file("${ITK_WRAP_SWIGINTERFACE_SOURCE_DIR}/module.includes.in"
298-
${includes_file}
299-
@ONLY)
300-
unset(includes_file)
301-
unset(SWIG_INTERFACE_INCLUDES_CONTENT)
302-
303-
# store the path of the idx file to store it in the mdx file
304-
set(SWIG_INTERFACE_MDX_CONTENT "${SWIG_INTERFACE_MDX_CONTENT}${module}.idx\n")
305-
306-
set(SWIG_INTERFACE_MODULE_CONTENT "${SWIG_INTERFACE_MODULE_CONTENT}%import ${module}.i\n")
307275

308-
list(APPEND SWIG_INTERFACE_MODULES ${module})
309276
endmacro()
310277

311278

0 commit comments

Comments
 (0)