@@ -93,8 +93,6 @@ endif ()
9393message ("Protobuf_INCLUDE_DIRS: " ${Protobuf_INCLUDE_DIRS} )
9494message ("Protobuf_LIBRARIES: " ${Protobuf_LIBRARIES} )
9595
96- find_package (roaring REQUIRED)
97-
9896# NOTE: CMake might not find curl and zlib on some platforms like Ubuntu, in this case, find them manually
9997set (CURL_NO_CURL_CMAKE ON )
10098find_package (curl QUIET )
@@ -119,6 +117,17 @@ if (NOT ZLIB_INCLUDE_DIRS OR NOT ZLIB_LIBRARIES)
119117 message (FATAL_ERROR "Could not find zlib" )
120118endif ()
121119
120+ find_package (roaring QUIET )
121+ if (NOT ROARING_FOUND)
122+ find_path (ROARING_INCLUDE_DIRS NAMES roaring/roaring.hh)
123+ find_library (ROARING_LIBRARIES NAMES roaring libroaring)
124+ endif ()
125+ message ("ROARING_INCLUDE_DIRS: " ${ROARING_INCLUDE_DIRS} )
126+ message ("ROARING_LIBRARIES: " ${ROARING_LIBRARIES} )
127+ if (NOT ROARING_INCLUDE_DIRS OR NOT ROARING_LIBRARIES)
128+ message (FATAL_ERROR "Could not find libroaring" )
129+ endif ()
130+
122131if (LINK_STATIC AND NOT VCPKG_TRIPLET)
123132 find_library (LIB_ZSTD NAMES libzstd.a)
124133 message (STATUS "ZStd: ${LIB_ZSTD} " )
@@ -234,6 +243,7 @@ include_directories(
234243 ${Boost_INCLUDE_DIRS}
235244 ${OPENSSL_INCLUDE_DIR}
236245 ${ZLIB_INCLUDE_DIRS}
246+ ${ROARING_INCLUDE_DIRS}
237247 ${CURL_INCLUDE_DIRS}
238248 ${Protobuf_INCLUDE_DIRS}
239249 ${GTEST_INCLUDE_PATH}
@@ -249,6 +259,7 @@ set(COMMON_LIBS
249259 ${CURL_LIBRARIES}
250260 ${OPENSSL_LIBRARIES}
251261 ${ZLIB_LIBRARIES}
262+ ${ROARING_LIBRARIES}
252263 ${ADDITIONAL_LIBRARIES}
253264 ${CMAKE_DL_LIBS}
254265)
0 commit comments