summaryrefslogtreecommitdiffstats
path: root/Utilities/cmcurl/lib
diff options
context:
space:
mode:
authorBrad King <brad.king@kitware.com>2023-09-22 14:57:40 (GMT)
committerBrad King <brad.king@kitware.com>2023-09-22 15:18:50 (GMT)
commite3572c110aa5c8aae8b5834a44ae71ccf9b4fd57 (patch)
tree57dd05acfa4be4163930d0de5f6d5991a9de3dd2 /Utilities/cmcurl/lib
parentc1f76e6c211e9e562328f1c0571e8877599f880e (diff)
downloadCMake-e3572c110aa5c8aae8b5834a44ae71ccf9b4fd57.zip
CMake-e3572c110aa5c8aae8b5834a44ae71ccf9b4fd57.tar.gz
CMake-e3572c110aa5c8aae8b5834a44ae71ccf9b4fd57.tar.bz2
curl: Set build options the way we need for CMake
Also restore commit a8d91e2719 (curl: Precompile common expensive headers, 2023-06-16) with new curl library target.
Diffstat (limited to 'Utilities/cmcurl/lib')
-rw-r--r--Utilities/cmcurl/lib/CMakeLists.txt14
1 files changed, 14 insertions, 0 deletions
diff --git a/Utilities/cmcurl/lib/CMakeLists.txt b/Utilities/cmcurl/lib/CMakeLists.txt
index 1569591..c4c6956 100644
--- a/Utilities/cmcurl/lib/CMakeLists.txt
+++ b/Utilities/cmcurl/lib/CMakeLists.txt
@@ -47,6 +47,17 @@ if(USE_ARES)
include_directories(${CARES_INCLUDE_DIR})
endif()
+#-----------------------------------------------------------------------------
+# CMake-specific curl code.
+unset(LIBCURL_OUTPUT_NAME CACHE)
+
+add_library(cmcurl ${HHEADERS} ${CSOURCES})
+target_compile_definitions(cmcurl INTERFACE CURL_STATICLIB)
+target_link_libraries(cmcurl PRIVATE ${CURL_LIBS})
+if(WIN32 AND CMake_BUILD_PCH)
+ target_precompile_headers(cmcurl PRIVATE "curl_setup.h" "curl_sspi.h" "${CURL_SOURCE_DIR}/include/curl/curl.h")
+endif()
+
# For windows we want to install OPENSSL_LIBRARIES dlls
# and also copy them into the build tree so that testing
# can find them.
@@ -71,6 +82,9 @@ if(CURL_USE_OPENSSL AND OPENSSL_FOUND AND WIN32)
endif()
endif()
+return() # The rest of this file is not needed for building within CMake.
+#-----------------------------------------------------------------------------
+
add_library(
curlu # special libcurlu library just for unittests
STATIC