Skip to content

Commit 63e0823

Browse files
committed
use find_package
1 parent ab37fd6 commit 63e0823

File tree

4 files changed

+3
-20636
lines changed

4 files changed

+3
-20636
lines changed

CMakeLists.txt

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -98,7 +98,7 @@ if (FANS_LIBRARY_FOR_MICRO_MANAGER)
9898
)
9999
FetchContent_MakeAvailable(pybind11)
100100
endif()
101-
101+
find_package(nlohmann_json REQUIRED)
102102
# ##############################################################################
103103
# TARGETS
104104
# ##############################################################################
@@ -141,7 +141,6 @@ target_include_directories(FANS_FANS PUBLIC $<BUILD_INTERFACE:${CMAKE_CURRENT_SO
141141
# FANS.h header that consuming projects can use
142142
set_property(TARGET FANS_FANS PROPERTY PUBLIC_HEADER
143143
include/general.h
144-
include/json.hpp
145144
include/matmodel.h
146145
include/reader.h
147146
include/solverCG.h
@@ -200,6 +199,7 @@ target_link_libraries(FANS_FANS PUBLIC ${FFTW3_LIBRARIES})
200199
target_compile_definitions(FANS_FANS PUBLIC ${FFTW3_DEFINITIONS})
201200

202201
target_link_libraries(FANS_FANS PUBLIC Eigen3::Eigen)
202+
target_link_libraries(FANS_FANS PUBLIC nlohmann_json::nlohmann_json)
203203

204204
target_link_libraries(FANS_main PRIVATE FANS::FANS)
205205

include/general.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@
1717
using namespace std;
1818

1919
// JSON
20-
#include <json.hpp>
20+
#include <nlohmann/json.hpp>
2121
using nlohmann::json;
2222
using namespace nlohmann;
2323

0 commit comments

Comments
 (0)