summaryrefslogtreecommitdiffstats
path: root/Source
diff options
context:
space:
mode:
authorAlex Turbov <i.zaufi@gmail.com>2022-08-21 05:21:01 (GMT)
committerBrad King <brad.king@kitware.com>2022-09-22 14:21:38 (GMT)
commitac76c53d33e16a159d3152105e6f99f241769691 (patch)
tree0432130cf129fd06439acc4349579972513bb8e9 /Source
parent1f5d9c5299bb7add5a7afcc1d054fd4259c04b89 (diff)
downloadCMake-ac76c53d33e16a159d3152105e6f99f241769691.zip
CMake-ac76c53d33e16a159d3152105e6f99f241769691.tar.gz
CMake-ac76c53d33e16a159d3152105e6f99f241769691.tar.bz2
Build: Use imported target `CURL::libcurl` instead of variables
Diffstat (limited to 'Source')
-rw-r--r--Source/CMakeLists.txt5
-rw-r--r--Source/Modules/CMakeBuildUtilities.cmake5
2 files changed, 3 insertions, 7 deletions
diff --git a/Source/CMakeLists.txt b/Source/CMakeLists.txt
index b1d8cb7..c8465a5 100644
--- a/Source/CMakeLists.txt
+++ b/Source/CMakeLists.txt
@@ -750,10 +750,10 @@ target_link_libraries(
PUBLIC
cmstd
cmsys
+ CURL::libcurl
EXPAT::EXPAT
LibArchive::LibArchive
ZLIB::ZLIB
- ${CMAKE_CURL_LIBRARIES}
${CMAKE_JSONCPP_LIBRARIES}
${CMAKE_LIBUV_LIBRARIES}
${CMAKE_LIBRHASH_LIBRARIES}
@@ -1002,9 +1002,8 @@ target_include_directories(
CTestLib
PUBLIC
"${CMake_SOURCE_DIR}/Source/CTest"
- ${CMAKE_CURL_INCLUDES}
)
-target_link_libraries(CTestLib PUBLIC CMakeLib ${CMAKE_CURL_LIBRARIES})
+target_link_libraries(CTestLib PUBLIC CMakeLib)
#
# Build CPackLib
diff --git a/Source/Modules/CMakeBuildUtilities.cmake b/Source/Modules/CMakeBuildUtilities.cmake
index 157367f..51811d6 100644
--- a/Source/Modules/CMakeBuildUtilities.cmake
+++ b/Source/Modules/CMakeBuildUtilities.cmake
@@ -148,11 +148,7 @@ if(CMAKE_USE_SYSTEM_CURL)
message(FATAL_ERROR
"CMAKE_USE_SYSTEM_CURL is ON but a curl is not found!")
endif()
- set(CMAKE_CURL_INCLUDES ${CURL_INCLUDE_DIRS})
- set(CMAKE_CURL_LIBRARIES ${CURL_LIBRARIES})
else()
- set(CMAKE_CURL_INCLUDES)
- set(CMAKE_CURL_LIBRARIES cmcurl)
if(CMAKE_TESTS_CDASH_SERVER)
set(CMAKE_CURL_TEST_URL "${CMAKE_TESTS_CDASH_SERVER}/user.php")
endif()
@@ -174,6 +170,7 @@ else()
set(NGHTTP2_INCLUDE_DIR ${CMAKE_CURRENT_SOURCE_DIR}/Utilities/cmnghttp2/lib/includes)
endif()
add_subdirectory(Utilities/cmcurl)
+ add_library(CURL::libcurl ALIAS cmcurl)
CMAKE_SET_TARGET_FOLDER(cmcurl "Utilities/3rdParty")
CMAKE_SET_TARGET_FOLDER(LIBCURL "Utilities/3rdParty")
if(NOT CMAKE_USE_SYSTEM_NGHTTP2)