Skip to content

Commit ea21442

Browse files
Updated cmake files to auto download the nlohmann JSON dependency
1 parent de7e5fa commit ea21442

2 files changed

Lines changed: 9 additions & 3 deletions

File tree

examples/metabolic_simplification/CMakeLists.txt

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -38,6 +38,9 @@ GetLPSolve()
3838
include("../../external/cmake-files/SuiteSparse.cmake")
3939
GetSuiteSparse()
4040

41+
include("../../external/cmake-files/JSON.cmake")
42+
GetJSON()
43+
4144
set(CMAKE_EXPORT_COMPILE_COMMANDS "ON")
4245

4346
include_directories (BEFORE ../../external)
@@ -62,4 +65,4 @@ add_definitions(${CXX_COVERAGE_COMPILE_FLAGS} "-DBOOST_NO_AUTO_PTR")
6265
find_package(LAPACK REQUIRED)
6366
find_package(BLAS REQUIRED)
6467
add_executable(metabolic_simplification metabolic_simplification.cpp)
65-
TARGET_LINK_LIBRARIES(metabolic_simplification highs::highs lp_solve ${SUITESPARSE_LIBRARIES} ${LAPACK_LIBRARIES} ${BLAS_LIBRARIES} ${MKL_LINK})
68+
TARGET_LINK_LIBRARIES(metabolic_simplification highs::highs lp_solve nlohmann_json::nlohmann_json ${SUITESPARSE_LIBRARIES} ${LAPACK_LIBRARIES} ${BLAS_LIBRARIES} ${MKL_LINK})

test/CMakeLists.txt

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -134,6 +134,9 @@ GetSuiteSparse()
134134
include("../external/cmake-files/HiGHS.cmake")
135135
GetHighs()
136136

137+
include("../external/cmake-files/JSON.cmake")
138+
GetJSON()
139+
137140
# Code Coverage Configuration
138141
add_library(coverage_config INTERFACE)
139142

@@ -489,7 +492,7 @@ find_package(LAPACK REQUIRED)
489492
find_package(BLAS REQUIRED)
490493
TARGET_LINK_LIBRARIES(full_dimensional_polytope_test lp_solve ${SUITESPARSE_LIBRARIES} ${LAPACK_LIBRARIES} ${BLAS_LIBRARIES} ${MKL_LINK} coverage_config)
491494
TARGET_LINK_LIBRARIES(test_highs highs::highs coverage_config)
492-
TARGET_LINK_LIBRARIES(test_metabolic_polytope highs::highs coverage_config)
495+
TARGET_LINK_LIBRARIES(test_metabolic_polytope highs::highs nlohmann_json::nlohmann_json coverage_config)
493496
TARGET_LINK_LIBRARIES(test_simplification highs::highs coverage_config)
494497
TARGET_LINK_LIBRARIES(test_transformation highs::highs lp_solve ${SUITESPARSE_LIBRARIES} ${LAPACK_LIBRARIES} ${BLAS_LIBRARIES} ${MKL_LINK} coverage_config)
495-
TARGET_LINK_LIBRARIES(benchmark_simplification highs::highs coverage_config)
498+
TARGET_LINK_LIBRARIES(benchmark_simplification highs::highs nlohmann_json::nlohmann_json coverage_config)

0 commit comments

Comments
 (0)