2020-10-21 04:21:31 +00:00
|
|
|
if(NOT WIN32 AND NOT NX)
|
2015-07-08 20:21:50 +00:00
|
|
|
find_package(ZLIB)
|
2015-07-10 23:44:31 +00:00
|
|
|
endif()
|
|
|
|
if(WIN32 OR NOT ZLIB_FOUND)
|
2015-11-17 20:37:08 +00:00
|
|
|
message(STATUS "Using Athena's built-in zlib")
|
2015-07-08 20:21:50 +00:00
|
|
|
add_library(z
|
2015-07-07 03:23:37 +00:00
|
|
|
adler32.c
|
|
|
|
compress.c
|
|
|
|
crc32.c
|
|
|
|
deflate.c
|
|
|
|
infback.c
|
|
|
|
inffast.c
|
|
|
|
inflate.c
|
|
|
|
inftrees.c
|
|
|
|
trees.c
|
|
|
|
uncompr.c
|
|
|
|
zutil.c
|
|
|
|
crc32.h
|
|
|
|
deflate.h
|
|
|
|
gzguts.h
|
|
|
|
inffast.h
|
|
|
|
inffixed.h
|
|
|
|
inflate.h
|
|
|
|
inftrees.h
|
|
|
|
trees.h
|
|
|
|
zconf.h
|
|
|
|
zlib.h
|
2015-07-08 20:21:50 +00:00
|
|
|
zutil.h)
|
2015-07-10 23:44:31 +00:00
|
|
|
if(WIN32 AND NOT UNIX)
|
|
|
|
install(FILES zconf.h zlib.h DESTINATION include COMPONENT zlib)
|
|
|
|
install(TARGETS z DESTINATION lib COMPONENT zlib)
|
2020-10-21 04:21:31 +00:00
|
|
|
else()
|
|
|
|
target_compile_options(z PRIVATE -Wno-implicit-fallthrough)
|
2015-07-10 23:44:31 +00:00
|
|
|
endif()
|
2015-09-02 18:49:23 +00:00
|
|
|
set(ZLIB_LIBRARIES z CACHE PATH "Zlib libraries" FORCE)
|
2015-07-08 20:21:50 +00:00
|
|
|
set(ZLIB_INCLUDE_DIR ${CMAKE_CURRENT_SOURCE_DIR} CACHE PATH "Zlib include path" FORCE)
|
2015-09-02 18:49:23 +00:00
|
|
|
else()
|
|
|
|
set(ZLIB_LIBRARIES ${ZLIB_LIBRARIES} CACHE PATH "Zlib libraries" FORCE)
|
|
|
|
find_path(ZLIB_INCLUDE_DIR zlib.h)
|
2015-07-08 20:21:50 +00:00
|
|
|
endif()
|