mirror of
https://git.libssh.org/projects/libssh.git
synced 2025-09-01 06:21:56 +03:00
Fixed ZLIB cmake module.
This commit is contained in:
@@ -6,7 +6,7 @@
|
|||||||
# ZLIB_LIBRARIES - Link these to use ZLIB
|
# ZLIB_LIBRARIES - Link these to use ZLIB
|
||||||
# ZLIB_DEFINITIONS - Compiler switches required for using ZLIB
|
# ZLIB_DEFINITIONS - Compiler switches required for using ZLIB
|
||||||
#
|
#
|
||||||
# Copyright (c) 2009 Andreas Schneider <mail@cynapses.org>
|
# Copyright (c) 2009-2010 Andreas Schneider <mail@cynapses.org>
|
||||||
#
|
#
|
||||||
# Redistribution and use is allowed according to the terms of the New
|
# Redistribution and use is allowed according to the terms of the New
|
||||||
# BSD license.
|
# BSD license.
|
||||||
@@ -27,8 +27,8 @@ else (ZLIB_LIBRARIES AND ZLIB_INCLUDE_DIRS)
|
|||||||
/usr/local/include
|
/usr/local/include
|
||||||
/opt/local/include
|
/opt/local/include
|
||||||
/sw/include
|
/sw/include
|
||||||
|
/usr/lib/sfw/include
|
||||||
)
|
)
|
||||||
mark_as_advanced(ZLIB_INCLUDE_DIR)
|
|
||||||
|
|
||||||
find_library(Z_LIBRARY
|
find_library(Z_LIBRARY
|
||||||
NAMES
|
NAMES
|
||||||
@@ -40,37 +40,23 @@ else (ZLIB_LIBRARIES AND ZLIB_INCLUDE_DIRS)
|
|||||||
/usr/local/lib
|
/usr/local/lib
|
||||||
/opt/local/lib
|
/opt/local/lib
|
||||||
/sw/lib
|
/sw/lib
|
||||||
|
/usr/sfw/lib/64
|
||||||
|
/usr/sfw/lib
|
||||||
)
|
)
|
||||||
mark_as_advanced(Z_LIBRARY)
|
|
||||||
|
|
||||||
if (Z_LIBRARY)
|
|
||||||
set(Z_FOUND TRUE)
|
|
||||||
endif (Z_LIBRARY)
|
|
||||||
|
|
||||||
set(ZLIB_INCLUDE_DIRS
|
set(ZLIB_INCLUDE_DIRS
|
||||||
${ZLIB_INCLUDE_DIR}
|
${ZLIB_INCLUDE_DIR}
|
||||||
)
|
)
|
||||||
|
|
||||||
if (Z_FOUND)
|
if (Z_LIBRARY)
|
||||||
set(ZLIB_LIBRARIES
|
set(ZLIB_LIBRARIES
|
||||||
${ZLIB_LIBRARIES}
|
${ZLIB_LIBRARIES}
|
||||||
${Z_LIBRARY}
|
${Z_LIBRARY}
|
||||||
)
|
)
|
||||||
endif (Z_FOUND)
|
endif (Z_LIBRARY)
|
||||||
|
|
||||||
if (ZLIB_INCLUDE_DIRS AND ZLIB_LIBRARIES)
|
include(FindPackageHandleStandardArgs)
|
||||||
set(ZLIB_FOUND TRUE)
|
find_package_handle_standard_args(ZLIB DEFAULT_MSG ZLIB_LIBRARIES ZLIB_INCLUDE_DIRS)
|
||||||
endif (ZLIB_INCLUDE_DIRS AND ZLIB_LIBRARIES)
|
|
||||||
|
|
||||||
if (ZLIB_FOUND)
|
|
||||||
if (NOT ZLIB_FIND_QUIETLY)
|
|
||||||
message(STATUS "Found ZLIB: ${ZLIB_LIBRARIES}")
|
|
||||||
endif (NOT ZLIB_FIND_QUIETLY)
|
|
||||||
else (ZLIB_FOUND)
|
|
||||||
if (ZLIB_FIND_REQUIRED)
|
|
||||||
message(FATAL_ERROR "Could not find ZLIB")
|
|
||||||
endif (ZLIB_FIND_REQUIRED)
|
|
||||||
endif (ZLIB_FOUND)
|
|
||||||
|
|
||||||
# show the ZLIB_INCLUDE_DIRS and ZLIB_LIBRARIES variables only in the advanced view
|
# show the ZLIB_INCLUDE_DIRS and ZLIB_LIBRARIES variables only in the advanced view
|
||||||
mark_as_advanced(ZLIB_INCLUDE_DIRS ZLIB_LIBRARIES)
|
mark_as_advanced(ZLIB_INCLUDE_DIRS ZLIB_LIBRARIES)
|
||||||
|
Reference in New Issue
Block a user