From 91a267eacc33fda39f827b4f80f3542ffd5d94a2 Mon Sep 17 00:00:00 2001 From: Tushar Athawale Date: Sat, 12 Feb 2022 11:25:50 -0500 Subject: [PATCH] tutorial updates to fix warnings and CMakeLists for optional tutorial build --- CMakeLists.txt | 5 ++++- tutorial/CMakeLists.txt | 3 +++ tutorial/point_to_cell.cxx | 2 +- tutorial/rendering.cxx | 2 +- 4 files changed, 9 insertions(+), 3 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index 03d999577..2da9be138 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -97,6 +97,7 @@ vtkm_option(VTKm_ENABLE_BENCHMARKS "Enable VTKm Benchmarking" OFF) vtkm_option(VTKm_ENABLE_MPI "Enable MPI support" OFF) vtkm_option(VTKm_ENABLE_DOCUMENTATION "Build Doxygen documentation" OFF) vtkm_option(VTKm_ENABLE_EXAMPLES "Build examples" OFF) +vtkm_option(VTKm_ENABLE_TUTORIALS "Build tutorials" OFF) if (NOT DEFINED VTKm_ENABLE_TESTING) if(EXISTS "${CMAKE_SOURCE_DIR}/.git") vtkm_option(VTKm_ENABLE_TESTING "Enable VTKm Testing" ON) @@ -408,4 +409,6 @@ endif() add_subdirectory(examples) # Tutorial examples -add_subdirectory(tutorial) +if(VTKm_ENABLE_TUTORIALS) + add_subdirectory(tutorial) +endif() diff --git a/tutorial/CMakeLists.txt b/tutorial/CMakeLists.txt index 4bb41627a..8d3d5c46c 100644 --- a/tutorial/CMakeLists.txt +++ b/tutorial/CMakeLists.txt @@ -10,6 +10,9 @@ #add the directory that contains the VTK-m config file to the cmake #path so that our examples can find VTK-m +#Normally when running CMake, you need to set the VTKm_DIR to +#find the VTKmConfig.cmake file. Because we already know where this +#file is, we can add the location to look to CMAKE_PREFIX_PATH. set(CMAKE_PREFIX_PATH ${VTKm_BINARY_DIR}/${VTKm_INSTALL_CONFIG_DIR}) diff --git a/tutorial/point_to_cell.cxx b/tutorial/point_to_cell.cxx index 4bc051855..2fb037720 100644 --- a/tutorial/point_to_cell.cxx +++ b/tutorial/point_to_cell.cxx @@ -38,7 +38,7 @@ struct ConvertPointFieldToCells : vtkm::worklet::WorkletVisitCellsWithPoints { outCellField = outCellField + inPointFieldVec[pointIndex]; } - outCellField = outCellField / OutCellFieldType(numPoints); + outCellField = outCellField / static_cast(numPoints); } }; diff --git a/tutorial/rendering.cxx b/tutorial/rendering.cxx index b15d350c3..3fed98298 100644 --- a/tutorial/rendering.cxx +++ b/tutorial/rendering.cxx @@ -52,7 +52,7 @@ int main(int argc, char** argv) view.Paint(); //Saving View - view.SaveAs("BasicRendering.ppm"); + view.SaveAs("BasicRendering.png"); return 0; }