examples: add option to install examples

This commit is contained in:
Vicente Adolfo Bolea Sanchez 2022-02-14 13:17:33 -05:00
parent 4a0fad6e5a
commit 75fed87240
2 changed files with 10 additions and 0 deletions

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

@ -146,6 +146,9 @@ vtkm_option(VTKm_NO_ASSERT_HIP "Disable assertions for HIP devices." ON)
# installed. # installed.
vtkm_option(VTKm_INSTALL_ONLY_LIBRARIES "install only vtk-m libraries and no headers" OFF) 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. # 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, # 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 # rather than exporting all symbols. This flag is added so that consumers
@ -408,6 +411,12 @@ endif()
# Build examples # Build examples
add_subdirectory(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 # Tutorial examples
if(VTKm_ENABLE_TUTORIALS) if(VTKm_ENABLE_TUTORIALS)
add_subdirectory(tutorial) add_subdirectory(tutorial)