Skip to content

Commit

Permalink
Print result variables of FindZLIB module
Browse files Browse the repository at this point in the history
  • Loading branch information
jimmy-park committed Mar 5, 2024
1 parent 3b3ad02 commit 862bb37
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 1 deletion.
7 changes: 6 additions & 1 deletion .github/workflows/ci.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -60,6 +60,7 @@ jobs:
-DCMAKE_XCODE_ATTRIBUTE_CODE_SIGNING_ALLOWED=NO
-DCPM_SOURCE_CACHE="${{ env.cpm-path }}"
-DZLIB_SANITIZE=${{ matrix.sanitize }}
-DZLIB_VERBOSE=ON
- name: Build
run: cmake --build --preset ${{ matrix.preset }} --config ${{ matrix.config }}
Expand Down Expand Up @@ -99,6 +100,7 @@ jobs:
run: >
cmake --preset ${{ matrix.preset }}
-DCPM_SOURCE_CACHE=${{ env.cpm-path }}
-DZLIB_VERBOSE=ON
- name: Build
run: cmake --build --preset ${{ matrix.preset }} --config ${{ matrix.config }}
Expand Down Expand Up @@ -146,7 +148,8 @@ jobs:
-DCMAKE_INSTALL_PREFIX=${{ github.workspace }}/install \
-DCPM_SOURCE_CACHE=${{ env.cpm-path }} \
-DZLIB_INSTALL=ON \
-DZLIB_TEST=ON
-DZLIB_TEST=ON \
-DZLIB_VERBOSE=ON
cmake --build build
cd build
ctest -V -C ${{ matrix.config }}
Expand Down Expand Up @@ -188,6 +191,7 @@ jobs:
-DCPM_SOURCE_CACHE=${{ env.cpm-path }}
-DZLIB_INSTALL=ON
-DZLIB_TEST=ON
-DZLIB_VERBOSE=ON
- name: Build
run: cmake --build build
Expand Down Expand Up @@ -223,6 +227,7 @@ jobs:
-DCPM_SOURCE_CACHE=${{ env.cpm-path }}
-DZLIB_INSTALL=ON
-DZLIB_TEST=ON
-DZLIB_VERBOSE=ON
- name: Build
run: cmake --build build
Expand Down
8 changes: 8 additions & 0 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@ include(cmake/UseSanitizer.cmake)
# Custom options
option(ZLIB_INSTALL "Install zlib and CMake targets" OFF)
option(ZLIB_TEST "Enable testing and build tests" OFF)
option(ZLIB_VERBOSE "Print result variables of FindZLIB module" OFF)

if(DEFINED ZLIB_USE_STATIC_LIBS)
if(ZLIB_USE_STATIC_LIBS AND BUILD_SHARED_LIBS)
Expand Down Expand Up @@ -54,6 +55,13 @@ set(ZLIB_LIBRARIES "$<TARGET_LINKER_FILE:ZLIB::ZLIB>" CACHE STRING "Override Fin
set(ZLIB_FOUND ON CACHE BOOL "Override FindZLIB variables" FORCE)
set(ZLIB_VERSION ${PROJECT_VERSION} CACHE STRING "Override FindZLIB variables" FORCE)

if(ZLIB_VERBOSE)
message(STATUS "ZLIB_INCLUDE_DIRS : ${ZLIB_INCLUDE_DIRS}")
message(STATUS "ZLIB_LIBRARIES : ${ZLIB_LIBRARIES}")
message(STATUS "ZLIB_FOUND : ${ZLIB_FOUND}")
message(STATUS "ZLIB_VERSION : ${ZLIB_VERSION}")
endif()

# Legacy variables of FindZLIB module
set(ZLIB_VERSION_STRING ${ZLIB_VERSION} CACHE STRING "Override FindZLIB variables" FORCE)
set(VERSION_LEVEL MAJOR MINOR PATCH TWEAK)
Expand Down

0 comments on commit 862bb37

Please sign in to comment.