29 lines
694 B
CMake
29 lines
694 B
CMake
cmake_minimum_required(VERSION 3.20)
|
|
|
|
project(mini-odeint)
|
|
|
|
option(FORCE_FETCH_CATCH2 "Force fetching Catch2" OFF)
|
|
|
|
set(CMAKE_CXX_STANDARD 20)
|
|
set(CMAKE_CXX_STANDARD_REQUIRED ON)
|
|
|
|
find_package(Catch2 3 QUIET)
|
|
|
|
if(NOT TARGET Catch2::Catch2WithMain OR FORCE_FETCH_CATCH2)
|
|
include(FetchContent)
|
|
FetchContent_Declare(
|
|
Catch2
|
|
GIT_REPOSITORY https://github.com/catchorg/Catch2.git
|
|
GIT_TAG v3.4.0)
|
|
FetchContent_MakeAvailable(Catch2)
|
|
list(APPEND CMAKE_MODULE_PATH ${catch2_SOURCE_DIR}/extras)
|
|
endif()
|
|
|
|
include(CTest)
|
|
include(Catch)
|
|
|
|
add_executable(tests mini-odeint-tests.cpp mini-odeint.hpp)
|
|
target_link_libraries(tests PRIVATE Catch2::Catch2WithMain)
|
|
|
|
catch_discover_tests(tests)
|