thread\r
REQUIRED\r
)\r
+\r
find_package(DoubleConversion MODULE REQUIRED)\r
-find_package(GFlags MODULE REQUIRED)\r
-find_package(GLog MODULE REQUIRED)\r
-find_package(LibEvent MODULE REQUIRED)\r
+\r
+find_package(gflags CONFIG)\r
+if(NOT TARGET gflags)\r
+ find_package(GFlags MODULE REQUIRED)\r
+endif()\r
+\r
+find_package(glog CONFIG)\r
+if(NOT TARGET glog::glog)\r
+ find_package(GLog MODULE REQUIRED)\r
+endif()\r
+\r
+find_package(Libevent CONFIG)\r
+if(NOT TARGET event)\r
+ find_package(LibEvent MODULE REQUIRED)\r
+endif()\r
+\r
find_package(OpenSSL MODULE REQUIRED)\r
find_package(PThread MODULE)\r
set(FOLLY_LINK_LIBRARIES
${DOUBLE_CONVERSION_LIBRARY}
- ${LIBEVENT_LIB}
- ${LIBGFLAGS_LIBRARY}
- ${LIBGLOG_LIBRARY}
+)
+
+set(FOLLY_INCLUDE_DIRECTORIES
+ ${DOUBLE_CONVERSION_INCLUDE_DIR}
+)
+
+if(TARGET gflags)
+ set(FOLLY_SHINY_DEPENDENCIES ${FOLLY_SHINY_DEPENDENCIES} gflags)
+else()
+ set(FOLLY_LINK_LIBRARIES ${FOLLY_LINK_LIBRARIES} ${LIBGFLAGS_LIBRARY})
+ set(FOLLY_INCLUDE_DIRECTORIES ${FOLLY_INCLUDE_DIRECTORIES} ${LIBGFLAGS_INCLUDE_DIR})
+endif()
+
+if(TARGET glog::glog)
+ set(FOLLY_SHINY_DEPENDENCIES ${FOLLY_SHINY_DEPENDENCIES} glog::glog)
+else()
+ set(FOLLY_LINK_LIBRARIES ${FOLLY_LINK_LIBRARIES} ${LIBGLOG_LIBRARY})
+ set(FOLLY_INCLUDE_DIRECTORIES ${FOLLY_INCLUDE_DIRECTORIES} ${LIBGLOG_INCLUDE_DIR})
+endif()
+
+if(TARGET event)
+ set(FOLLY_SHINY_DEPENDENCIES ${FOLLY_SHINY_DEPENDENCIES} event)
+else()
+ set(FOLLY_LINK_LIBRARIES ${FOLLY_LINK_LIBRARIES} ${LIBEVENT_LIB})
+ set(FOLLY_INCLUDE_DIRECTORIES ${FOLLY_INCLUDE_DIRECTORIES} ${LIBEVENT_INCLUDE_DIR})
+endif()
+
+
+set(FOLLY_LINK_LIBRARIES
+ ${FOLLY_LINK_LIBRARIES}
Iphlpapi.lib
Ws2_32.lib
target_include_directories(folly_base
PUBLIC
- ${DOUBLE_CONVERSION_INCLUDE_DIR}
- ${LIBGFLAGS_INCLUDE_DIR}
- ${LIBGLOG_INCLUDE_DIR}
- ${LIBEVENT_INCLUDE_DIR}
+ ${FOLLY_INCLUDE_DIRECTORIES}
$<BUILD_INTERFACE:${CMAKE_CURRENT_BINARY_DIR}>
)
foreach (LIB ${FOLLY_SHINY_DEPENDENCIES})
target_include_directories(folly_base PUBLIC $<TARGET_PROPERTY:${LIB},INCLUDE_DIRECTORIES>)
+ target_compile_definitions(folly_base PUBLIC $<TARGET_PROPERTY:${LIB},INTERFACE_COMPILE_DEFINITIONS>)
endforeach()
if (FOLLY_HAVE_PTHREAD)