diff --git a/src/curl/build_vars.cmake b/src/curl/build_vars.cmake index 015b68c..3f8206d 100644 --- a/src/curl/build_vars.cmake +++ b/src/curl/build_vars.cmake @@ -9,8 +9,12 @@ if(${vsgXchange_curl}) set(SOURCES ${SOURCES} curl/curl.cpp ) - set(EXTRA_INCLUDES ${EXTRA_INCLUDES} ${CURL_INCLUDE_DIR}) - set(EXTRA_LIBRARIES ${EXTRA_LIBRARIES} ${CURL_LIBRARIES}) + if(TARGET CURL::libcurl) + set(EXTRA_LIBRARIES ${EXTRA_LIBRARIES} CURL::libcurl) + else() + set(EXTRA_LIBRARIES ${EXTRA_LIBRARIES} ${CURL_LIBRARIES}) + set(EXTRA_INCLUDES ${EXTRA_INCLUDES} ${CURL_INCLUDE_DIR}) + endif() if(NOT BUILD_SHARED_LIBS) set(FIND_DEPENDENCY ${FIND_DEPENDENCY} "find_dependency(CURL)") endif()