@@ -156,43 +156,77 @@ endif()
156
156
157
157
include (CurlSymbolHiding )
158
158
159
- option (HTTP_ONLY "disables all protocols except HTTP (This overrides all CURL_DISABLE_* options)" OFF )
160
- mark_as_advanced (HTTP_ONLY )
161
- option (CURL_DISABLE_FTP "disables FTP" OFF )
162
- mark_as_advanced (CURL_DISABLE_FTP )
163
- option (CURL_DISABLE_LDAP "disables LDAP" OFF )
164
- mark_as_advanced (CURL_DISABLE_LDAP )
165
- option (CURL_DISABLE_TELNET "disables Telnet" OFF )
166
- mark_as_advanced (CURL_DISABLE_TELNET )
159
+ option (CURL_ENABLE_EXPORT_TARGET "to enable cmake export target" ON )
160
+ mark_as_advanced (CURL_ENABLE_EXPORT_TARGET )
161
+
162
+ option (CURL_DISABLE_ALTSVC "disables alt-svc support" OFF )
163
+ mark_as_advanced (CURL_DISABLE_ALTSVC )
164
+ option (CURL_DISABLE_COOKIES "disables cookies support" OFF )
165
+ mark_as_advanced (CURL_DISABLE_COOKIES )
166
+ option (CURL_DISABLE_CRYPTO_AUTH "disables cryptographic authentication" OFF )
167
+ mark_as_advanced (CURL_DISABLE_CRYPTO_AUTH )
167
168
option (CURL_DISABLE_DICT "disables DICT" OFF )
168
169
mark_as_advanced (CURL_DISABLE_DICT )
170
+ option (CURL_DISABLE_DOH "disables DNS-over-HTTPS" OFF )
171
+ mark_as_advanced (CURL_DISABLE_DOH )
169
172
option (CURL_DISABLE_FILE "disables FILE" OFF )
170
173
mark_as_advanced (CURL_DISABLE_FILE )
171
- option (CURL_DISABLE_TFTP "disables TFTP" OFF )
172
- mark_as_advanced (CURL_DISABLE_TFTP )
174
+ option (CURL_DISABLE_FTP "disables FTP" OFF )
175
+ mark_as_advanced (CURL_DISABLE_FTP )
176
+ option (CURL_DISABLE_GETOPTIONS "disables curl_easy_options API for existing options to curl_easy_setopt" OFF )
177
+ mark_as_advanced (CURL_DISABLE_GETOPTIONS )
178
+ option (CURL_DISABLE_GOPHER "disables Gopher" OFF )
179
+ mark_as_advanced (CURL_DISABLE_GOPHER )
180
+ option (CURL_DISABLE_HSTS "disables HSTS support" OFF )
181
+ mark_as_advanced (CURL_DISABLE_HSTS )
173
182
option (CURL_DISABLE_HTTP "disables HTTP" OFF )
174
183
mark_as_advanced (CURL_DISABLE_HTTP )
175
-
176
- option (CURL_DISABLE_LDAPS "to disable LDAPS" OFF )
184
+ option (CURL_DISABLE_HTTP_AUTH "disables all HTTP authentication methods" OFF )
185
+ mark_as_advanced (CURL_DISABLE_HTTP_AUTH )
186
+ option (CURL_DISABLE_IMAP "disables IMAP" OFF )
187
+ mark_as_advanced (CURL_DISABLE_IMAP )
188
+ option (CURL_DISABLE_LDAP "disables LDAP" OFF )
189
+ mark_as_advanced (CURL_DISABLE_LDAP )
190
+ option (CURL_DISABLE_LDAPS "disables LDAPS" OFF )
177
191
mark_as_advanced (CURL_DISABLE_LDAPS )
178
-
179
- option (CURL_DISABLE_RTSP "to disable RTSP" OFF )
180
- mark_as_advanced (CURL_DISABLE_RTSP )
181
- option (CURL_DISABLE_PROXY "to disable proxy" OFF )
182
- mark_as_advanced (CURL_DISABLE_PROXY )
183
- option (CURL_DISABLE_POP3 "to disable POP3" OFF )
192
+ option (CURL_DISABLE_LIBCURL_OPTION "disables --libcurl option from the curl tool" OFF )
193
+ mark_as_advanced (CURL_DISABLE_LIBCURL_OPTION )
194
+ option (CURL_DISABLE_MIME "disables MIME support" OFF )
195
+ mark_as_advanced (CURL_DISABLE_MIME )
196
+ option (CURL_DISABLE_MQTT "disables MQTT" OFF )
197
+ mark_as_advanced (CURL_DISABLE_MQTT )
198
+ option (CURL_DISABLE_NETRC "disables netrc parser" OFF )
199
+ mark_as_advanced (CURL_DISABLE_NETRC )
200
+ option (CURL_DISABLE_NTLM "disables NTLM support" OFF )
201
+ mark_as_advanced (CURL_DISABLE_NTLM )
202
+ option (CURL_DISABLE_PARSEDATE "disables date parsing" OFF )
203
+ mark_as_advanced (CURL_DISABLE_PARSEDATE )
204
+ option (CURL_DISABLE_POP3 "disables POP3" OFF )
184
205
mark_as_advanced (CURL_DISABLE_POP3 )
185
- option (CURL_DISABLE_IMAP "to disable IMAP" OFF )
186
- mark_as_advanced (CURL_DISABLE_IMAP )
187
- option (CURL_DISABLE_SMTP "to disable SMTP" OFF )
206
+ option (CURL_DISABLE_PROGRESS_METER "disables built-in progress meter" OFF )
207
+ mark_as_advanced (CURL_DISABLE_PROGRESS_METER )
208
+ option (CURL_DISABLE_PROXY "disables proxy support" OFF )
209
+ mark_as_advanced (CURL_DISABLE_PROXY )
210
+ option (CURL_DISABLE_RTSP "disables RTSP" OFF )
211
+ mark_as_advanced (CURL_DISABLE_RTSP )
212
+ option (CURL_DISABLE_SHUFFLE_DNS "disables shuffle DNS feature" OFF )
213
+ mark_as_advanced (CURL_DISABLE_SHUFFLE_DNS )
214
+ option (CURL_DISABLE_SMB "disables SMB" OFF )
215
+ mark_as_advanced (CURL_DISABLE_SMB )
216
+ option (CURL_DISABLE_SMTP "disables SMTP" OFF )
188
217
mark_as_advanced (CURL_DISABLE_SMTP )
189
- option (CURL_DISABLE_GOPHER "to disable Gopher" OFF )
190
- mark_as_advanced (CURL_DISABLE_GOPHER )
191
- option (CURL_DISABLE_MQTT "to disable MQTT" OFF )
192
- mark_as_advanced (CURL_DISABLE_MQTT )
218
+ option (CURL_DISABLE_SOCKETPAIR "disables use of socketpair for curl_multi_poll" OFF )
219
+ mark_as_advanced (CURL_DISABLE_SOCKETPAIR )
220
+ option (CURL_DISABLE_TELNET "disables Telnet" OFF )
221
+ mark_as_advanced (CURL_DISABLE_TELNET )
222
+ option (CURL_DISABLE_TFTP "disables TFTP" OFF )
223
+ mark_as_advanced (CURL_DISABLE_TFTP )
224
+ option (CURL_DISABLE_VERBOSE_STRINGS "disables verbose strings" OFF )
225
+ mark_as_advanced (CURL_DISABLE_VERBOSE_STRINGS )
193
226
194
- option (CURL_ENABLE_EXPORT_TARGET "to enable cmake export target" ON )
195
- mark_as_advanced (CURL_ENABLE_EXPORT_TARGET )
227
+ # Corresponds to HTTP_ONLY in lib/curl_setup.h
228
+ option (HTTP_ONLY "disables all protocols except HTTP (This overrides all CURL_DISABLE_* options)" OFF )
229
+ mark_as_advanced (HTTP_ONLY )
196
230
197
231
if (HTTP_ONLY )
198
232
set (CURL_DISABLE_DICT ON )
@@ -211,18 +245,6 @@ if(HTTP_ONLY)
211
245
set (CURL_DISABLE_TFTP ON )
212
246
endif ()
213
247
214
- option (CURL_DISABLE_ALTSVC "to disable alt-svc support" OFF )
215
- mark_as_advanced (CURL_DISABLE_ALTSVC )
216
- option (CURL_DISABLE_HSTS "to disable HSTS support" OFF )
217
- mark_as_advanced (CURL_DISABLE_HSTS )
218
- option (CURL_DISABLE_COOKIES "to disable cookies support" OFF )
219
- mark_as_advanced (CURL_DISABLE_COOKIES )
220
- option (CURL_DISABLE_CRYPTO_AUTH "to disable cryptographic authentication" OFF )
221
- mark_as_advanced (CURL_DISABLE_CRYPTO_AUTH )
222
- option (CURL_DISABLE_NTLM "to disable NTLM support" OFF )
223
- mark_as_advanced (CURL_DISABLE_NTLM )
224
- option (CURL_DISABLE_VERBOSE_STRINGS "to disable verbose strings" OFF )
225
- mark_as_advanced (CURL_DISABLE_VERBOSE_STRINGS )
226
248
option (ENABLE_IPV6 "Define if you want to enable IPv6 support" ON )
227
249
mark_as_advanced (ENABLE_IPV6 )
228
250
if (ENABLE_IPV6 AND NOT WIN32 )
@@ -237,6 +259,17 @@ if(ENABLE_IPV6 AND NOT WIN32)
237
259
set (ENABLE_IPV6 OFF
238
260
CACHE BOOL "Define if you want to enable IPv6 support" FORCE )
239
261
endif ()
262
+
263
+ if (CMAKE_SYSTEM_NAME STREQUAL "Darwin" AND NOT ENABLE_ARES )
264
+ set (use_core_foundation ON )
265
+
266
+ find_library (SYSTEMCONFIGURATION_FRAMEWORK "SystemConfiguration" )
267
+ if (NOT SYSTEMCONFIGURATION_FRAMEWORK )
268
+ message (FATAL_ERROR "SystemConfiguration framework not found" )
269
+ endif ()
270
+
271
+ list (APPEND CURL_LIBS "-framework SystemConfiguration" )
272
+ endif ()
240
273
endif ()
241
274
242
275
if (USE_MANUAL )
@@ -321,28 +354,30 @@ endif()
321
354
322
355
# check SSL libraries
323
356
# TODO support GnuTLS
357
+ option (CURL_ENABLE_SSL "Enable SSL support" ON )
324
358
if (CMAKE_USE_WINSSL )
325
359
message (FATAL_ERROR "The cmake option CMAKE_USE_WINSSL was renamed to CMAKE_USE_SCHANNEL." )
326
360
endif ()
327
361
328
362
if (APPLE )
329
- option (CMAKE_USE_SECTRANSP "enable Apple OS native SSL/TLS" OFF )
363
+ cmake_dependent_option (CMAKE_USE_SECTRANSP "enable Apple OS native SSL/TLS" OFF CURL_ENABLE_SSL OFF )
330
364
endif ()
331
365
if (WIN32 )
332
- option (CMAKE_USE_SCHANNEL "enable Windows native SSL/TLS" OFF )
366
+ cmake_dependent_option (CMAKE_USE_SCHANNEL "enable Windows native SSL/TLS" OFF CURL_ENABLE_SSL OFF )
333
367
cmake_dependent_option (CURL_WINDOWS_SSPI "Use windows libraries to allow NTLM authentication without openssl" ON
334
368
CMAKE_USE_SCHANNEL OFF )
335
369
endif ()
336
- option (CMAKE_USE_MBEDTLS "Enable mbedTLS for SSL/TLS" OFF )
337
- option (CMAKE_USE_BEARSSL "Enable BearSSL for SSL/TLS" OFF )
338
- option (CMAKE_USE_NSS "Enable NSS for SSL/TLS" OFF )
339
- option (CMAKE_USE_WOLFSSL "enable wolfSSL for SSL/TLS" OFF )
370
+ cmake_dependent_option (CMAKE_USE_MBEDTLS "Enable mbedTLS for SSL/TLS" OFF CURL_ENABLE_SSL OFF )
371
+ cmake_dependent_option (CMAKE_USE_BEARSSL "Enable BearSSL for SSL/TLS" OFF CURL_ENABLE_SSL OFF )
372
+ cmake_dependent_option (CMAKE_USE_NSS "Enable NSS for SSL/TLS" OFF CURL_ENABLE_SSL OFF )
373
+ cmake_dependent_option (CMAKE_USE_WOLFSSL "enable wolfSSL for SSL/TLS" OFF CURL_ENABLE_SSL OFF )
340
374
341
375
set (openssl_default ON )
342
- if (WIN32 OR CMAKE_USE_SECTRANSP OR CMAKE_USE_SCHANNEL OR CMAKE_USE_MBEDTLS OR CMAKE_USE_NSS OR CMAKE_USE_WOLFSSL )
343
- set (openssl_default OFF )
344
- endif ()
345
- option (CMAKE_USE_OPENSSL "Use OpenSSL code. Experimental" ${openssl_default} )
376
+ # halx99: patch me, always use openssl
377
+ # if(WIN32 OR CMAKE_USE_SECTRANSP OR CMAKE_USE_SCHANNEL OR CMAKE_USE_MBEDTLS OR CMAKE_USE_NSS OR CMAKE_USE_WOLFSSL)
378
+ # set(openssl_default OFF)
379
+ # endif()
380
+ cmake_dependent_option (CMAKE_USE_OPENSSL "Use OpenSSL code. Experimental" ${openssl_default} CURL_ENABLE_SSL OFF )
346
381
option (CURL_DISABLE_OPENSSL_AUTO_LOAD_CONFIG "Disable automatic loading of OpenSSL configuration" OFF )
347
382
348
383
count_true (enabled_ssl_options_count
@@ -372,33 +407,30 @@ if(CMAKE_USE_DARWINSSL)
372
407
message (FATAL_ERROR "The cmake option CMAKE_USE_DARWINSSL was renamed to CMAKE_USE_SECTRANSP." )
373
408
endif ()
374
409
375
- if (${CMAKE_SYSTEM_NAME} MATCHES "Darwin" )
376
- find_library (COREFOUNDATION_FRAMEWORK "CoreFoundation" )
377
- if (NOT COREFOUNDATION_FRAMEWORK )
378
- message (FATAL_ERROR "CoreFoundation framework not found" )
379
- endif ()
410
+ if (CMAKE_USE_SECTRANSP )
411
+ set (use_core_foundation ON )
380
412
381
- find_library (SYSTEMCONFIGURATION_FRAMEWORK "SystemConfiguration " )
382
- if (NOT SYSTEMCONFIGURATION_FRAMEWORK )
383
- message (FATAL_ERROR "SystemConfiguration framework not found" )
413
+ find_library (SECURITY_FRAMEWORK "Security " )
414
+ if (NOT SECURITY_FRAMEWORK )
415
+ message (FATAL_ERROR "Security framework not found" )
384
416
endif ()
385
417
386
- list (APPEND CURL_LIBS "-framework CoreFoundation" "-framework SystemConfiguration" )
387
-
388
- if (CMAKE_USE_SECTRANSP )
389
- find_library (SECURITY_FRAMEWORK "Security" )
390
- if (NOT SECURITY_FRAMEWORK )
391
- message (FATAL_ERROR "Security framework not found" )
392
- endif ()
418
+ set (SSL_ENABLED ON )
419
+ set (USE_SECTRANSP ON )
420
+ list (APPEND CURL_LIBS "-framework Security" )
421
+ endif ()
393
422
394
- set (SSL_ENABLED ON )
395
- set (USE_SECTRANSP ON )
396
- list (APPEND CURL_LIBS "-framework Security" )
423
+ if (use_core_foundation )
424
+ find_library (COREFOUNDATION_FRAMEWORK "CoreFoundation" )
425
+ if (NOT COREFOUNDATION_FRAMEWORK )
426
+ message (FATAL_ERROR "CoreFoundation framework not found" )
397
427
endif ()
428
+
429
+ list (APPEND CURL_LIBS "-framework CoreFoundation" )
398
430
endif ()
399
431
400
432
if (CMAKE_USE_OPENSSL )
401
- if (NOT OPENSSL_INCLUDE_DIR )
433
+ if (NOT OPENSSL_INCLUDE_DIR ) # halx99: patch me, use exist openssl, don't find system installed openssl
402
434
find_package (OpenSSL REQUIRED )
403
435
set (SSL_ENABLED ON )
404
436
set (USE_OPENSSL ON )
@@ -435,6 +467,8 @@ if(CMAKE_USE_OPENSSL)
435
467
check_symbol_exists (RAND_status "${CURL_INCLUDES} " HAVE_RAND_STATUS )
436
468
check_symbol_exists (RAND_screen "${CURL_INCLUDES} " HAVE_RAND_SCREEN )
437
469
check_symbol_exists (RAND_egd "${CURL_INCLUDES} " HAVE_RAND_EGD )
470
+
471
+ add_definitions (-DOPENSSL_SUPPRESS_DEPRECATED )
438
472
endif ()
439
473
440
474
if (CMAKE_USE_MBEDTLS )
@@ -898,7 +932,6 @@ endif()
898
932
# Check for header files
899
933
if (NOT UNIX )
900
934
check_include_file_concat ("windows.h" HAVE_WINDOWS_H )
901
- check_include_file_concat ("winsock.h" HAVE_WINSOCK_H )
902
935
check_include_file_concat ("ws2tcpip.h" HAVE_WS2TCPIP_H )
903
936
check_include_file_concat ("winsock2.h" HAVE_WINSOCK2_H )
904
937
check_include_file_concat ("wincrypt.h" HAVE_WINCRYPT_H )
@@ -1474,12 +1507,10 @@ set(libdir "${CMAKE_INSTALL_PREFIX}/lib")
1474
1507
foreach (_lib ${CMAKE_C_IMPLICIT_LINK_LIBRARIES} ${CURL_LIBS} )
1475
1508
if (TARGET "${_lib} " )
1476
1509
set (_libname "${_lib} " )
1477
- get_target_property (_libtype "${_libname} " TYPE )
1478
- if (_libtype STREQUAL INTERFACE_LIBRARY )
1479
- # Interface libraries can occur when an external project embeds curl and
1480
- # defined targets such as ZLIB::ZLIB by themselves. Ignore these as
1481
- # reading the LOCATION property will error out. Assume the user won't need
1482
- # this information in the .pc file.
1510
+ get_target_property (_imported "${_libname} " IMPORTED )
1511
+ if (NOT _imported )
1512
+ # Reading the LOCATION property on non-imported target will error out.
1513
+ # Assume the user won't need this information in the .pc file.
1483
1514
continue ()
1484
1515
endif ()
1485
1516
get_target_property (_lib "${_libname} " LOCATION )
0 commit comments