Skip to content

Commit

Permalink
Quiet CPM messages
Browse files Browse the repository at this point in the history
  • Loading branch information
jimmy-park committed Oct 14, 2024
1 parent 6aff48b commit 964bf50
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 6 deletions.
8 changes: 7 additions & 1 deletion CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -31,13 +31,19 @@ if(DEFINED ZLIB_USE_STATIC_LIBS)
endif()

# Download zlib source
CPMAddPackage(
set(CPM_OPTIONS
NAME zlib-source
DOWNLOAD_ONLY ON
URL https://github.com/madler/zlib/archive/v${PROJECT_VERSION}.tar.gz
URL_HASH SHA256=17e88863f3600672ab49182f217281b6fc4d3c762bde361935e436a95214d05c
)

if(NOT ZLIB_VERBOSE)
list(APPEND CPM_OPTIONS QUIET)
endif()

CPMAddPackage(${CPM_OPTIONS})

# Modify zlib source
file(REMOVE ${zlib-source_SOURCE_DIR}/CMakeLists.txt)
file(READ ${zlib-source_SOURCE_DIR}/zutil.c ZUTIL)
Expand Down
11 changes: 6 additions & 5 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,10 +7,11 @@ Build [zlib](https://github.com/madler/zlib) using modern CMake and override the

## CMake Options

| Option | Default | Description |
| -------------- | ------- | ------------------------------ |
| `ZLIB_INSTALL` | `OFF` | Install zlib and CMake targets |
| `ZLIB_TEST` | `OFF` | Enable testing and build tests |
| Option | Default | Description |
| -------------- | ------- | ------------------------------------------- |
| `ZLIB_INSTALL` | `OFF` | Install zlib and CMake targets |
| `ZLIB_TEST` | `OFF` | Enable testing and build tests |
| `ZLIB_VERBOSE` | `OFF` | Print result variables of `FindZLIB` module |

- `CPM_SOURCE_CACHE`
- Set to `/path/to/cache` to reuse downloaded source code
Expand All @@ -37,7 +38,7 @@ set(ZLIB_TEST ON)
FetchContent_Declare(
zlib-cmake
URL https://github.com/jimmy-park/zlib-cmake/archive/main.zip
URL https://github.com/jimmy-park/zlib-cmake/archive/main.tar.gz
)
# This line must be preceded before find_package(ZLIB)
Expand Down

0 comments on commit 964bf50

Please sign in to comment.