extern/zlib: Use find_library

This commit is contained in:
Luke Street 2020-06-13 17:18:23 -04:00
parent 1b8b7f6819
commit 0bc400b4d9
1 changed files with 5 additions and 3 deletions

View File

@ -1,5 +1,7 @@
find_package(ZLIB)
if(NOT ZLIB_FOUND)
if(NOT WIN32) # remove when specter/freetype is gone
find_library(ZLIB_LIB zlib)
endif()
if(NOT ZLIB_LIB)
message(STATUS "Using Athena's built-in zlib")
add_library(z
adler32.c
@ -31,6 +33,6 @@ 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()
set(ZLIB_LIBRARIES ${ZLIB_LIBRARIES} CACHE PATH "Zlib libraries" FORCE)
set(ZLIB_LIBRARIES ${ZLIB_LIB} CACHE PATH "Zlib libraries" FORCE)
find_path(ZLIB_INCLUDE_DIR zlib.h)
endif()