diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt index 8bc8557..e6d20ee 100644 --- a/src/CMakeLists.txt +++ b/src/CMakeLists.txt @@ -24,8 +24,16 @@ target_include_directories(${PROJECT_NAME} "$" "$") -target_link_libraries(${PROJECT_NAME} - PUBLIC CURL::libcurl) +# FindCURL provides an IMPORTED target since CMake 3.12. +if(NOT ${CMAKE_VERSION} VERSION_LESS 3.12) + target_link_libraries(${PROJECT_NAME} + PUBLIC CURL::libcurl) +else() + target_include_directories(${PROJECT_NAME} + PUBLIC ${CURL_INCLUDE_DIRS}) + target_link_libraries(${PROJECT_NAME} + PUBLIC ${CURL_LIBRARIES}) +endif() install(TARGETS ${PROJECT_NAME}