cmake: check for ZLIB_INCLUDE_DIR, since we can have only library without headers

This commit is contained in:
Azat Khuzhin 2016-08-09 10:56:34 +03:00
parent 671a24f29b
commit c4dfb93ff2

View File

@ -702,7 +702,7 @@ if (NOT EVENT__DISABLE_TESTS)
# Zlib is only used for testing.
find_package(ZLIB)
if (ZLIB_LIBRARY)
if (ZLIB_LIBRARY AND ZLIB_INCLUDE_DIR)
include_directories(${ZLIB_INCLUDE_DIRS})
set(EVENT__HAVE_ZLIB 1)
@ -982,7 +982,7 @@ if (NOT EVENT__DISABLE_TESTS)
list(APPEND SRC_REGRESS test/regress_thread.c)
endif()
if (ZLIB_LIBRARY)
if (ZLIB_LIBRARY AND ZLIB_INCLUDE_DIR)
list(APPEND SRC_REGRESS test/regress_zlib.c)
endif()