mirror of
https://gitlab.kitware.com/cmake/cmake.git
synced 2026-09-29 04:09:35 +03:00
FindLibXslt: Add LibXslt_VERSION
This deprecates the LIBXSLT_VERSION_STRING result variable. Issue: #27088
This commit is contained in:
@@ -19,6 +19,9 @@ Find Modules
|
||||
* The :module:`FindLibXml2` module now provides a ``LibXml2_VERSION`` result
|
||||
variable. The ``LIBXML2_VERSION_STRING`` result variable is deprecated.
|
||||
|
||||
* The :module:`FindLibXslt` module now provides a ``LibXslt_VERSION`` result
|
||||
variable. The ``LIBXSLT_VERSION_STRING`` result variable is deprecated.
|
||||
|
||||
* The :module:`FindPostgreSQL` module now provides a ``PostgreSQL_VERSION``
|
||||
result variable. The ``PostgreSQL_VERSION_STRING`` result variable is
|
||||
deprecated.
|
||||
|
||||
@@ -6,7 +6,11 @@ FindLibXslt
|
||||
-----------
|
||||
|
||||
Finds the XSL Transformations, Extensible Stylesheet Language Transformations
|
||||
(XSLT) library (libxslt).
|
||||
(XSLT) library (libxslt):
|
||||
|
||||
.. code-block:: cmake
|
||||
|
||||
find_package(LibXslt [<version>] [...])
|
||||
|
||||
Imported Targets
|
||||
^^^^^^^^^^^^^^^^
|
||||
@@ -36,8 +40,14 @@ Result Variables
|
||||
This module sets the following variables:
|
||||
|
||||
``LibXslt_FOUND``
|
||||
Boolean indicating whether the libxslt is found. For backward compatibility,
|
||||
the ``LIBXSLT_FOUND`` variable is also set to the same value.
|
||||
Boolean indicating whether (the requested version of) libxslt is found.
|
||||
For backward compatibility, the ``LIBXSLT_FOUND`` variable is also set to
|
||||
the same value.
|
||||
|
||||
``LibXslt_VERSION``
|
||||
.. versionadded:: 4.2
|
||||
|
||||
The version of libxslt found.
|
||||
|
||||
``LIBXSLT_LIBRARIES``
|
||||
Libraries needed to link to libxslt.
|
||||
@@ -45,9 +55,6 @@ This module sets the following variables:
|
||||
``LIBXSLT_DEFINITIONS``
|
||||
Compiler switches required for using libxslt.
|
||||
|
||||
``LIBXSLT_VERSION_STRING``
|
||||
Version of libxslt found.
|
||||
|
||||
``LIBXSLT_EXSLT_LIBRARIES``
|
||||
Libraries needed when linking against the exslt library. These are available
|
||||
and needed only when using exslt library.
|
||||
@@ -70,6 +77,17 @@ The following cache variables may also be set:
|
||||
Full path to the XSLT processor executable ``xsltproc`` if found. This path
|
||||
is optional.
|
||||
|
||||
Deprecated Variables
|
||||
^^^^^^^^^^^^^^^^^^^^
|
||||
|
||||
The following variables are provided for backward compatibility:
|
||||
|
||||
``LIBXSLT_VERSION_STRING``
|
||||
.. deprecated:: 4.2
|
||||
Superseded by the ``LibXslt_VERSION``.
|
||||
|
||||
The version of libxslt found.
|
||||
|
||||
Examples
|
||||
^^^^^^^^
|
||||
|
||||
@@ -159,20 +177,22 @@ set(LIBXSLT_EXSLT_LIBRARIES ${LIBXSLT_EXSLT_LIBRARY} )
|
||||
find_program(LIBXSLT_XSLTPROC_EXECUTABLE xsltproc)
|
||||
|
||||
if(PC_LIBXSLT_VERSION)
|
||||
set(LIBXSLT_VERSION_STRING ${PC_LIBXSLT_VERSION})
|
||||
set(LibXslt_VERSION ${PC_LIBXSLT_VERSION})
|
||||
set(LIBXSLT_VERSION_STRING "${LibXslt_VERSION}")
|
||||
elseif(LIBXSLT_INCLUDE_DIR AND EXISTS "${LIBXSLT_INCLUDE_DIR}/libxslt/xsltconfig.h")
|
||||
file(STRINGS "${LIBXSLT_INCLUDE_DIR}/libxslt/xsltconfig.h" libxslt_version_str
|
||||
REGEX "^#define[\t ]+LIBXSLT_DOTTED_VERSION[\t ]+\".*\"")
|
||||
|
||||
string(REGEX REPLACE "^#define[\t ]+LIBXSLT_DOTTED_VERSION[\t ]+\"([^\"]*)\".*" "\\1"
|
||||
LIBXSLT_VERSION_STRING "${libxslt_version_str}")
|
||||
LibXslt_VERSION "${libxslt_version_str}")
|
||||
set(LIBXSLT_VERSION_STRING "${LibXslt_VERSION}")
|
||||
unset(libxslt_version_str)
|
||||
endif()
|
||||
|
||||
include(FindPackageHandleStandardArgs)
|
||||
find_package_handle_standard_args(LibXslt
|
||||
REQUIRED_VARS LIBXSLT_LIBRARIES LIBXSLT_INCLUDE_DIR
|
||||
VERSION_VAR LIBXSLT_VERSION_STRING)
|
||||
VERSION_VAR LibXslt_VERSION)
|
||||
|
||||
mark_as_advanced(LIBXSLT_INCLUDE_DIR
|
||||
LIBXSLT_LIBRARY
|
||||
|
||||
@@ -120,7 +120,7 @@ foreach(
|
||||
GIF GTK2
|
||||
HDF5
|
||||
Jasper JPEG
|
||||
LibArchive LIBLZMA LibXml2
|
||||
LibArchive LIBLZMA LibXml2 LibXslt
|
||||
OPENSCENEGRAPH
|
||||
PostgreSQL Protobuf
|
||||
Ruby RUBY
|
||||
|
||||
@@ -6,7 +6,7 @@ find_package(Iconv)
|
||||
find_package(LibXml2 REQUIRED)
|
||||
find_package(LibXslt REQUIRED)
|
||||
|
||||
add_definitions(-DCMAKE_EXPECTED_LibXslt_VERSION="${LIBXSLT_VERSION_STRING}")
|
||||
add_definitions(-DCMAKE_EXPECTED_LibXslt_VERSION="${LibXslt_VERSION}")
|
||||
|
||||
add_executable(libxslt_tgt libxslt.c)
|
||||
if(Iconv_FOUND)
|
||||
|
||||
Reference in New Issue
Block a user