From 456fd43d8aefd634eca1a70f132d7c5f87f8956a Mon Sep 17 00:00:00 2001 From: Alexander Batalov Date: Sat, 28 May 2022 08:17:23 +0300 Subject: [PATCH] Reorganize zlib config --- CMakeLists.txt | 3 +++ third_party/zlib/CMakeLists.txt | 5 +++-- 2 files changed, 6 insertions(+), 2 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index 02d5f71..50698bd 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -247,4 +247,7 @@ target_link_libraries(fallout2-ce ${FPATTERN_LIBRARY}) target_include_directories(fallout2-ce PRIVATE ${FPATTERN_INCLUDE_DIR}) add_subdirectory("third_party/zlib") +target_link_libraries(fallout2-ce ${ZLIB_LIBRARIES}) +target_include_directories(fallout2-ce PRIVATE ${ZLIB_INCLUDE_DIRS}) + add_subdirectory("third_party/sdl2") diff --git a/third_party/zlib/CMakeLists.txt b/third_party/zlib/CMakeLists.txt index f7a8acf..9f17c85 100644 --- a/third_party/zlib/CMakeLists.txt +++ b/third_party/zlib/CMakeLists.txt @@ -11,5 +11,6 @@ if (NOT zlib_POPULATED) endif() add_subdirectory(${zlib_SOURCE_DIR} ${zlib_BINARY_DIR} EXCLUDE_FROM_ALL) -target_include_directories(fallout2-ce PUBLIC ${zlib_SOURCE_DIR} ${zlib_BINARY_DIR}) -target_link_libraries(fallout2-ce zlibstatic) + +set(ZLIB_LIBRARIES zlibstatic PARENT_SCOPE) +set(ZLIB_INCLUDE_DIRS ${zlib_SOURCE_DIR} ${zlib_BINARY_DIR} PARENT_SCOPE)