windows-amd64-prebuilt-libr.../vcpkg/ports/folly/find-double-conversion.patch
2020-10-10 14:36:42 +02:00

26 lines
1.1 KiB
Diff

diff --git a/CMake/folly-deps.cmake b/CMake/folly-deps.cmake
index 1522db2..5ed2ea9 100644
--- a/CMake/folly-deps.cmake
+++ b/CMake/folly-deps.cmake
@@ -17,9 +17,17 @@ find_package(Boost 1.51.0 MODULE
list(APPEND FOLLY_LINK_LIBRARIES ${Boost_LIBRARIES})
list(APPEND FOLLY_INCLUDE_DIRECTORIES ${Boost_INCLUDE_DIRS})
-find_package(DoubleConversion MODULE REQUIRED)
-list(APPEND FOLLY_LINK_LIBRARIES ${DOUBLE_CONVERSION_LIBRARY})
-list(APPEND FOLLY_INCLUDE_DIRECTORIES ${DOUBLE_CONVERSION_INCLUDE_DIR})
+find_package(double-conversion CONFIG REQUIRED)
+if (double-conversion_FOUND)
+ message(STATUS "Found double-conversion from package config")
+ set(FOLLY_HAVE_DOUBLE_CONVERSION ON)
+ # How to obtain link libraries from target? double-conversion doesn't set property INTERFACE_LINK_LIBRARIES
+ list(APPEND FOLLY_INCLUDE_DIRECTORIES ${DOUBLE_CONVERSION_INCLUDE_DIR})
+else()
+ find_package(DoubleConversion MODULE)
+ list(APPEND FOLLY_LINK_LIBRARIES ${DOUBLE_CONVERSION_LIBRARY})
+ list(APPEND FOLLY_INCLUDE_DIRECTORIES ${DOUBLE_CONVERSION_INCLUDE_DIR})
+endif()
set(FOLLY_HAVE_LIBGFLAGS OFF)
find_package(gflags CONFIG REQUIRED)