From f3b7b662debf8cc1fa5665e5ff465fd1570f6aa5 Mon Sep 17 00:00:00 2001 From: peter23 Date: Thu, 12 Sep 2024 22:59:30 +0300 Subject: [PATCH 1/2] fix `'zconf.h' file not found` --- CMakeLists.txt | 1 + 1 file changed, 1 insertion(+) diff --git a/CMakeLists.txt b/CMakeLists.txt index f62c640..2f89323 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -129,6 +129,7 @@ if(UNIX OR MINGW) if(NOT ZLIB_FOUND) add_subdirectory(third_party/zlib) include_directories(SYSTEM third_party/zlib) + include_directories(${CMAKE_CURRENT_BINARY_DIR}/third_party/zlib) endif() else() if(BLOATY_ENABLE_RE2) From b539e0ad0955da5e76e207162951d047107ab85b Mon Sep 17 00:00:00 2001 From: peter23 Date: Fri, 13 Sep 2024 01:17:26 +0300 Subject: [PATCH 2/2] zlib headers are required to build example binaries in zlib, so path to the headers should be before add_subdirectory --- CMakeLists.txt | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index 2f89323..dd12377 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -127,8 +127,8 @@ if(UNIX OR MINGW) include_directories(SYSTEM third_party/protobuf/src) endif() if(NOT ZLIB_FOUND) - add_subdirectory(third_party/zlib) include_directories(SYSTEM third_party/zlib) + add_subdirectory(third_party/zlib) include_directories(${CMAKE_CURRENT_BINARY_DIR}/third_party/zlib) endif() else() @@ -150,8 +150,8 @@ else() add_subdirectory(third_party/protobuf/cmake) include_directories(SYSTEM third_party/protobuf/src) - add_subdirectory(third_party/zlib) include_directories(third_party/zlib) + add_subdirectory(third_party/zlib) include_directories(${CMAKE_CURRENT_BINARY_DIR}/third_party/zlib) set_property(TARGET example PROPERTY FOLDER "third_party") set_property(TARGET minigzip PROPERTY FOLDER "third_party")