Skip to content

Commit

Permalink
Update CPM.cmake and rename tests
Browse files Browse the repository at this point in the history
  • Loading branch information
mlund committed Nov 1, 2024
1 parent 7c87708 commit 5dd0738
Showing 1 changed file with 6 additions and 13 deletions.
19 changes: 6 additions & 13 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,8 @@ endif()

# dependencies

CPMAddPackage("gh:onqtam/doctest#2.4.6")
CPMAddPackage("gh:doctest/doctest#v2.4.11")
CPMAddPackage("gh:nlohmann/[email protected]")

# Eigen
CPMAddPackage(NAME Eigen VERSION 3.4.0 DOWNLOAD_ONLY YES
Expand All @@ -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)

0 comments on commit 5dd0738

Please sign in to comment.