cmake <3.12 compat

This commit is contained in:
Jason Rhinelander 2020-08-07 17:35:13 -03:00
parent b7a7dfc080
commit e1d3a288eb

View file

@ -127,7 +127,15 @@ target_compile_definitions(uWebSockets INTERFACE UWS_HTTPRESPONSE_NO_WRITEMARK U
# 3.15+, and we target lower than that (and this is fairly simple to build).
if(NOT BUILD_STATIC_DEPS)
find_package(CURL REQUIRED COMPONENTS HTTP HTTPS SSL)
find_package(CURL REQUIRED COMPONENTS HTTP HTTPS SSL)
# CURL::libcurl wasn't added to FindCURL until cmake 3.12, so add it if necessary
if (CMAKE_VERSION VERSION_LESS 3.12 AND NOT TARGET CURL::libcurl)
add_library(CURL::libcurl UNKNOWN IMPORTED GLOBAL)
set_target_properties(CURL::libcurl PROPERTIES
INTERFACE_INCLUDE_DIRECTORIES "${CURL_INCLUDE_DIRS}"
INTERFACE_LINK_LIBRARIES ${CURL_LIBRARIES})
endif()
endif()
file(GLOB cpr_sources ${conf_depends} cpr/cpr/*.cpp)