diff options
author | Michael Hirsch <scivision@users.noreply.gitlab.kitware.com> | 2022-11-06 19:02:08 (GMT) |
---|---|---|
committer | Brad King <brad.king@kitware.com> | 2022-11-07 21:22:31 (GMT) |
commit | 9e3f1723ff931c07ca18e1d3256ba2063e7b4b86 (patch) | |
tree | 1e39a0ced87ef648c7c7abab1b0706a6c1d1a8eb /Modules/FindZLIB.cmake | |
parent | 890d44792307134b41274b52cd972e4944af7d36 (diff) | |
download | CMake-9e3f1723ff931c07ca18e1d3256ba2063e7b4b86.zip CMake-9e3f1723ff931c07ca18e1d3256ba2063e7b4b86.tar.gz CMake-9e3f1723ff931c07ca18e1d3256ba2063e7b4b86.tar.bz2 |
Find{BZip2,LibLZMA,ZLIB}: use *_VERSION as modern CMake
The old *_VERSION_STRING is silently left set for backward compat.
Diffstat (limited to 'Modules/FindZLIB.cmake')
-rw-r--r-- | Modules/FindZLIB.cmake | 66 |
1 files changed, 46 insertions, 20 deletions
diff --git a/Modules/FindZLIB.cmake b/Modules/FindZLIB.cmake index cfe6715..d0deb87 100644 --- a/Modules/FindZLIB.cmake +++ b/Modules/FindZLIB.cmake @@ -20,33 +20,57 @@ Result Variables This module defines the following variables: -:: +``ZLIB_INCLUDE_DIRS`` + where to find zlib.h, etc. +``ZLIB_LIBRARIES`` + List of libraries when using zlib. +``ZLIB_FOUND`` + True if zlib found. +``ZLIB_VERSION`` + .. versionadded:: 3.26 + the version of Zlib found. + + See also legacy variable ``ZLIB_VERSION_STRING``. - ZLIB_INCLUDE_DIRS - where to find zlib.h, etc. - ZLIB_LIBRARIES - List of libraries when using zlib. - ZLIB_FOUND - True if zlib found. +.. versionadded:: 3.4 + Debug and Release variants are found separately. -:: +Legacy Variables +^^^^^^^^^^^^^^^^ - ZLIB_VERSION_STRING - The version of zlib found (x.y.z) - ZLIB_VERSION_MAJOR - The major version of zlib - ZLIB_VERSION_MINOR - The minor version of zlib - ZLIB_VERSION_PATCH - The patch version of zlib - ZLIB_VERSION_TWEAK - The tweak version of zlib +The following variables are provided for backward compatibility: -.. versionadded:: 3.4 - Debug and Release variants are found separately. +``ZLIB_VERSION_MAJOR`` + The major version of zlib. + + .. versionchanged:: 3.26 + Superseded by ``ZLIB_VERSION``. +``ZLIB_VERSION_MINOR`` + The minor version of zlib. -Backward Compatibility -^^^^^^^^^^^^^^^^^^^^^^ + .. versionchanged:: 3.26 + Superseded by ``ZLIB_VERSION``. +``ZLIB_VERSION_PATCH`` + The patch version of zlib. -The following variable are provided for backward compatibility + .. versionchanged:: 3.26 + Superseded by ``ZLIB_VERSION``. +``ZLIB_VERSION_TWEAK`` + The tweak version of zlib. -:: + .. versionchanged:: 3.26 + Superseded by ``ZLIB_VERSION``. +``ZLIB_VERSION_STRING`` + The version of zlib found (x.y.z) - ZLIB_MAJOR_VERSION - The major version of zlib - ZLIB_MINOR_VERSION - The minor version of zlib - ZLIB_PATCH_VERSION - The patch version of zlib + .. versionchanged:: 3.26 + Superseded by ``ZLIB_VERSION``. +``ZLIB_MAJOR_VERSION`` + The major version of zlib. Superseded by ``ZLIB_VERSION_MAJOR``. +``ZLIB_MINOR_VERSION`` + The minor version of zlib. Superseded by ``ZLIB_VERSION_MINOR``. +``ZLIB_PATCH_VERSION`` + The patch version of zlib. Superseded by ``ZLIB_VERSION_PATCH``. Hints ^^^^^ @@ -168,11 +192,13 @@ if(ZLIB_INCLUDE_DIR AND EXISTS "${ZLIB_INCLUDE_DIR}/zlib.h") set(ZLIB_MAJOR_VERSION "${ZLIB_VERSION_MAJOR}") set(ZLIB_MINOR_VERSION "${ZLIB_VERSION_MINOR}") set(ZLIB_PATCH_VERSION "${ZLIB_VERSION_PATCH}") + + set(ZLIB_VERSION ${ZLIB_VERSION_STRING}) endif() include(${CMAKE_CURRENT_LIST_DIR}/FindPackageHandleStandardArgs.cmake) FIND_PACKAGE_HANDLE_STANDARD_ARGS(ZLIB REQUIRED_VARS ZLIB_LIBRARY ZLIB_INCLUDE_DIR - VERSION_VAR ZLIB_VERSION_STRING + VERSION_VAR ZLIB_VERSION HANDLE_COMPONENTS) if(ZLIB_FOUND) |