2023-04-18 07:33:49 +08:00
|
|
|
diff --git a/CMakeLists.txt b/CMakeLists.txt
|
2023-06-01 03:24:33 +08:00
|
|
|
index d2b69ad..84b2bf8 100644
|
2023-04-18 07:33:49 +08:00
|
|
|
--- a/CMakeLists.txt
|
|
|
|
+++ b/CMakeLists.txt
|
2023-06-01 03:24:33 +08:00
|
|
|
@@ -96,22 +96,24 @@ endif ()
|
2023-04-18 07:33:49 +08:00
|
|
|
|
|
|
|
# Find required dependencies for thrift/lib
|
2023-06-01 03:24:33 +08:00
|
|
|
if (THRIFT_LIB_ONLY OR build_all)
|
2023-04-18 07:33:49 +08:00
|
|
|
- find_package(Gflags REQUIRED)
|
|
|
|
+ find_package(gflags CONFIG REQUIRED)
|
|
|
|
+ set(LIBGFLAGS_LIBRARY gflags::gflags)
|
|
|
|
find_package(glog CONFIG REQUIRED)
|
|
|
|
set (GLOG_LIBRARIES glog::glog)
|
|
|
|
find_package(folly CONFIG REQUIRED)
|
2023-06-01 03:24:33 +08:00
|
|
|
find_package(fizz CONFIG REQUIRED)
|
2023-04-18 07:33:49 +08:00
|
|
|
find_package(wangle CONFIG REQUIRED)
|
|
|
|
find_package(ZLIB REQUIRED)
|
|
|
|
- find_package(Zstd REQUIRED)
|
|
|
|
+ find_package(zstd CONFIG REQUIRED)
|
|
|
|
+ if(TARGET zstd::libzstd_shared)
|
|
|
|
+ set(ZSTD_LIBRARIES zstd::libzstd_shared)
|
|
|
|
+ elseif(TARGET zstd::libzstd_static)
|
|
|
|
+ set(ZSTD_LIBRARIES zstd::libzstd_static)
|
|
|
|
+ endif()
|
|
|
|
# https://cmake.org/cmake/help/v3.9/module/FindThreads.html
|
|
|
|
set(THREADS_PREFER_PTHREAD_FLAG ON)
|
|
|
|
find_package(Threads)
|
|
|
|
include_directories(
|
|
|
|
- ${LIBGFLAGS_INCLUDE_DIR}
|
|
|
|
- ${GLOG_INCLUDE_DIRS}
|
|
|
|
- ${OPENSSL_INCLUDE_DIR}
|
|
|
|
- ${ZSTD_INCLUDE_DIRS}
|
|
|
|
)
|
|
|
|
add_definitions("-DTHRIFT_HAVE_LIBSNAPPY=0")
|
2023-06-01 03:24:33 +08:00
|
|
|
if (THRIFT_LIB_ONLY)
|
2023-04-18 07:33:49 +08:00
|
|
|
diff --git a/thrift/cmake/FBThriftConfig.cmake.in b/thrift/cmake/FBThriftConfig.cmake.in
|
|
|
|
index e1297ed..c7d9d59 100644
|
|
|
|
--- a/thrift/cmake/FBThriftConfig.cmake.in
|
|
|
|
+++ b/thrift/cmake/FBThriftConfig.cmake.in
|
|
|
|
@@ -28,7 +28,14 @@ else()
|
|
|
|
set_and_check(FBTHRIFT_COMPILER "@PACKAGE_BIN_INSTALL_DIR@/thrift1")
|
|
|
|
endif()
|
|
|
|
|
|
|
|
-find_dependency(ZLIB REQUIRED)
|
|
|
|
+find_dependency(fizz CONFIG )
|
|
|
|
+find_dependency(fmt CONFIG )
|
|
|
|
+find_dependency(folly CONFIG )
|
|
|
|
+find_dependency(gflags CONFIG)
|
|
|
|
+find_dependency(glog CONFIG )
|
|
|
|
+find_dependency(wangle CONFIG )
|
|
|
|
+find_dependency(ZLIB)
|
|
|
|
+find_dependency(zstd CONFIG)
|
|
|
|
|
|
|
|
if (NOT TARGET FBThrift::thriftcpp2)
|
|
|
|
include("${FBTHRIFT_CMAKE_DIR}/FBThriftTargets.cmake")
|