Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
28 changes: 13 additions & 15 deletions CMakeModules/FindZLIB.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -31,16 +31,16 @@ if (NOT (ZLIB_INCLUDE_DIR AND ZLIB_LIBRARY) OR NOT ZLIB_FOUND)
find_path(ZLIB_INCLUDE_DIR zlib.h zlib/zlib.h
PATHS $ENV{ZLIB_DIR}/include
$ENV{ZLIB_DIR}
${${_PROJECT_DEPENDENCY_DIR}}/include
${${_PROJECT_DEPENDENCY_DIR}}/include
~/Library/Frameworks
/Library/Frameworks
/sw/include # Fink
/opt/local/include # MacPorts
/opt/csw/include # Blastwave
/opt/include
/usr/freeware/include
CMAKE_FIND_ROOT_PATH_BOTH
NO_DEFAULT_PATH)
CMAKE_FIND_ROOT_PATH_BOTH
NO_DEFAULT_PATH)

if (NOT ZLIB_INCLUDE_DIR)
find_path(ZLIB_INCLUDE_DIR zlib.h zlib/zlib.h
Expand Down Expand Up @@ -84,21 +84,19 @@ if (NOT (ZLIB_INCLUDE_DIR AND ZLIB_LIBRARY) OR NOT ZLIB_FOUND)


# make sure that we have a valid zip library
if (ZLIB_CHECK_FOR_SYMBOLS)
file(TO_CMAKE_PATH "${ZLIB_LIBRARY}" LIBZ_CMAKE_PATH)
include (CheckLibraryExists)
include(CheckLibraryExists)
check_library_exists("${LIBZ_CMAKE_PATH}" "gzopen" "" LIBZ_FOUND_SYMBOL)
if(NOT LIBZ_FOUND_SYMBOL)
# this is odd, but on windows this check always fails! must be a
# bug in the current cmake version so for now only issue this
# warning on linux
if(UNIX)
message(WARNING
"The chosen zlib library does not appear to be valid because it is
missing certain required symbols. Please check that ${LIBZ_LIBRARY} is
the correct zlib library. For details about the error, please see
CMakeError.log or CMakeConfigureLog.yaml in the build directory.")
endif()

if(NOT LIBZ_FOUND_SYMBOL AND UNIX)
message(WARNING
"The chosen zlib library does not appear to be valid because it is
missing certain required symbols. Please check that ${ZLIB_LIBRARY} is
the correct zlib library. For details about the error, please see
CMakeError.log or CMakeConfigureLog.yaml in the build directory.")
endif()
endif() # Check for symbols

mark_as_advanced(ZLIB_INCLUDE_DIR ZLIB_LIBRARY)

Expand Down
Loading