Debian Codegraph @

cmake/FindZLIBNG.cmake

raw
1 find_path(ZLIBNG_INCLUDE_DIRS NAMES zlib-ng.h)
2
3 if(ZLIB_INCLUDE_DIRS)
4 set(ZLIBNG_LIBRARY_DIRS ${ZLIBNG_INCLUDE_DIRS})
5
6 if("${ZLIBNG_LIBRARY_DIRS}" MATCHES "/include$")
7 # Strip off the trailing "/include" in the path.
8 get_filename_component(ZLIBNG_LIBRARY_DIRS ${ZLIBNG_LIBRARY_DIRS} PATH)
9 endif()
10
11 if(EXISTS "${ZLIBNG_LIBRARY_DIRS}/lib")
12 set(ZLIBNG_LIBRARY_DIRS ${ZLIBNG_LIBRARY_DIRS}/lib)
13 endif()
14 endif()
15
16 find_library(ZLIBNG_LIBRARY NAMES z-ng libz-ng libz-ng.a)
17
18 set(ZLIBNG_LIBRARIES ${ZLIBNG_LIBRARY})
19 set(ZLIBNG_INCLUDE_DIRS ${ZLIBNG_INCLUDE_DIRS})
20
21 include(FindPackageHandleStandardArgs)
22 find_package_handle_standard_args(ZLIBNG DEFAULT_MSG ZLIBNG_LIBRARY ZLIBNG_INCLUDE_DIRS)
23
24 if(ZLIBNG_INCLUDE_DIRS AND ZLIBNG_LIBRARIES)
25 set(ZLIBNG_FOUND ON)
26 else(ZLIBNG_INCLUDE_DIRS AND ZLIBNG_LIBRARIES)
27 set(ZLIBNG_FOUND OFF)
28 endif()
29
30 if(ZLIBNG_FOUND)
31 message(STATUS "Found zlib-ng: ${ZLIBNG_LIBRARIES}, ${ZLIBNG_INCLUDE_DIRS}")
32 endif()