mirror of
https://git.proxmox.com/git/libgit2
synced 2025-05-06 06:51:09 +00:00
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).
This commit is contained in:
parent
3d007f4f9c
commit
b53671ae85
@ -50,20 +50,22 @@ ELSE()
|
|||||||
FILE(GLOB SRC_SHA1 src/hash/hash_generic.c)
|
FILE(GLOB SRC_SHA1 src/hash/hash_generic.c)
|
||||||
ENDIF()
|
ENDIF()
|
||||||
|
|
||||||
IF (NOT WIN32)
|
|
||||||
FIND_PACKAGE(ZLIB)
|
|
||||||
ENDIF()
|
|
||||||
|
|
||||||
# Include POSIX regex when it is required
|
# Include POSIX regex when it is required
|
||||||
IF(WIN32 OR CMAKE_SYSTEM_NAME STREQUAL "AmigaOS")
|
IF(WIN32 OR CMAKE_SYSTEM_NAME STREQUAL "AmigaOS")
|
||||||
INCLUDE_DIRECTORIES(deps/regex)
|
INCLUDE_DIRECTORIES(deps/regex)
|
||||||
SET(SRC_REGEX deps/regex/regex.c)
|
SET(SRC_REGEX deps/regex/regex.c)
|
||||||
ENDIF()
|
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)
|
IF (ZLIB_FOUND)
|
||||||
INCLUDE_DIRECTORIES(${ZLIB_INCLUDE_DIRS})
|
INCLUDE_DIRECTORIES(${ZLIB_INCLUDE_DIRS})
|
||||||
LINK_LIBRARIES(${ZLIB_LIBRARIES})
|
LINK_LIBRARIES(${ZLIB_LIBRARIES})
|
||||||
ELSE (ZLIB_FOUND)
|
ELSE()
|
||||||
|
MESSAGE( "zlib was not found; using bundled 3rd-party sources." )
|
||||||
INCLUDE_DIRECTORIES(deps/zlib)
|
INCLUDE_DIRECTORIES(deps/zlib)
|
||||||
ADD_DEFINITIONS(-DNO_VIZ -DSTDC -DNO_GZIP)
|
ADD_DEFINITIONS(-DNO_VIZ -DSTDC -DNO_GZIP)
|
||||||
FILE(GLOB SRC_ZLIB deps/zlib/*.c)
|
FILE(GLOB SRC_ZLIB deps/zlib/*.c)
|
||||||
|
Loading…
Reference in New Issue
Block a user