Merge topic 'install-examples'

75fed8724 examples: add option to install examples

Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !2716
This commit is contained in:
Vicente Bolea 2022-02-17 18:08:13 +00:00 committed by Kitware Robot
commit 279231bdbf
2 changed files with 10 additions and 0 deletions

@ -61,6 +61,7 @@ foreach(option IN LISTS options)
elseif(examples STREQUAL option)
set(VTKm_ENABLE_EXAMPLES "ON" CACHE STRING "")
set(VTKm_INSTALL_EXAMPLES "ON" CACHE STRING "")
elseif(docs STREQUAL option)
set(VTKm_ENABLE_DOCUMENTATION "ON" CACHE STRING "")

@ -146,6 +146,9 @@ vtkm_option(VTKm_NO_ASSERT_HIP "Disable assertions for HIP devices." ON)
# installed.
vtkm_option(VTKm_INSTALL_ONLY_LIBRARIES "install only vtk-m libraries and no headers" OFF)
# Install examples projects
cmake_dependent_option(VTKm_INSTALL_EXAMPLES "Install examples" OFF "NOT VTKm_ENABLE_EXAMPLES" ON)
# VTK-m is setup by default not to export symbols unless explicitly stated.
# We prefer to only export symbols of a small set of user facing classes,
# rather than exporting all symbols. This flag is added so that consumers
@ -408,6 +411,12 @@ endif()
# Build examples
add_subdirectory(examples)
if (VTKm_INSTALL_EXAMPLES)
include(GNUInstallDirs)
install(DIRECTORY examples DESTINATION ${CMAKE_INSTALL_DOCDIR} REGEX examples/CMakeLists.txt EXCLUDE)
endif()
#-----------------------------------------------------------------------------
# Tutorial examples
if(VTKm_ENABLE_TUTORIALS)
add_subdirectory(tutorial)