mirror of
https://github.com/Kitware/CMake.git
synced 2026-02-28 19:58:34 -06:00
FindCURL: Rename imported target to match upstream CURL
Upstream CURL provides imported target `CURL::libcurl`. Rename the target added by `FindCURL` to match. We don't need compatibility with the old name because it has never been in a CMake release (except a 3.12 release candidate). Suggested-by: Jakub Zakrzewski <slither.jz@gmail.com> Acked-by: Rolf Eike Beer <eike@sf-mail.de> Fixes: #18091
This commit is contained in:
@@ -10,7 +10,7 @@
|
|||||||
# IMPORTED Targets
|
# IMPORTED Targets
|
||||||
# ^^^^^^^^^^^^^^^^
|
# ^^^^^^^^^^^^^^^^
|
||||||
#
|
#
|
||||||
# This module defines :prop_tgt:`IMPORTED` target ``CURL::CURL``, if
|
# This module defines :prop_tgt:`IMPORTED` target ``CURL::libcurl``, if
|
||||||
# curl has been found.
|
# curl has been found.
|
||||||
#
|
#
|
||||||
# Result Variables
|
# Result Variables
|
||||||
@@ -67,9 +67,9 @@ if(CURL_FOUND)
|
|||||||
set(CURL_LIBRARIES ${CURL_LIBRARY})
|
set(CURL_LIBRARIES ${CURL_LIBRARY})
|
||||||
set(CURL_INCLUDE_DIRS ${CURL_INCLUDE_DIR})
|
set(CURL_INCLUDE_DIRS ${CURL_INCLUDE_DIR})
|
||||||
|
|
||||||
if(NOT TARGET CURL::CURL)
|
if(NOT TARGET CURL::libcurl)
|
||||||
add_library(CURL::CURL UNKNOWN IMPORTED)
|
add_library(CURL::libcurl UNKNOWN IMPORTED)
|
||||||
set_target_properties(CURL::CURL PROPERTIES INTERFACE_INCLUDE_DIRECTORIES "${CURL_INCLUDE_DIRS}")
|
set_target_properties(CURL::libcurl PROPERTIES INTERFACE_INCLUDE_DIRECTORIES "${CURL_INCLUDE_DIRS}")
|
||||||
set_property(TARGET CURL::CURL APPEND PROPERTY IMPORTED_LOCATION "${CURL_LIBRARY}")
|
set_property(TARGET CURL::libcurl APPEND PROPERTY IMPORTED_LOCATION "${CURL_LIBRARY}")
|
||||||
endif()
|
endif()
|
||||||
endif()
|
endif()
|
||||||
|
|||||||
@@ -7,7 +7,7 @@ find_package(CURL REQUIRED)
|
|||||||
add_definitions(-DCMAKE_EXPECTED_CURL_VERSION="${CURL_VERSION_STRING}")
|
add_definitions(-DCMAKE_EXPECTED_CURL_VERSION="${CURL_VERSION_STRING}")
|
||||||
|
|
||||||
add_executable(test_tgt main.c)
|
add_executable(test_tgt main.c)
|
||||||
target_link_libraries(test_tgt CURL::CURL)
|
target_link_libraries(test_tgt CURL::libcurl)
|
||||||
add_test(NAME test_tgt COMMAND test_tgt)
|
add_test(NAME test_tgt COMMAND test_tgt)
|
||||||
|
|
||||||
add_executable(test_var main.c)
|
add_executable(test_var main.c)
|
||||||
|
|||||||
Reference in New Issue
Block a user