Commit 740809c4 authored by Brad King's avatar Brad King

Wrapping: Pass module name to vtk_wrap_hierarchy

The first argument of `vtk_wrap_hierarchy` was accidentally unused and
the `${vtk-module}` variable from the calling scope was used instead.
Clean this up by passing the module name as the first argument and
referencing it by that argument name.
parent 78f9d207
Pipeline #2719 passed with stage
#
# a cmake macro to generate a text file with the class hierarchy
#
macro(VTK_WRAP_HIERARCHY TARGET OUTPUT_DIR SOURCES)
macro(VTK_WRAP_HIERARCHY module_name OUTPUT_DIR SOURCES)
if(NOT VTK_WRAP_HIERARCHY_EXE)
if(TARGET vtkWrapHierarchy)
set(VTK_WRAP_HIERARCHY_EXE vtkWrapHierarchy)
......@@ -30,7 +30,7 @@ macro(VTK_WRAP_HIERARCHY TARGET OUTPUT_DIR SOURCES)
# write wrapper-tool arguments to a file
string(STRIP "${_common_args}" CMAKE_CONFIGURABLE_FILE_CONTENT)
configure_file(${CMAKE_ROOT}/Modules/CMakeConfigurableFile.in
${vtk-module}Hierarchy.args @ONLY)
${module_name}Hierarchy.args @ONLY)
# list of all files to wrap
set(VTK_WRAPPER_INIT_DATA)
......@@ -82,7 +82,7 @@ macro(VTK_WRAP_HIERARCHY TARGET OUTPUT_DIR SOURCES)
# add the info to the init file
set(VTK_WRAPPER_INIT_DATA
"${VTK_WRAPPER_INIT_DATA}${TMP_INPUT};${vtk-module}")
"${VTK_WRAPPER_INIT_DATA}${TMP_INPUT};${module_name}")
if(TMP_ABSTRACT)
set(VTK_WRAPPER_INIT_DATA "${VTK_WRAPPER_INIT_DATA};ABSTRACT")
......@@ -104,18 +104,18 @@ macro(VTK_WRAP_HIERARCHY TARGET OUTPUT_DIR SOURCES)
# finish the data file for the init file
configure_file(
${VTK_CMAKE_DIR}/vtkWrapperInit.data.in
${vtk-module}Hierarchy.data
${module_name}Hierarchy.data
@ONLY
)
# search through the deps to find modules we depend on
set(OTHER_HIERARCHY_FILES)
# Don't use ${vtk-module}_DEPENDS. That list also includes COMPILE_DEPENDS,
# Don't use ${module_name}_DEPENDS. That list also includes COMPILE_DEPENDS,
# which aren't library dependencies, merely dependencies for generators and
# such. The dependecies specified under "DEPENDS" in the vtk_module(..) macro
# call are located under _LINK_DEPENDS.
foreach(dep ${${vtk-module}_LINK_DEPENDS})
if(NOT "${vtk-module}" STREQUAL "${dep}")
foreach(dep ${${module_name}_LINK_DEPENDS})
if(NOT "${module_name}" STREQUAL "${dep}")
if(NOT ${dep}_EXCLUDE_FROM_WRAPPING)
list(APPEND OTHER_HIERARCHY_FILES "${${dep}_WRAP_HIERARCHY_FILE}")
endif()
......@@ -126,23 +126,23 @@ macro(VTK_WRAP_HIERARCHY TARGET OUTPUT_DIR SOURCES)
# existence of explicit dependencies that those order-only dependencies
# might have produced. Specify the real output to help it out.
if(CMAKE_GENERATOR MATCHES "Ninja")
set(help_ninja ${OUTPUT_DIR}/${vtk-module}Hierarchy.txt)
set(help_ninja ${OUTPUT_DIR}/${module_name}Hierarchy.txt)
else()
set(help_ninja "")
endif()
add_custom_command(
OUTPUT ${CMAKE_CURRENT_BINARY_DIR}/${vtk-module}Hierarchy.stamp.txt
OUTPUT ${CMAKE_CURRENT_BINARY_DIR}/${module_name}Hierarchy.stamp.txt
${help_ninja}
COMMAND ${VTK_WRAP_HIERARCHY_EXE}
@${vtk-module}Hierarchy.args -o ${OUTPUT_DIR}/${vtk-module}Hierarchy.txt
${vtk-module}Hierarchy.data
@${module_name}Hierarchy.args -o ${OUTPUT_DIR}/${module_name}Hierarchy.txt
${module_name}Hierarchy.data
${OTHER_HIERARCHY_FILES}
COMMAND ${CMAKE_COMMAND} -E touch ${CMAKE_CURRENT_BINARY_DIR}/${vtk-module}Hierarchy.stamp.txt
COMMENT "For ${vtk-module} - updating ${vtk-module}Hierarchy.txt"
COMMAND ${CMAKE_COMMAND} -E touch ${CMAKE_CURRENT_BINARY_DIR}/${module_name}Hierarchy.stamp.txt
COMMENT "For ${module_name} - updating ${module_name}Hierarchy.txt"
DEPENDS ${VTK_WRAP_HIERARCHY_EXE}
${CMAKE_CURRENT_BINARY_DIR}/${vtk-module}Hierarchy.args
${CMAKE_CURRENT_BINARY_DIR}/${vtk-module}Hierarchy.data
${CMAKE_CURRENT_BINARY_DIR}/${module_name}Hierarchy.args
${CMAKE_CURRENT_BINARY_DIR}/${module_name}Hierarchy.data
${OTHER_HIERARCHY_FILES}
${INPUT_FILES}
VERBATIM
......
......@@ -44,7 +44,7 @@ function(vtk_add_wrapping module_name module_srcs module_hdrs)
# The module is wrapped by at least one language - invoke wrap hierarchy.
if(NOT ${module_name}_EXCLUDE_FROM_WRAP_HIERARCHY)
set(_all_files ${module_srcs} ${modules_hdrs})
vtk_wrap_hierarchy(${module_name}Hierarchy ${VTK_MODULES_DIR}
vtk_wrap_hierarchy(${module_name} ${VTK_MODULES_DIR}
"${_all_files}")
set (${module_name}_WRAP_HIERARCHY_FILE
"${VTK_MODULES_DIR}/${module_name}Hierarchy.txt"
......
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