From: Nathan Moinvaziri Date: Mon, 24 Apr 2023 16:04:24 +0000 (-0700) Subject: Use ZLIB_INCLUDE_DIRS from FindZLIB instead of ZLIB_INCLUDE_DIR. X-Git-Tag: 2.1.0-beta1~4 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=3f06cece6be2e1bfe7b60d17e5ef823535ec9d0c;p=thirdparty%2Fzlib-ng.git Use ZLIB_INCLUDE_DIRS from FindZLIB instead of ZLIB_INCLUDE_DIR. ZLIB_INCLUDE_DIRS is set by FindZLIB if ZLIB_INCLUDE_DIR is set on the command line. --- diff --git a/test/CMakeLists.txt b/test/CMakeLists.txt index 007509a21..d434ec308 100644 --- a/test/CMakeLists.txt +++ b/test/CMakeLists.txt @@ -210,7 +210,7 @@ if(WITH_GTEST) -fsanitize-memory-track-origins) endif() - if(NOT ZLIB_COMPAT AND DEFINED ZLIB_LIBRARIES AND DEFINED ZLIB_INCLUDE_DIR) + if(NOT ZLIB_COMPAT AND DEFINED ZLIB_LIBRARIES AND DEFINED ZLIB_INCLUDE_DIRS) if(NOT IS_ABSOLUTE ${ZLIB_LIBRARIES}) get_filename_component(ZLIB_ABSOLUTE_PATH "${CMAKE_CURRENT_SOURCE_DIR}/${ZLIB_LIBRARIES}" @@ -222,11 +222,11 @@ if(WITH_GTEST) add_library(external_zlib STATIC IMPORTED) set_property(TARGET external_zlib PROPERTY IMPORTED_LOCATION ${ZLIB_ABSOLUTE_PATH}) message(STATUS "Added dual linking tests against zlib") - message(STATUS " Zlib include dir: ${ZLIB_INCLUDE_DIR}") + message(STATUS " Zlib include dirs: ${ZLIB_INCLUDE_DIRS}") message(STATUS " Zlib libraries: ${ZLIB_ABSOLUTE_PATH}") target_sources(gtest_zlib PRIVATE test_compress_dual.cc) - target_include_directories(gtest_zlib PRIVATE ${ZLIB_INCLUDE_DIR}) + target_include_directories(gtest_zlib PRIVATE ${ZLIB_INCLUDE_DIRS}) target_link_libraries(gtest_zlib external_zlib) endif()