NGHTTP2.cmake 1.1 KB

1234567891011121314151617181920212223242526272829303132
  1. # -*- cmake -*-
  2. if (NGHTTP2_CMAKE_INCLUDED)
  3. return()
  4. endif (NGHTTP2_CMAKE_INCLUDED)
  5. set (NGHTTP2_CMAKE_INCLUDED TRUE)
  6. if (NOT CURL_CMAKE_INCLUDED)
  7. message(FATAL_ERROR "NGHTTP2.cmake must not be included manually: use include(CURL) instead !")
  8. endif (NOT CURL_CMAKE_INCLUDED)
  9. # Note: OPENSSL_FOUND can be used here because this file is only included from
  10. # CURL.cmake and the latter got include(OpenSSL). When the OpenSSL version
  11. # present on the system does not match the ones we support (v1.0 or v1.1),
  12. # OPENSSL_FOUND is set to OFF by OpenSSL.cmake, and our custom OpenSSL is then
  13. # used, which mandates using our custom nghttp2 as well !
  14. if (USESYSTEMLIBS AND OPENSSL_FOUND)
  15. set(NGHTTP2_FIND_QUIETLY ON)
  16. set(NGHTTP2_FIND_REQUIRED ON)
  17. include(FindNGHTTP2)
  18. else (USESYSTEMLIBS AND OPENSSL_FOUND)
  19. use_prebuilt_binary(nghttp2)
  20. if (WINDOWS)
  21. set(NGHTTP2_LIBRARIES nghttp2.lib)
  22. elseif (DARWIN)
  23. set(NGHTTP2_LIBRARIES libnghttp2.dylib)
  24. elseif (LINUX)
  25. set(NGHTTP2_LIBRARIES libnghttp2.a)
  26. endif (WINDOWS)
  27. set(NGHTTP2_INCLUDE_DIR ${LIBS_PREBUILT_DIR}/include/nghttp2)
  28. endif (USESYSTEMLIBS AND OPENSSL_FOUND)
  29. include_directories(SYSTEM ${NGHTTP2_INCLUDE_DIR})