summaryrefslogtreecommitdiff
path: root/CMakeLists.txt
diff options
context:
space:
mode:
authorVincent Torri <vincent.torri@gmail.com>2022-05-19 15:29:54 +0200
committerDaniel Stenberg <daniel@haxx.se>2022-05-19 15:29:55 +0200
commitee52bead4d1508165b39e5a23b6d7d16cd1ba00a (patch)
tree4db62a87408383532d996968fb182f8c10dc86d2 /CMakeLists.txt
parent9accb9a5be3cda1e63042bb31b99e0e0dc2bdd31 (diff)
downloadcurl-ee52bead4d1508165b39e5a23b6d7d16cd1ba00a.tar.gz
cmake: add libpsl support
Fixes #8865 Closes #8867
Diffstat (limited to 'CMakeLists.txt')
-rw-r--r--CMakeLists.txt25
1 files changed, 25 insertions, 0 deletions
diff --git a/CMakeLists.txt b/CMakeLists.txt
index 6957f619d..621ae19d8 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -742,6 +742,31 @@ if(CURL_ZSTD)
endif()
endif()
+#libpsl
+option(CURL_USE_LIBPSL "Use libPSL" ON)
+mark_as_advanced(CURL_USE_LIBPSL)
+set(USE_LIBPSL OFF)
+set(HAVE_LIBPSL OFF)
+set(HAVE_LIBSPSL_H OFF)
+
+if(CURL_USE_LIBPSL)
+ find_package(LibPSL)
+ if(LIBPSL_FOUND)
+ list(APPEND CURL_LIBS ${LIBPSL_LIBRARY})
+ set(CMAKE_REQUIRED_LIBRARIES ${LIBPSL_LIBRARY})
+ list(APPEND CMAKE_REQUIRED_INCLUDES "${LIBPSL_INCLUDE_DIR}")
+ include_directories("${LIBPSL_INCLUDE_DIR}")
+ set(HAVE_LIBPSL ON)
+ set(USE_LIBPSL ON)
+
+ # find_package has already found the headers
+ set(HAVE_LIBPSL_H ON)
+ set(CURL_INCLUDES ${CURL_INCLUDES} "${LIBPSL_INCLUDE_DIR}/libpsl.h")
+ set(CURL_TEST_DEFINES "${CURL_TEST_DEFINES} -DHAVE_LIBPSL_H")
+ unset(CMAKE_REQUIRED_LIBRARIES)
+ endif()
+endif()
+
#libSSH2
option(CURL_USE_LIBSSH2 "Use libSSH2" ON)
mark_as_advanced(CURL_USE_LIBSSH2)