summaryrefslogtreecommitdiff
path: root/Modules/FindBZip2.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/FindBZip2.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/FindBZip2.cmake')
-rw-r--r--Modules/FindBZip2.cmake21
1 files changed, 18 insertions, 3 deletions
diff --git a/Modules/FindBZip2.cmake b/Modules/FindBZip2.cmake
index 355c4bb96b..326e700c5b 100644
--- a/Modules/FindBZip2.cmake
+++ b/Modules/FindBZip2.cmake
@@ -29,8 +29,11 @@ This module defines the following variables:
Link these to use BZip2
``BZIP2_NEED_PREFIX``
this is set if the functions are prefixed with ``BZ2_``
-``BZIP2_VERSION_STRING``
- the version of BZip2 found
+``BZIP2_VERSION``
+ .. versionadded:: 3.26
+ the version of BZip2 found.
+
+ See also legacy variable ``BZIP2_VERSION_STRING``.
Cache variables
^^^^^^^^^^^^^^^
@@ -39,6 +42,17 @@ The following cache variables may also be set:
``BZIP2_INCLUDE_DIR``
the BZip2 include directory
+
+Legacy Variables
+^^^^^^^^^^^^^^^^
+
+The following variables are provided for backward compatibility:
+
+``BZIP2_VERSION_STRING``
+ the version of BZip2 found.
+
+ .. versionchanged:: 3.26
+ Superseded by ``BZIP2_VERSION``.
#]=======================================================================]
set(_BZIP2_PATHS PATHS
@@ -60,12 +74,13 @@ endif ()
if (BZIP2_INCLUDE_DIR AND EXISTS "${BZIP2_INCLUDE_DIR}/bzlib.h")
file(STRINGS "${BZIP2_INCLUDE_DIR}/bzlib.h" BZLIB_H REGEX "bzip2/libbzip2 version [0-9]+\\.[^ ]+ of [0-9]+ ")
string(REGEX REPLACE ".* bzip2/libbzip2 version ([0-9]+\\.[^ ]+) of [0-9]+ .*" "\\1" BZIP2_VERSION_STRING "${BZLIB_H}")
+ set(BZIP2_VERSION ${BZIP2_VERSION_STRING})
endif ()
include(${CMAKE_CURRENT_LIST_DIR}/FindPackageHandleStandardArgs.cmake)
FIND_PACKAGE_HANDLE_STANDARD_ARGS(BZip2
REQUIRED_VARS BZIP2_LIBRARIES BZIP2_INCLUDE_DIR
- VERSION_VAR BZIP2_VERSION_STRING)
+ VERSION_VAR BZIP2_VERSION)
if (BZIP2_FOUND)
set(BZIP2_INCLUDE_DIRS ${BZIP2_INCLUDE_DIR})