Add nlohmann::json dependency

This commit is contained in:
S David 2024-03-15 23:44:27 -04:00
parent 4bded5e501
commit 1da9da7e6f
3 changed files with 7 additions and 1 deletions

View File

@ -75,6 +75,7 @@ endif()
find_package(PkgConfig REQUIRED)
pkg_check_modules(cmark libcmark)
pkg_check_modules(json "nlohmann_json >= 3.11.2" REQUIRED)
if (cmark_FOUND)
set(USE_SYSTEM_CMARK True)

View File

@ -16,6 +16,11 @@ add_library(mdml OBJECT
set(LIBMDML_DEP_LIBS ${LIBMDML_DEP_LIBS} ${STACKTRACE_DEP_LIBS} )
if(json_FOUND)
target_include_directories(mdml PUBLIC ${json_INCLUDE_DIRS})
set(LIBMDML_DEP_LIBS ${LIBMDML_DEP_LIBS} ${json_LIBRARIES} )
endif()
if (USE_SYSTEM_CMARK)
set(LIBMDML_DEP_LIBS ${LIBMDML_DEP_LIBS} ${cmark_LIBRARIES} )
else()

View File

@ -13,7 +13,7 @@ set_target_properties(test-runner PROPERTIES
RUNTIME_OUTPUT_DIRECTORY "${CMAKE_BINARY_DIR}/tests"
)
target_link_directories(test-runner PRIVATE ${CATCH2_LIBRARY_DIRS})
target_link_directories(test-runner PRIVATE ${Catch2_LIBRARY_DIRS})
target_include_directories(test-runner PRIVATE ${Catch2_INCLUDE_DIRS})
# Link the test executable with libmdml and Catch2