From b83b4f88807858cef5aca3eebb6ae861d6a76d87 Mon Sep 17 00:00:00 2001 From: Vicente Adolfo Bolea Sanchez Date: Wed, 22 Sep 2021 15:51:36 -0400 Subject: [PATCH] CMake: adds VTKm_ENABLE_TESTING_LIB --- CMakeLists.txt | 5 +++++ vtkm/cont/CMakeLists.txt | 4 ++-- vtkm/cont/testing/CMakeLists.txt | 20 +++++++++++--------- 3 files changed, 18 insertions(+), 11 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index f7424fd9d..c71da7690 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -97,6 +97,11 @@ if (NOT DEFINED VTKm_ENABLE_TESTING) endif() endif() +# By default: VTKm_ENABLE_TESTING -> VTKm_ENABLE_TESTING_LIB +include(CMakeDependentOption) +cmake_dependent_option(VTKm_ENABLE_TESTING_LIBRARY "Enable VTKm Testing Library" OFF "NOT VTKm_ENABLE_TESTING" ON) +mark_as_advanced(VTKm_ENABLE_TESTING_LIB) + vtkm_option(VTKm_USE_DOUBLE_PRECISION "Use double precision for floating point calculations" OFF) vtkm_option(VTKm_USE_64BIT_IDS "Use 64-bit indices." ON) diff --git a/vtkm/cont/CMakeLists.txt b/vtkm/cont/CMakeLists.txt index 6c0aa1768..26cdd9beb 100644 --- a/vtkm/cont/CMakeLists.txt +++ b/vtkm/cont/CMakeLists.txt @@ -319,6 +319,6 @@ if(TARGET vtkm_loguru) endif() #----------------------------------------------------------------------------- -if (VTKm_ENABLE_TESTING) +if(VTKm_ENABLE_TESTING_LIBRARY) add_subdirectory(testing) -endif () +endif() diff --git a/vtkm/cont/testing/CMakeLists.txt b/vtkm/cont/testing/CMakeLists.txt index ea577e3d0..f3bf3df1a 100644 --- a/vtkm/cont/testing/CMakeLists.txt +++ b/vtkm/cont/testing/CMakeLists.txt @@ -112,13 +112,15 @@ vtkm_library( ) target_link_libraries(vtkm_cont_testing PUBLIC vtkm_cont) -vtkm_unit_tests(SOURCES ${unit_tests} DEFINES VTKM_NO_ERROR_ON_MIXED_CUDA_CXX_TAG) +if(VTKm_ENABLE_TESTING) + vtkm_unit_tests(SOURCES ${unit_tests} DEFINES VTKM_NO_ERROR_ON_MIXED_CUDA_CXX_TAG) -# add distributed tests i.e. test to run with MPI -# if MPI is enabled. -set(mpi_unit_tests - UnitTestFieldRangeGlobalCompute.cxx - UnitTestSerializationArrayHandle.cxx - UnitTestSerializationDataSet.cxx - ) -vtkm_unit_tests(MPI SOURCES ${mpi_unit_tests} DEFINES VTKM_NO_ERROR_ON_MIXED_CUDA_CXX_TAG) + # add distributed tests i.e. test to run with MPI + # if MPI is enabled. + set(mpi_unit_tests + UnitTestFieldRangeGlobalCompute.cxx + UnitTestSerializationArrayHandle.cxx + UnitTestSerializationDataSet.cxx + ) + vtkm_unit_tests(MPI SOURCES ${mpi_unit_tests} DEFINES VTKM_NO_ERROR_ON_MIXED_CUDA_CXX_TAG) +endif()