/usr/lib/cmake/paraview/vtkWrapHierarchy.cmake is in paraview-dev 5.0.1+dfsg1-4.
This file is owned by root:root, with mode 0o644.
The actual contents of the file can be viewed below.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 | #
# a cmake macro to generate a text file with the class hierarchy
#
macro(VTK_WRAP_HIERARCHY module_name OUTPUT_DIR SOURCES)
if(NOT VTK_WRAP_HIERARCHY_EXE)
if(TARGET vtkWrapHierarchy)
set(VTK_WRAP_HIERARCHY_EXE vtkWrapHierarchy)
else()
message(SEND_ERROR "VTK_WRAP_HIERARCHY_EXE not specified when calling VTK_WRAP_HIERARCHY")
endif()
endif()
# collect the common wrapper-tool arguments
if(NOT CMAKE_VERSION VERSION_LESS 3.1 AND NOT VTK_ENABLE_KITS)
# write wrapper-tool arguments to a file
set(_args_file ${module_name}Hierarchy.$<CONFIGURATION>.args)
file(GENERATE OUTPUT ${CMAKE_CURRENT_BINARY_DIR}/${_args_file} CONTENT "
$<$<BOOL:$<TARGET_PROPERTY:${module_name},COMPILE_DEFINITIONS>>:
-D\"$<JOIN:$<TARGET_PROPERTY:${module_name},COMPILE_DEFINITIONS>,\"
-D\">\">
$<$<BOOL:$<TARGET_PROPERTY:${module_name},INCLUDE_DIRECTORIES>>:
-I\"$<JOIN:$<TARGET_PROPERTY:${module_name},INCLUDE_DIRECTORIES>,\"
-I\">\">
")
else()
set(_common_args)
get_directory_property(_def_list DEFINITION COMPILE_DEFINITIONS)
foreach(TMP_DEF ${_def_list})
set(_common_args "${_common_args}-D${TMP_DEF}\n")
endforeach()
# all the include directories
if(VTK_WRAP_INCLUDE_DIRS)
set(TMP_INCLUDE_DIRS ${VTK_WRAP_INCLUDE_DIRS})
else()
set(TMP_INCLUDE_DIRS ${VTK_INCLUDE_DIRS})
endif()
foreach(INCLUDE_DIR ${TMP_INCLUDE_DIRS})
set(_common_args "${_common_args}-I\"${INCLUDE_DIR}\"\n")
endforeach()
# write wrapper-tool arguments to a file
set(_args_file ${module_name}Hierarchy.args)
string(STRIP "${_common_args}" CMAKE_CONFIGURABLE_FILE_CONTENT)
configure_file(${CMAKE_ROOT}/Modules/CMakeConfigurableFile.in
${_args_file} @ONLY)
endif()
# list of all files to wrap
set(VTK_WRAPPER_INIT_DATA)
# list of used files
set(INPUT_FILES)
# For each class
foreach(FILE ${SOURCES})
# file properties to include in the hierarchy file
get_property(TMP_WRAP_EXCLUDE SOURCE ${FILE} PROPERTY WRAP_EXCLUDE)
get_source_file_property(TMP_ABSTRACT ${FILE} ABSTRACT)
get_source_file_property(TMP_EXCLUDE_PYTHON ${FILE} WRAP_EXCLUDE_PYTHON)
# what is the filename without the extension
get_filename_component(TMP_FILENAME ${FILE} NAME_WE)
# get the absolute path to the file
get_filename_component(TMP_FULLPATH ${FILE} ABSOLUTE)
# get the directory
get_filename_component(TMP_FILEPATH ${TMP_FULLPATH} PATH)
# assume header file is in the same directory
set(TMP_INPUT ${TMP_FILEPATH}/${TMP_FILENAME}.h)
# include all non-private headers in the hierarchy files
set(TMP_EXCLUDE_FROM_HIERARCHY OFF)
get_source_file_property(TMP_SKIP ${FILE} SKIP_HEADER_INSTALL)
if(TMP_SKIP)
set(TMP_EXCLUDE_FROM_HIERARCHY ON)
endif()
# ensure that header exists (assume it exists if it is marked as wrapped)
if(TMP_WRAP_EXCLUDE)
if(NOT EXISTS ${TMP_INPUT})
set(TMP_EXCLUDE_FROM_HIERARCHY ON)
endif()
endif()
# Exclude this huge generated header file
if("${TMP_FILENAME}" STREQUAL "vtkgl")
set(TMP_EXCLUDE_FROM_HIERARCHY ON)
endif()
if(NOT TMP_EXCLUDE_FROM_HIERARCHY)
# add to the INPUT_FILES
list(APPEND INPUT_FILES ${TMP_INPUT})
# add the info to the init file
set(VTK_WRAPPER_INIT_DATA
"${VTK_WRAPPER_INIT_DATA}${TMP_INPUT};${module_name}")
if(TMP_ABSTRACT)
set(VTK_WRAPPER_INIT_DATA "${VTK_WRAPPER_INIT_DATA};ABSTRACT")
endif()
if(TMP_WRAP_EXCLUDE)
set(VTK_WRAPPER_INIT_DATA "${VTK_WRAPPER_INIT_DATA};WRAP_EXCLUDE")
endif()
if(TMP_EXCLUDE_PYTHON)
set(VTK_WRAPPER_INIT_DATA "${VTK_WRAPPER_INIT_DATA};WRAP_EXCLUDE_PYTHON")
endif()
set(VTK_WRAPPER_INIT_DATA "${VTK_WRAPPER_INIT_DATA}\n")
endif()
endforeach()
# finish the data file for the init file
configure_file(
${VTK_CMAKE_DIR}/vtkWrapperInit.data.in
${module_name}Hierarchy.data
@ONLY
)
# search through the deps to find modules we depend on
set(OTHER_HIERARCHY_FILES)
# 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 ${${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()
endif()
endforeach()
# Ninja does not wait for order-only dependencies before enforcing the
# 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}/${module_name}Hierarchy.txt)
else()
set(help_ninja "")
endif()
add_custom_command(
OUTPUT ${CMAKE_CURRENT_BINARY_DIR}/${module_name}Hierarchy.stamp.txt
${help_ninja}
COMMAND ${VTK_WRAP_HIERARCHY_EXE}
@${_args_file} -o ${OUTPUT_DIR}/${module_name}Hierarchy.txt
${module_name}Hierarchy.data
${OTHER_HIERARCHY_FILES}
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}/${_args_file}
${CMAKE_CURRENT_BINARY_DIR}/${module_name}Hierarchy.data
${OTHER_HIERARCHY_FILES}
${INPUT_FILES}
VERBATIM
)
endmacro()
|