diff --git a/CMakeLists.txt b/CMakeLists.txt index b78276f..e6befca 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -19,7 +19,8 @@ endif() # dependencies -CPMAddPackage("gh:onqtam/doctest#2.4.6") +CPMAddPackage("gh:doctest/doctest#v2.4.11") +CPMAddPackage("gh:nlohmann/json@3.11.3") # Eigen CPMAddPackage(NAME Eigen VERSION 3.4.0 DOWNLOAD_ONLY YES @@ -29,21 +30,13 @@ if(Eigen_ADDED) target_include_directories(Eigen INTERFACE ${Eigen_SOURCE_DIR}) endif() -# modern json -CPMAddPackage( - NAME nlohmann_json VERSION 3.10.5 OPTIONS "JSON_BuildTests OFF" - URL https://github.com/nlohmann/json/releases/download/v3.10.5/include.zip) -if (nlohmann_json_ADDED) - add_library(nlohmann_json INTERFACE IMPORTED) - target_include_directories(nlohmann_json INTERFACE ${nlohmann_json_SOURCE_DIR}/include) -endif() - include_directories(${CMAKE_SOURCE_DIR}/include) add_executable(example test/example.cpp) target_link_libraries(example Eigen nlohmann_json) -add_executable(unittests test/unittests.cpp) -target_link_libraries(unittests doctest Eigen nlohmann_json) +add_executable(tests test/unittests.cpp) +target_link_libraries(tests doctest Eigen nlohmann_json) + +add_test(NAME tests COMMAND tests) -add_test(NAME unittests COMMAND unittests)