]> git.ipfire.org Git - thirdparty/curl.git/commitdiff
cmake: add nghttp2 support
authorRemo E <remo.eichenberger@gmail.com>
Thu, 21 Jul 2016 09:28:54 +0000 (11:28 +0200)
committerDaniel Stenberg <daniel@haxx.se>
Mon, 10 Oct 2016 17:47:31 +0000 (19:47 +0200)
Closes #922

CMake/FindNGHTTP2.cmake [new file with mode: 0644]
CMakeLists.txt
lib/curl_config.h.cmake

diff --git a/CMake/FindNGHTTP2.cmake b/CMake/FindNGHTTP2.cmake
new file mode 100644 (file)
index 0000000..4e566cf
--- /dev/null
@@ -0,0 +1,18 @@
+include(FindPackageHandleStandardArgs)
+
+find_path(NGHTTP2_INCLUDE_DIR "nghttp2/nghttp2.h")
+
+find_library(NGHTTP2_LIBRARY NAMES nghttp2)
+
+find_package_handle_standard_args(NGHTTP2
+    FOUND_VAR
+      NGHTTP2_FOUND
+    REQUIRED_VARS
+      NGHTTP2_LIBRARY
+      NGHTTP2_INCLUDE_DIR
+    FAIL_MESSAGE
+      "Could NOT find NGHTTP2"
+)
+
+set(NGHTTP2_INCLUDE_DIRS ${NGHTTP2_INCLUDE_DIR} )
+set(NGHTTP2_LIBRARIES ${NGHTTP2_LIBRARY})
index 7da33331b935a6e120d7576d992a1ab456b597b7..6d19cb7aacc8cc22d9a9d48b97c42ba884c3fc1d 100644 (file)
@@ -332,6 +332,13 @@ if(CMAKE_USE_OPENSSL)
   endif()
 endif()
 
+option(USE_NGHTTP2 "Use Nghttp2 library" OFF)
+if(USE_NGHTTP2)
+  find_package(NGHTTP2 REQUIRED)
+  include_directories(${NGHTTP2_INCLUDE_DIRS})
+  list(APPEND CURL_LIBS ${NGHTTP2_LIBRARIES})
+endif()
+
 if(NOT CURL_DISABLE_LDAP)
   if(WIN32)
     option(USE_WIN32_LDAP "Use Windows LDAP implementation" ON)
index ddcd210de9ac643c7dcd8e077a71fbfb753def52..33c15cb6fd389f2a46f55151d4c14506406138fa 100644 (file)
 /* if OpenSSL is in use */
 #cmakedefine USE_OPENSSL 1
 
+/* to enable NGHTTP2  */
+#cmakedefine USE_NGHTTP2 1
+
 /* if Unix domain sockets are enabled  */
 #cmakedefine USE_UNIX_SOCKETS