diff --git a/Modules/FindTIFF.cmake b/Modules/FindTIFF.cmake index ad4b3c6f8d..c756b93bfb 100644 --- a/Modules/FindTIFF.cmake +++ b/Modules/FindTIFF.cmake @@ -5,64 +5,107 @@ FindTIFF -------- -Find the TIFF library (``libtiff``, https://libtiff.gitlab.io/libtiff/). +Finds the `TIFF library `_ (``libtiff``). +This module also takes into account the upstream TIFF library's exported CMake +package configuration, if available. -Optional COMPONENTS -^^^^^^^^^^^^^^^^^^^ +Components +^^^^^^^^^^ -This module supports the optional component `CXX`, for use with the COMPONENTS -argument of the :command:`find_package` command. This component has an associated -imported target, as described below. +This module supports the following components: + +``CXX`` + .. versionadded:: 3.19 + + Optional component that ensures that the C++ wrapper library (``libtiffxx``) + is found. + +Components can be specified using the standard syntax: + +.. code-block:: cmake + + find_package(TIFF [COMPONENTS ...]) Imported Targets ^^^^^^^^^^^^^^^^ -.. versionadded:: 3.5 - -This module defines the following :prop_tgt:`IMPORTED` targets: +This module provides the following :ref:`Imported Targets`: ``TIFF::TIFF`` - The TIFF library, if found. + .. versionadded:: 3.5 + + Target encapsulating the TIFF library usage requirements, available only if + the TIFF is found. ``TIFF::CXX`` .. versionadded:: 3.19 - The C++ wrapper libtiffxx, if requested by the `COMPONENTS CXX` option, - if the compiler is not MSVC (which includes the C++ wrapper in libtiff), - and if found. + Target encapsulating the usage requirements for the the C++ wrapper library + ``libtiffxx``, available only if TIFF is found. This target provides CXX + usage requirements only if the compiler is not MSVC. It also has the + ``TIFF::TIFF`` target linked in to simplify its usage. -Result variables +Result Variables ^^^^^^^^^^^^^^^^ -This module will set the following variables in your project: +This module defines the following variables: ``TIFF_FOUND`` - true if the TIFF headers and libraries were found -``TIFF_INCLUDE_DIR`` - the directory containing the TIFF headers -``TIFF_INCLUDE_DIRS`` - the directory containing the TIFF headers -``TIFF_LIBRARIES`` - TIFF libraries to be linked + Boolean indicating whether the TIFF is found. -Cache variables +``TIFF_VERSION_STRING`` + The version of the TIFF library found. + +``TIFF_INCLUDE_DIRS`` + The directory containing the TIFF headers. + +``TIFF_LIBRARIES`` + TIFF libraries to be linked. + +Cache Variables ^^^^^^^^^^^^^^^ The following cache variables may also be set: ``TIFF_INCLUDE_DIR`` - the directory containing the TIFF headers -``TIFF_LIBRARY_RELEASE`` - the path to the TIFF library for release configurations -``TIFF_LIBRARY_DEBUG`` - the path to the TIFF library for debug configurations -``TIFFXX_LIBRARY_RELEASE`` - the path to the TIFFXX library for release configurations -``TIFFXX_LIBRARY_DEBUG`` - the path to the TIFFXX library for debug configurations + The directory containing the TIFF headers. -.. versionadded:: 3.4 - Debug and Release variants are found separately. +``TIFF_LIBRARY_RELEASE`` + .. versionadded:: 3.4 + + The path to the TIFF library for release configurations. + +``TIFF_LIBRARY_DEBUG`` + .. versionadded:: 3.4 + + The path to the TIFF library for debug configurations. + +``TIFFXX_LIBRARY_RELEASE`` + .. versionadded:: 3.19 + + The path to the TIFFXX library for release configurations. + +``TIFFXX_LIBRARY_DEBUG`` + .. versionadded:: 3.19 + + The path to the TIFFXX library for debug configurations. + +Examples +^^^^^^^^ + +Finding TIFF library and linking it to a project target: + +.. code-block:: cmake + + find_package(TIFF) + target_link_libraries(project_target PRIVATE TIFF::TIFF) + +Finding TIFF and TIFFXX libraries by specifying the ``CXX`` component: + +.. code-block:: cmake + + find_package(TIFF COMPONENTS CXX) + target_link_libraries(project_target PRIVATE TIFF::CXX) #]=======================================================================] cmake_policy(PUSH)