File tree 2 files changed +17
-3
lines changed
2 files changed +17
-3
lines changed Original file line number Diff line number Diff line change @@ -27,7 +27,13 @@ option(FOUNDATION_PATH_TO_LIBDISPATCH_SOURCE "Path to libdispatch source" "")
27
27
option (FOUNDATION_PATH_TO_LIBDISPATCH_BUILD "Path to libdispatch build" "" )
28
28
option (FOUNDATION_PATH_TO_XCTEST_BUILD "Path to XCTest build" "" )
29
29
30
- find_package (CURL REQUIRED)
30
+ find_package (CURL CONFIG)
31
+ if (CURL_FOUND)
32
+ include (CMakeExpandImportedTargets)
33
+ cmake_expand_imported_targets(CURL_LIBRARIES LIBRARIES CURL::libcurl)
34
+ else ()
35
+ find_package (CURL REQUIRED)
36
+ endif ()
31
37
find_package (ICU COMPONENTS uc i18n REQUIRED)
32
38
find_package (LibXml2 REQUIRED)
33
39
Original file line number Diff line number Diff line change @@ -454,7 +454,15 @@ if(NOT CMAKE_SYSTEM_NAME STREQUAL Darwin)
454
454
target_include_directories (CFXMLInterface
455
455
PRIVATE
456
456
${LIBXML2_INCLUDE_DIR} )
457
- find_package (CURL REQUIRED)
457
+ find_package (CURL CONFIG)
458
+ if (NOT CURL_FOUND)
459
+ find_package (CURL REQUIRED)
460
+ if (NOT TARGET CURL::libcurl)
461
+ add_library (CURL::libcurl UNKNOWN IMPORTED )
462
+ set_target_properties (CURL::libcurl PROPERTIES
463
+ IMPORTED_LOCATION ${CURL_LIBRARIES} )
464
+ endif ()
465
+ endif ()
458
466
target_include_directories (CFURLSessionInterface
459
467
PRIVATE
460
468
${CURL_INCLUDE_DIRS} )
@@ -606,7 +614,7 @@ if(NOT CMAKE_SYSTEM_NAME STREQUAL Darwin)
606
614
${LIBXML2_LIBRARIES} )
607
615
target_link_libraries (CFURLSessionInterface
608
616
PRIVATE
609
- ${CURL_LIBRARIES} )
617
+ CURL::libcurl )
610
618
endif ()
611
619
if (CMAKE_SYSTEM_NAME STREQUAL Android)
612
620
target_link_libraries (CoreFoundation
You can’t perform that action at this time.
0 commit comments