@@ -51,14 +51,7 @@ endif()
5151find_package (cppzmq QUIET )
5252
5353# 4. JsonCpp (For RPC parsing in BitcoinAdapter)
54- pkg_check_modules (JSONCPP jsoncpp )
55- if (NOT JSONCPP_FOUND)
56- find_package (jsoncpp QUIET )
57- if (jsoncpp_FOUND)
58- set (JSONCPP_LIBRARIES jsoncpp_lib)
59- get_target_property (JSONCPP_INCLUDE_DIRS jsoncpp_lib INTERFACE_INCLUDE_DIRECTORIES )
60- endif ()
61- endif ()
54+ find_package (jsoncpp CONFIG QUIET )
6255
6356# 5. nlohmann/json (Header-only JSON for multi-chain adapters)
6457find_package (nlohmann_json QUIET )
@@ -157,7 +150,6 @@ include_directories(
157150 ${CMAKE_CURRENT_SOURCE_DIR } /econ # For ILedger.h and economic model headers
158151 ${OPENSSL_INCLUDE_DIR}
159152 ${CURL_INCLUDE_DIRS}
160- ${JSONCPP_INCLUDE_DIRS}
161153)
162154
163155if (ZeroMQ_INCLUDE_DIR)
@@ -291,10 +283,14 @@ target_link_libraries(ailee_node
291283 OpenSSL::SSL
292284 OpenSSL::Crypto
293285 ${CURL_LIBRARIES}
294- ${JSONCPP_LIBRARIES}
295286 Threads::Threads
296287)
297288
289+ if (jsoncpp_FOUND)
290+ target_link_libraries (ailee_node PRIVATE jsoncpp_lib )
291+ target_compile_definitions (ailee_node PRIVATE AILEE_HAS_JSONCPP=1 )
292+ endif ()
293+
298294# --- 2. L2 Verification Tool ---
299295add_executable (ailee_l2_verify
300296 src/tools/ailee_l2_verify.cpp
@@ -309,10 +305,6 @@ target_link_libraries(ailee_l2_verify
309305 OpenSSL::Crypto
310306)
311307
312- if (JSONCPP_FOUND OR jsoncpp_FOUND)
313- target_compile_definitions (ailee_node PRIVATE AILEE_HAS_JSONCPP=1 )
314- endif ()
315-
316308# Link yaml-cpp if found (for policy system)
317309if (yaml-cpp_FOUND)
318310 target_link_libraries (ailee_node PRIVATE yaml-cpp )
@@ -365,11 +357,11 @@ target_link_libraries(ailee_adapters
365357 OpenSSL::SSL
366358 OpenSSL::Crypto
367359 ${CURL_LIBRARIES}
368- ${JSONCPP_LIBRARIES}
369360 Threads::Threads
370361)
371362
372- if (JSONCPP_FOUND OR jsoncpp_FOUND)
363+ if (jsoncpp_FOUND)
364+ target_link_libraries (ailee_adapters PRIVATE jsoncpp_lib )
373365 target_compile_definitions (ailee_adapters PRIVATE AILEE_HAS_JSONCPP=1 )
374366endif ()
375367
@@ -525,7 +517,7 @@ if(ZeroMQ_FOUND)
525517 message (STATUS " - Include: ${ZeroMQ_INCLUDE_DIR} " )
526518 message (STATUS " - Library: ${ZeroMQ_LIBRARY} " )
527519endif ()
528- message (STATUS " JsonCpp: ${JSONCPP_FOUND } " )
520+ message (STATUS " JsonCpp: ${jsoncpp_FOUND } " )
529521message (STATUS " yaml-cpp: ${yaml-cpp_FOUND} " )
530522message (STATUS "-------------------------------------------------------------" )
531523message (STATUS " Core Modules: TPS Engine, Recovery, Gold Bridge" )
0 commit comments