diff --git a/CMakeLists.txt b/CMakeLists.txt index 6bf0f17..343ec2b 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -66,13 +66,13 @@ endif() # # IMPORTANT: If you change this, make the analogous update in: # cmake/proxygen-config.cmake.in -find_package(fmt REQUIRED) -find_package(folly REQUIRED) -find_package(wangle REQUIRED) +find_package(fmt CONFIG REQUIRED) +find_package(folly CONFIG REQUIRED) +find_package(wangle CONFIG REQUIRED) if (BUILD_QUIC) - find_package(mvfst REQUIRED) + find_package(mvfst CONFIG REQUIRED) else() - find_package(Fizz REQUIRED) + find_package(fizz CONFIG REQUIRED) endif() find_package(zstd CONFIG REQUIRED) find_package(ZLIB REQUIRED) @@ -128,27 +128,8 @@ SET(GFLAG_DEPENDENCIES "") SET(PROXYGEN_EXTRA_LINK_LIBRARIES "") SET(PROXYGEN_EXTRA_INCLUDE_DIRECTORIES "") -find_package(gflags CONFIG QUIET) -if (gflags_FOUND) - message("module path: ${CMAKE_MODULE_PATH}") - message(STATUS "Found gflags from package config") - if (TARGET gflags-shared) - list(APPEND GFLAG_DEPENDENCIES gflags-shared) - elseif (TARGET gflags) - list(APPEND GFLAG_DEPENDENCIES gflags) - else() - message(FATAL_ERROR - "Unable to determine the target name for the GFlags package.") - endif() - list(APPEND CMAKE_REQUIRED_LIBRARIES ${GFLAGS_LIBRARIES}) - list(APPEND CMAKE_REQUIRED_INCLUDES ${GFLAGS_INCLUDE_DIR}) -else() - find_package(Gflags REQUIRED MODULE) - list(APPEND PROXYGEN_EXTRA_LINK_LIBRARIES ${LIBGFLAGS_LIBRARY}) - list(APPEND PROXYGEN_EXTRA_INCLUDE_DIRECTORIES ${LIBGFLAGS_INCLUDE_DIR}) - list(APPEND CMAKE_REQUIRED_LIBRARIES ${LIBGFLAGS_LIBRARY}) - list(APPEND CMAKE_REQUIRED_INCLUDES ${LIBGFLAGS_INCLUDE_DIR}) -endif() +find_package(gflags CONFIG REQUIRED) +list(APPEND CMAKE_REQUIRED_LIBRARIES gflags::gflags) include(ProxygenTest) diff --git a/cmake/proxygen-config.cmake.in b/cmake/proxygen-config.cmake.in index 8c1426d..f8b89a4 100644 --- a/cmake/proxygen-config.cmake.in +++ b/cmake/proxygen-config.cmake.in @@ -17,19 +17,20 @@ @PACKAGE_INIT@ include(CMakeFindDependencyMacro) -find_dependency(fmt) -find_dependency(folly) -find_dependency(wangle) +find_dependency(fmt CONFIG) +find_dependency(folly CONFIG) +find_dependency(wangle CONFIG) if ("@BUILD_QUIC@") - find_dependency(mvfst) + find_dependency(mvfst CONFIG) endif() -find_dependency(Fizz) +find_dependency(fizz CONFIG) +find_dependency(gflags CONFIG) # For now, anything that depends on Proxygen has to copy its FindZstd.cmake # and issue a `find_package(Zstd)`. Uncommenting this won't work because # this Zstd module exposes a library called `zstd`. The right fix is # discussed on D24686032. # -# find_dependency(Zstd) +find_dependency(zstd CONFIG) find_dependency(ZLIB) find_dependency(OpenSSL) find_dependency(Threads)