Fix zlib INTERFACE usage

This commit is contained in:
Phillip Stephens 2021-11-23 21:46:52 -08:00
parent 066e3ae109
commit e13b498266
Signed by: Antidote
GPG Key ID: F8BEE4C83DACA60D
12 changed files with 15 additions and 13 deletions

View File

@ -23,24 +23,26 @@ else ()
trees.c trees.c
uncompr.c uncompr.c
zutil.c zutil.c
crc32.h include/crc32.h
deflate.h include/deflate.h
gzguts.h include/gzguts.h
inffast.h include/inffast.h
inffixed.h include/inffixed.h
inflate.h include/inflate.h
inftrees.h include/inftrees.h
trees.h include/trees.h
zconf.h include/zconf.h
zlib.h include/zlib.h
zutil.h) include/zutil.h)
if (WIN32 AND NOT UNIX) if (WIN32 AND NOT UNIX)
install(FILES zconf.h zlib.h DESTINATION include COMPONENT zlib) install(FILES include/zconf.h include/zlib.h DESTINATION include COMPONENT zlib)
install(TARGETS z DESTINATION lib COMPONENT zlib) install(TARGETS z DESTINATION lib COMPONENT zlib)
else () else ()
target_compile_options(z PRIVATE -Wno-implicit-fallthrough) target_compile_options(z PRIVATE -Wno-implicit-fallthrough)
endif () endif ()
target_include_directories(z INTERFACE ${CMAKE_CURRENT_SOURCE_DIR}) target_include_directories(z PUBLIC
$<BUILD_INTERFACE:${CMAKE_CURRENT_SOURCE_DIR}/include>
$<INSTALL_INTERFACE:include>)
set(ZLIB_LIBRARIES z CACHE STRING "zlib libraries" FORCE) set(ZLIB_LIBRARIES z CACHE STRING "zlib libraries" FORCE)
set(ATHENA_ZLIB YES CACHE BOOL "Using built-in zlib" FORCE) set(ATHENA_ZLIB YES CACHE BOOL "Using built-in zlib" FORCE)
endif () endif ()