Commit b53671ae by Sascha Cunz

Search for zlib unconditional

Up to now, on windows we don't even bother to look if the user has a zlib
available somwhere.

In almost all larger commercial projects i've participated in, it was not
at all uncommon to have such a dependency somewhere in the source tree and
use it whereever required.
Searching for it, even if it's unlikely to be present, allows for such a
scenario (i.e. by prefilling the CMake-Cache).
parent 3d007f4f
......@@ -50,20 +50,22 @@ ELSE()
FILE(GLOB SRC_SHA1 src/hash/hash_generic.c)
ENDIF()
IF (NOT WIN32)
FIND_PACKAGE(ZLIB)
ENDIF()
# Include POSIX regex when it is required
IF(WIN32 OR CMAKE_SYSTEM_NAME STREQUAL "AmigaOS")
INCLUDE_DIRECTORIES(deps/regex)
SET(SRC_REGEX deps/regex/regex.c)
ENDIF()
# Optional external dependency: zlib
IF(NOT ZLIB_LIBRARY)
# It's optional, but FIND_PACKAGE gives a warning that looks more like an error.
FIND_PACKAGE(ZLIB QUIET)
ENDIF()
IF (ZLIB_FOUND)
INCLUDE_DIRECTORIES(${ZLIB_INCLUDE_DIRS})
LINK_LIBRARIES(${ZLIB_LIBRARIES})
ELSE (ZLIB_FOUND)
ELSE()
MESSAGE( "zlib was not found; using bundled 3rd-party sources." )
INCLUDE_DIRECTORIES(deps/zlib)
ADD_DEFINITIONS(-DNO_VIZ -DSTDC -DNO_GZIP)
FILE(GLOB SRC_ZLIB deps/zlib/*.c)
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment