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 <kefu.chai@scylladb.com>
This commit is contained in:
Kefu Chai
2023-03-04 13:04:50 +08:00
parent c5d1a69859
commit eeb8553305
4 changed files with 7 additions and 2 deletions

View File

@@ -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)

View File

@@ -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

View File

@@ -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

View File

@@ -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