athena/extern/zlib/CMakeLists.txt

47 lines
1.1 KiB
CMake
Raw Normal View History

2021-04-12 19:56:41 +00:00
if (APPLE)
# use toolchain zlib
find_package(ZLIB REQUIRED)
set(ZLIB_LIBRARIES ZLIB::ZLIB)
else()
if(NOT WIN32 AND NOT NX) # remove WIN32 when specter/freetype is gone
2020-06-14 03:44:15 +00:00
find_library(ZLIB_LIB NAMES zlib z)
endif()
2020-06-13 21:18:23 +00:00
if(NOT ZLIB_LIB)
2015-11-17 20:37:08 +00:00
message(STATUS "Using Athena's built-in zlib")
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
zutil.h)
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)
endif()
set(ZLIB_LIBRARIES z CACHE PATH "Zlib libraries" FORCE)
set(ZLIB_INCLUDE_DIR ${CMAKE_CURRENT_SOURCE_DIR} CACHE PATH "Zlib include path" FORCE)
else()
2020-06-13 21:18:23 +00:00
set(ZLIB_LIBRARIES ${ZLIB_LIB} CACHE PATH "Zlib libraries" FORCE)
2021-04-12 19:56:41 +00:00
find_path(ZLIB_INCLUDE_DIR zlib.h PATHS "${PNG_LIB}/../../include")
message(STATUS "Using zlib at ${ZLIB_LIB}, include: ${ZLIB_INCLUDE_DIR}")
endif()
2021-04-12 19:56:41 +00:00
endif()