Vec3/tests/CMakeLists.txt
2025-04-16 22:16:58 -04:00

26 lines
693 B
CMake

project(${CMAKE_PROJECT_NAME}_tests)
# Clone Google Test
set(GOOGLETEST_DIR ${CMAKE_SOURCE_DIR}/tests/lib/googletest)
if(NOT EXISTS ${GOOGLETEST_DIR})
find_package(Git REQUIRED)
execute_process(
COMMAND ${GIT_EXECUTABLE} clone https://github.com/google/googletest ${GOOGLETEST_DIR}
)
endif()
add_subdirectory(lib/googletest)
add_subdirectory(unit_tests)
# Only run Cuda tests if cuda is available
if (CMAKE_CUDA_COMPILER)
set(CMAKE_CUDA_ARCHITECTURES 61)
set(CUDA_SEPARABLE_COMPILATION ON)
add_subdirectory(cuda_unit_tests)
message(STATUS "CUDA found. CUDA tests will be build")
else()
message(STATUS "CUDA not found. Skipping CUDA tests")
endif()