cmake: do not fail without libxml2

Avoid adding a LIBXML2_LIBRARIES-NOTFOUND to the libraries list when it
is not found. Likewise for OpenSSL.
This commit is contained in:
Peter Wu 2016-03-16 17:31:54 +01:00
parent f34971774b
commit 3a2a943fe9
2 changed files with 11 additions and 2 deletions

View File

@ -195,6 +195,9 @@ endif()
set(HAVE_OPENSSL ${OPENSSL_FOUND})
if(OPENSSL_FOUND)
set(OPENSSL_INCLUDE_DIRS ${OPENSSL_INCLUDE_DIR})
else()
set(OPENSSL_INCLUDE_DIRS "")
set(OPENSSL_LIBRARIES "")
endif()
# libev (for src)
set(HAVE_LIBEV ${LIBEV_FOUND})
@ -208,6 +211,12 @@ endif()
set(HAVE_JANSSON ${JANSSON_FOUND})
# libxml2 (for src/nghttp)
set(HAVE_LIBXML2 ${LIBXML2_FOUND})
if(LIBXML2_FOUND)
set(LIBXML2_INCLUDE_DIRS ${LIBXML2_INCLUDE_DIR})
else()
set(LIBXML2_INCLUDE_DIRS "")
set(LIBXML2_LIBRARIES "")
endif()
# jemalloc
set(HAVE_JEMALLOC ${JEMALLOC_FOUND})
# spdylay (for src/nghttpx and src/h2load)

View File

@ -16,7 +16,7 @@ include_directories(
${JEMALLOC_INCLUDE_DIRS}
${SPDYLAY_INCLUDE_DIRS}
${LIBXML2_INCLUDE_DIR}
${LIBXML2_INCLUDE_DIRS}
${LIBEV_INCLUDE_DIRS}
${OPENSSL_INCLUDE_DIRS}
${JANSSON_INCLUDE_DIRS}