summaryrefslogtreecommitdiff
path: root/Modules/FindZLIB.cmake
diff options
context:
space:
mode:
authorMichael Hirsch <scivision@users.noreply.gitlab.kitware.com>2022-11-06 14:02:08 -0500
committerBrad King <brad.king@kitware.com>2022-11-07 16:22:31 -0500
commit9e3f1723ff931c07ca18e1d3256ba2063e7b4b86 (patch)
tree1e39a0ced87ef648c7c7abab1b0706a6c1d1a8eb /Modules/FindZLIB.cmake
parent890d44792307134b41274b52cd972e4944af7d36 (diff)
downloadcmake-9e3f1723ff931c07ca18e1d3256ba2063e7b4b86.tar.gz
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.cmake66
1 files changed, 46 insertions, 20 deletions
diff --git a/Modules/FindZLIB.cmake b/Modules/FindZLIB.cmake
index cfe67158f1..d0deb8778d 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)