From eeb8553305444e551d42711b59390e73c8474aa0 Mon Sep 17 00:00:00 2001 From: Kefu Chai Date: Sat, 4 Mar 2023 13:04:50 +0800 Subject: [PATCH] build: cmake: find and link against RapidJSON despite that RapidJSON is a header-only library, we still need to find it and "link" against it for adding the include directory. Signed-off-by: Kefu Chai --- CMakeLists.txt | 1 + alternator/CMakeLists.txt | 4 +++- tools/CMakeLists.txt | 1 + utils/CMakeLists.txt | 3 ++- 4 files changed, 7 insertions(+), 2 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index 110874841e..cbf83cb857 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -35,6 +35,7 @@ find_package(ICU COMPONENTS uc i18n REQUIRED) find_package(absl REQUIRED) find_package(libdeflate REQUIRED) find_package(libxcrypt REQUIRED) +find_package(RapidJSON REQUIRED) find_package(Thrift REQUIRED) find_package(xxHash REQUIRED) diff --git a/alternator/CMakeLists.txt b/alternator/CMakeLists.txt index 845c10739c..ca48f45437 100644 --- a/alternator/CMakeLists.txt +++ b/alternator/CMakeLists.txt @@ -20,7 +20,9 @@ target_sources(alternator target_include_directories(alternator PUBLIC ${CMAKE_SOURCE_DIR} - ${CMAKE_BINARY_DIR}) + ${CMAKE_BINARY_DIR} + PRIVATE + ${RAPIDJSON_INCLUDE_DIRS}) target_link_libraries(alternator cql3 idl diff --git a/tools/CMakeLists.txt b/tools/CMakeLists.txt index 132bb1d2ac..035153c56d 100644 --- a/tools/CMakeLists.txt +++ b/tools/CMakeLists.txt @@ -9,6 +9,7 @@ target_sources(tools target_include_directories(tools PUBLIC ${CMAKE_SOURCE_DIR} + ${RAPIDJSON_INCLUDE_DIRS} PRIVATE ${LUA_INCLUDE_DIR}) target_link_libraries(tools diff --git a/utils/CMakeLists.txt b/utils/CMakeLists.txt index 292a7ed0db..0b4e5c69bb 100644 --- a/utils/CMakeLists.txt +++ b/utils/CMakeLists.txt @@ -44,7 +44,8 @@ target_sources(utils uuid.cc) target_include_directories(utils PUBLIC - ${CMAKE_SOURCE_DIR}) + ${CMAKE_SOURCE_DIR} + ${RAPIDJSON_INCLUDE_DIRS}) target_link_libraries(utils PUBLIC Seastar::seastar