forked from Kitware/ParaView
-
Notifications
You must be signed in to change notification settings - Fork 0
/
ParaViewInstallCMakePackage.cmake
196 lines (171 loc) · 7.09 KB
/
ParaViewInstallCMakePackage.cmake
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
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
if (NOT (DEFINED paraview_cmake_dir AND
DEFINED paraview_cmake_build_dir AND
DEFINED paraview_cmake_destination AND
DEFINED paraview_modules))
message(FATAL_ERROR
"ParaViewInstallCMakePackage is missing input variables.")
endif ()
_vtk_module_write_import_prefix("${paraview_cmake_build_dir}/paraview-prefix.cmake" "${paraview_cmake_destination}")
set(paraview_has_catalyst 0)
set(paraview_catalyst_directory "")
if (TARGET ParaView::catalyst-paraview)
set(paraview_has_catalyst 1)
get_property(paraview_catalyst_directory GLOBAL
PROPERTY paraview_catalyst_directory)
endif ()
string(REPLACE "ParaView::" "" _paraview_all_components "${paraview_modules};${paraview_client_modules}")
configure_file(
"${paraview_cmake_dir}/paraview-config.cmake.in"
"${paraview_cmake_build_dir}/paraview-config.cmake"
@ONLY)
include(CMakePackageConfigHelpers)
write_basic_package_version_file("${paraview_cmake_build_dir}/paraview-config-version.cmake"
VERSION "${PARAVIEW_VERSION_FULL}"
COMPATIBILITY AnyNewerVersion)
# For convenience, a package is written to the top of the build tree. At some
# point, this should probably be deprecated and warn when it is used.
file(GENERATE
OUTPUT "${CMAKE_BINARY_DIR}/paraview-config.cmake"
CONTENT "include(\"${paraview_cmake_build_dir}/paraview-config.cmake\")\n")
configure_file(
"${paraview_cmake_build_dir}/paraview-config-version.cmake"
"${CMAKE_BINARY_DIR}/paraview-config-version.cmake"
COPYONLY)
set(paraview_cmake_module_files
# Compatibility
paraview-use-file-compat.cmake
paraview-use-file-deprecated.cmake
paraview-use-file-error.cmake
# Client API
paraview_client_initializer.cxx.in
paraview_client_initializer.h.in
paraview_client_main.cxx.in
ParaViewClient.cmake
paraview_servermanager_convert_categoryindex.xsl
paraview_servermanager_convert_html.xsl
paraview_servermanager_convert_wiki.xsl.in
paraview_servermanager_convert_xml.xsl
# Plugin API
paraview_plugin.cxx.in
paraview_plugin.h.in
ParaViewPlugin.cmake
pqActionGroupImplementation.cxx.in
pqActionGroupImplementation.h.in
pqAutoStartImplementation.cxx.in
pqAutoStartImplementation.h.in
pqDockWindowImplementation.cxx.in
pqDockWindowImplementation.h.in
pqGraphLayoutStrategyImplementation.cxx.in
pqGraphLayoutStrategyImplementation.h.in
pqPluginLocationImplementation.cxx.in
pqPluginLocationImplementation.h.in
pqPropertyWidgetInterface.cxx.in
pqPropertyWidgetInterface.h.in
pqServerManagerModelImplementation.cxx.in
pqServerManagerModelImplementation.h.in
pqToolBarImplementation.cxx.in
pqToolBarImplementation.h.in
pqTreeLayoutStrategyImplementation.cxx.in
pqTreeLayoutStrategyImplementation.h.in
# ServerManager API
ParaViewServerManager.cmake
# Testing
ParaViewTesting.cmake
# Client Server
vtkModuleWrapClientServer.cmake
# Translation API
ParaViewTranslations.cmake
XML_translations_header_generator.py)
# From the `GmshIO` plugin.
if (TARGET GmshIO::vtkGmshIO)
list(APPEND paraview_cmake_module_files
FindGmsh.cmake)
endif ()
set(paraview_cmake_files_to_install)
foreach (paraview_cmake_module_file IN LISTS paraview_cmake_module_files)
configure_file(
"${paraview_cmake_dir}/${paraview_cmake_module_file}"
"${paraview_cmake_build_dir}/${paraview_cmake_module_file}"
COPYONLY)
list(APPEND paraview_cmake_files_to_install
"${paraview_cmake_module_file}")
endforeach ()
if (PARAVIEW_ENABLE_VISITBRIDGE)
set(paraview_visitbridge_cmake_module_files
FindBoxlib.cmake
FindGFortran.cmake
FindMili.cmake
FindRapidJSON.cmake
FindSILO.cmake)
foreach (paraview_cmake_module_file IN LISTS paraview_visitbridge_cmake_module_files)
configure_file(
"${ParaView_SOURCE_DIR}/Utilities/VisItBridge/databases/cmake/${paraview_cmake_module_file}"
"${paraview_cmake_build_dir}/${paraview_cmake_module_file}"
COPYONLY)
list(APPEND paraview_cmake_files_to_install
"${paraview_cmake_build_dir}/${paraview_cmake_module_file}")
endforeach ()
endif ()
include(ParaViewInstallCMakePackageHelpers)
if (NOT PARAVIEW_RELOCATABLE_INSTALL)
list(APPEND paraview_cmake_files_to_install
"${paraview_cmake_build_dir}/paraview-find-package-helpers.cmake")
endif ()
foreach (paraview_cmake_file IN LISTS paraview_cmake_files_to_install)
if (IS_ABSOLUTE "${paraview_cmake_file}")
file(RELATIVE_PATH paraview_cmake_subdir_root "${paraview_cmake_build_dir}" "${paraview_cmake_file}")
get_filename_component(paraview_cmake_subdir "${paraview_cmake_subdir_root}" DIRECTORY)
set(paraview_cmake_original_file "${paraview_cmake_file}")
else ()
get_filename_component(paraview_cmake_subdir "${paraview_cmake_file}" DIRECTORY)
set(paraview_cmake_original_file "${paraview_cmake_dir}/${paraview_cmake_file}")
endif ()
install(
FILES "${paraview_cmake_original_file}"
DESTINATION "${paraview_cmake_destination}/${paraview_cmake_subdir}"
COMPONENT "development")
endforeach ()
install(
FILES "${paraview_cmake_build_dir}/paraview-config.cmake"
"${paraview_cmake_build_dir}/paraview-config-version.cmake"
"${paraview_cmake_build_dir}/paraview-prefix.cmake"
DESTINATION "${paraview_cmake_destination}"
COMPONENT "development")
vtk_module_export_find_packages(
CMAKE_DESTINATION "${paraview_cmake_destination}"
FILE_NAME "ParaView-vtk-module-find-packages.cmake"
MODULES ${paraview_modules})
vtk_module_export_find_packages(
CMAKE_DESTINATION "${paraview_cmake_destination}"
FILE_NAME "ParaViewIncubator-vtk-module-find-packages.cmake"
MODULES ${paraview_incubator_modules})
if (PARAVIEW_USE_QT)
get_property(paraview_client_xml_files GLOBAL
PROPERTY paraview_client_xml_files)
get_property(paraview_client_xml_destination GLOBAL
PROPERTY paraview_client_xml_destination)
set(cmake_xml_file_name "ParaView-client-xml.cmake")
set(cmake_xml_build_file "${paraview_cmake_build_dir}/${cmake_xml_file_name}")
set(cmake_xml_install_file "${CMAKE_CURRENT_BINARY_DIR}/CMakeFiles/${cmake_xml_file_name}.install")
file(WRITE "${cmake_xml_build_file}" "")
file(WRITE "${cmake_xml_install_file}" "")
_vtk_module_write_import_prefix("${cmake_xml_install_file}" "${paraview_client_xml_destination}")
file(APPEND "${cmake_xml_build_file}"
"set(\"\${CMAKE_FIND_PACKAGE_NAME}_CLIENT_XML_FILES\")\n")
file(APPEND "${cmake_xml_install_file}"
"set(\"\${CMAKE_FIND_PACKAGE_NAME}_CLIENT_XML_FILES\")\n")
foreach (paraview_client_xml_file IN LISTS paraview_client_xml_files)
get_filename_component(basename "${paraview_client_xml_file}" NAME)
file(APPEND "${cmake_xml_build_file}"
"list(APPEND \"\${CMAKE_FIND_PACKAGE_NAME}_CLIENT_XML_FILES\"
\"${paraview_client_xml_file}\")\n")
file(APPEND "${cmake_xml_install_file}"
"list(APPEND \"\${CMAKE_FIND_PACKAGE_NAME}_CLIENT_XML_FILES\"
\"\${_vtk_module_import_prefix}/${paraview_client_xml_destination}/${basename}\")\n")
endforeach ()
install(
FILES "${cmake_xml_install_file}"
DESTINATION "${paraview_cmake_destination}"
RENAME "${cmake_xml_file_name}"
COMPONENT "development")
endif ()