CMakeLists: Don't dump zlib's includes into the top-level directory

This commit is contained in:
Lioncash 2018-04-13 08:14:56 -04:00
parent b256f873ca
commit 2851c7e5ee
No known key found for this signature in database
GPG Key ID: 4E3C3CC1031BA9C7
2 changed files with 5 additions and 2 deletions

View File

@ -572,11 +572,9 @@ endif()
find_package(ZLIB)
if(ZLIB_FOUND)
message(STATUS "Using shared zlib")
include_directories(${ZLIB_INCLUDE_DIRS})
else()
message(STATUS "Shared zlib not found, falling back to the static library")
add_subdirectory(Externals/zlib)
include_directories(Externals/zlib)
endif()
if(NOT APPLE)

View File

@ -78,3 +78,8 @@ set(ZLIB_SRCS
add_library(z STATIC ${ZLIB_SRCS} ${ZLIB_DLL_SRCS} ${ZLIB_PUBLIC_HDRS} ${ZLIB_PRIVATE_HDRS})
add_library(ZLIB::ZLIB ALIAS z)
target_include_directories(z
PUBLIC
${CMAKE_CURRENT_SOURCE_DIR}
)