aboutsummaryrefslogtreecommitdiff
path: root/ports/google-cloud-cpp/cmake-libcurl-target.patch
blob: 97e66e69f72f517e2b3826e9eb4a581d97bfd683 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
diff --git a/cmake/IncludeCurl.cmake b/cmake/IncludeCurl.cmake
index d3323e3b8..6ea7ca3e6 100644
--- a/cmake/IncludeCurl.cmake
+++ b/cmake/IncludeCurl.cmake
@@ -39,13 +39,13 @@ elseif("${GOOGLE_CLOUD_CPP_CURL_PROVIDER}" STREQUAL "package")
     # stage/module/FindCURL.html for details).  Until then, define the target
     # ourselves if it is missing.
     find_package(CURL REQUIRED)
-    if (NOT TARGET CURL::CURL)
-        add_library(CURL::CURL UNKNOWN IMPORTED)
-        set_property(TARGET CURL::CURL
+    if (NOT TARGET CURL::libcurl)
+        add_library(CURL::libcurl UNKNOWN IMPORTED)
+        set_property(TARGET CURL::libcurl
                      APPEND
                      PROPERTY INTERFACE_INCLUDE_DIRECTORIES
                               "${CURL_INCLUDE_DIR}")
-        set_property(TARGET CURL::CURL
+        set_property(TARGET CURL::libcurl
                      APPEND
                      PROPERTY IMPORTED_LOCATION "${CURL_LIBRARY}")
     endif ()
@@ -56,7 +56,7 @@ elseif("${GOOGLE_CLOUD_CPP_CURL_PROVIDER}" STREQUAL "package")
     if ("${CURL_LIBRARY}" MATCHES "${CMAKE_STATIC_LIBRARY_SUFFIX}$")
         find_package(OpenSSL REQUIRED)
         find_package(ZLIB REQUIRED)
-        set_property(TARGET CURL::CURL
+        set_property(TARGET CURL::libcurl
                      APPEND
                      PROPERTY INTERFACE_LINK_LIBRARIES
                               OpenSSL::SSL
@@ -64,7 +64,7 @@ elseif("${GOOGLE_CLOUD_CPP_CURL_PROVIDER}" STREQUAL "package")
                               ZLIB::ZLIB)
         message(STATUS "CURL linkage will be static")
         if (WIN32)
-            set_property(TARGET CURL::CURL
+            set_property(TARGET CURL::libcurl
                          APPEND
                          PROPERTY INTERFACE_LINK_LIBRARIES
                                   crypt32
@@ -72,7 +72,7 @@ elseif("${GOOGLE_CLOUD_CPP_CURL_PROVIDER}" STREQUAL "package")
                                   ws2_32)
         endif ()
         if (APPLE)
-            set_property(TARGET CURL::CURL
+            set_property(TARGET CURL::libcurl
                          APPEND
                          PROPERTY INTERFACE_LINK_LIBRARIES ldap)
         endif ()
diff --git a/cmake/external/curl.cmake b/cmake/external/curl.cmake
index 54753ada9..2a83e19df 100644
--- a/cmake/external/curl.cmake
+++ b/cmake/external/curl.cmake
@@ -88,10 +88,10 @@ if (NOT TARGET curl_project)
     endif ()
 
     include(ExternalProjectHelper)
-    add_library(CURL::CURL INTERFACE IMPORTED)
-    add_dependencies(CURL::CURL curl_project)
-    set_library_properties_for_external_project(CURL::CURL curl)
-    set_property(TARGET CURL::CURL
+    add_library(CURL::libcurl INTERFACE IMPORTED)
+    add_dependencies(CURL::libcurl curl_project)
+    set_library_properties_for_external_project(CURL::libcurl curl)
+    set_property(TARGET CURL::libcurl
                  APPEND
                  PROPERTY INTERFACE_LINK_LIBRARIES
                           c-ares::cares
@@ -99,7 +99,7 @@ if (NOT TARGET curl_project)
                           OpenSSL::Crypto
                           ZLIB::ZLIB)
     if (WIN32)
-        set_property(TARGET CURL::CURL
+        set_property(TARGET CURL::libcurl
                      APPEND
                      PROPERTY INTERFACE_LINK_LIBRARIES
                               crypt32
@@ -107,7 +107,7 @@ if (NOT TARGET curl_project)
                               ws2_32)
     endif ()
     if (APPLE)
-        set_property(TARGET CURL::CURL
+        set_property(TARGET CURL::libcurl
                      APPEND
                      PROPERTY INTERFACE_LINK_LIBRARIES ldap)
     endif ()
diff --git a/google/cloud/storage/CMakeLists.txt b/google/cloud/storage/CMakeLists.txt
index 1e750af8a..a0a04caab 100644
--- a/google/cloud/storage/CMakeLists.txt
+++ b/google/cloud/storage/CMakeLists.txt
@@ -226,7 +226,7 @@ target_link_libraries(storage_client
                       PUBLIC google_cloud_cpp_common
                              nlohmann_json
                              Crc32c::crc32c
-                             CURL::CURL
+                             CURL::libcurl
                              Threads::Threads
                              OpenSSL::SSL
                              OpenSSL::Crypto
@@ -396,7 +396,7 @@ if (BUILD_TESTING)
                                           GTest::gmock_main
                                           GTest::gmock
                                           GTest::gtest
-                                          CURL::CURL
+                                          CURL::libcurl
                                           storage_common_options
                                           nlohmann_json)
             if (MSVC)
diff --git a/google/cloud/storage/config.cmake.in b/google/cloud/storage/config.cmake.in
index 660829ae4..a4d261815 100644
--- a/google/cloud/storage/config.cmake.in
+++ b/google/cloud/storage/config.cmake.in
@@ -19,13 +19,13 @@ find_dependency(google_cloud_cpp_common)
 find_dependency(OpenSSL)
 find_dependency(ZLIB)
 
-# Some versions of FindCURL do not define CURL::CURL, so we define it ourselves.
-if (NOT TARGET CURL::CURL)
-    add_library(CURL::CURL UNKNOWN IMPORTED)
-    set_property(TARGET CURL::CURL
+# Some versions of FindCURL do not define CURL::libcurl, so we define it ourselves.
+if (NOT TARGET CURL::libcurl)
+    add_library(CURL::libcurl UNKNOWN IMPORTED)
+    set_property(TARGET CURL::libcurl
                  APPEND
                  PROPERTY INTERFACE_INCLUDE_DIRECTORIES "${CURL_INCLUDE_DIR}")
-    set_property(TARGET CURL::CURL
+    set_property(TARGET CURL::libcurl
                  APPEND
                  PROPERTY IMPORTED_LOCATION "${CURL_LIBRARY}")
 endif ()
diff --git a/google/cloud/storage/tests/CMakeLists.txt b/google/cloud/storage/tests/CMakeLists.txt
index 9e5fb663d..987958396 100644
--- a/google/cloud/storage/tests/CMakeLists.txt
+++ b/google/cloud/storage/tests/CMakeLists.txt
@@ -50,7 +50,7 @@ foreach (fname ${storage_client_integration_tests})
                                   GTest::gmock_main
                                   GTest::gmock
                                   GTest::gtest
-                                  CURL::CURL
+                                  CURL::libcurl
                                   Threads::Threads
                                   nlohmann_json
                                   storage_common_options)