Skip to content

Commit 41a1f4f

Browse files
Copilotdfeen87
andcommitted
fix: replace pkg-config JsonCpp detection with find_package(jsoncpp CONFIG QUIET)
Co-authored-by: dfeen87 <158860247+dfeen87@users.noreply.github.com>
1 parent ee7e1eb commit 41a1f4f

1 file changed

Lines changed: 9 additions & 17 deletions

File tree

CMakeLists.txt

Lines changed: 9 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -51,14 +51,7 @@ endif()
5151
find_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)
6457
find_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

163155
if(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 ---
299295
add_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)
317309
if(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)
374366
endif()
375367

@@ -525,7 +517,7 @@ if(ZeroMQ_FOUND)
525517
message(STATUS " - Include: ${ZeroMQ_INCLUDE_DIR}")
526518
message(STATUS " - Library: ${ZeroMQ_LIBRARY}")
527519
endif()
528-
message(STATUS " JsonCpp: ${JSONCPP_FOUND}")
520+
message(STATUS " JsonCpp: ${jsoncpp_FOUND}")
529521
message(STATUS " yaml-cpp: ${yaml-cpp_FOUND}")
530522
message(STATUS "-------------------------------------------------------------")
531523
message(STATUS " Core Modules: TPS Engine, Recovery, Gold Bridge")

0 commit comments

Comments
 (0)