Browse Source

FindSquish: Add Squish_VERSION

This deprecates the following result variables:

* SQUISH_VERSION
* SQUISH_VERSION_MAJOR
* SQUISH_VERSION_MINOR
* SQUISH_VERSION_PATCH

Issue: #27088
Peter Kokot 3 months ago
parent
commit
ca52983884
2 changed files with 57 additions and 22 deletions
  1. 5 0
      Help/release/dev/find-modules.rst
  2. 52 22
      Modules/FindSquish.cmake

+ 5 - 0
Help/release/dev/find-modules.rst

@@ -59,5 +59,10 @@ Find Modules
   variables. Previous ``<PACKAGENAME>_VERSION_STRING`` result variables
   are deprecated.
 
+* The :module:`FindSquish` module now provides a ``Squish_VERSION`` result
+  variable.  The ``SQUISH_VERSION``, ``SQUISH_VERSION_MAJOR``,
+  ``SQUISH_VERSION_MINOR``, and ``SQUISH_VERSION_PATCH`` result variables
+  are deprecated.
+
 * The :module:`FindTIFF` module now provides a ``TIFF_VERSION`` result
   variable.  The ``TIFF_VERSION_STRING`` result variable is deprecated.

+ 52 - 22
Modules/FindSquish.cmake

@@ -5,9 +5,15 @@
 FindSquish
 ----------
 
-Finds Squish, a cross-platform automated GUI testing framework for applications
-built on various GUI technologies.  Squish supports testing of both native and
-cross-platform toolkits, such as Qt, Java, and Tk.
+Finds Squish, a cross-platform automated GUI testing framework for
+applications built on various GUI technologies:
+
+.. code-block:: cmake
+
+  find_package(Squish [<version>] [...])
+
+Squish supports testing of both native and cross-platform toolkits, such as
+Qt, Java, and Tk.
 
 Result Variables
 ^^^^^^^^^^^^^^^^
@@ -15,21 +21,14 @@ Result Variables
 This module defines the following variables:
 
 ``Squish_FOUND``
-  Boolean indicating whether the (requested version of) Squish is found.  For
-  backward compatibility, the ``SQUISH_FOUND`` variable is also set to the same
-  value.
+  Boolean indicating whether (the requested version of) Squish is found.
+  For backward compatibility, the ``SQUISH_FOUND`` variable is also set to
+  the same value.
 
-``SQUISH_VERSION``
-  The full version of the Squish found.
-
-``SQUISH_VERSION_MAJOR``
-  The major version of the Squish found.
+``Squish_VERSION``
+  .. versionadded:: 4.2
 
-``SQUISH_VERSION_MINOR``
-  The minor version of the Squish found.
-
-``SQUISH_VERSION_PATCH``
-  The patch version of the Squish found.
+  The full version of the Squish found.
 
 ``SQUISH_INSTALL_DIR_FOUND``
   Boolean indicating whether the Squish installation directory is found.
@@ -162,6 +161,35 @@ This module provides the following commands, if Squish is found:
     A string of one or more (semicolon-separated list) test wrappers needed by
     the test case.
 
+Deprecated Variables
+^^^^^^^^^^^^^^^^^^^^
+
+The following variables are provided for backward compatibility:
+
+``SQUISH_VERSION``
+  .. deprecated:: 4.2
+    Superseded by the ``Squish_VERSION``.
+
+  The full version of the Squish found.
+
+``SQUISH_VERSION_MAJOR``
+  .. deprecated:: 4.2
+    Superseded by the ``Squish_VERSION``.
+
+  The major version of the Squish found.
+
+``SQUISH_VERSION_MINOR``
+  .. deprecated:: 4.2
+    Superseded by the ``Squish_VERSION``.
+
+  The minor version of the Squish found.
+
+``SQUISH_VERSION_PATCH``
+  .. deprecated:: 4.2
+    Superseded by the ``Squish_VERSION``.
+
+  The patch version of the Squish found.
+
 Examples
 ^^^^^^^^
 
@@ -254,10 +282,11 @@ else()
 endif()
 
 
-set(SQUISH_VERSION)
-set(SQUISH_VERSION_MAJOR)
-set(SQUISH_VERSION_MINOR)
-set(SQUISH_VERSION_PATCH)
+unset(Squish_VERSION)
+unset(SQUISH_VERSION)
+unset(SQUISH_VERSION_MAJOR)
+unset(SQUISH_VERSION_MINOR)
+unset(SQUISH_VERSION_PATCH)
 
 # record if executables are set
 if(SQUISH_CLIENT_EXECUTABLE)
@@ -269,7 +298,8 @@ if(SQUISH_CLIENT_EXECUTABLE)
     set(SQUISH_VERSION_MAJOR "${CMAKE_MATCH_1}")
     set(SQUISH_VERSION_MINOR "${CMAKE_MATCH_2}")
     set(SQUISH_VERSION_PATCH "${CMAKE_MATCH_3}")
-    set(SQUISH_VERSION "${SQUISH_VERSION_MAJOR}.${SQUISH_VERSION_MINOR}.${SQUISH_VERSION_PATCH}" )
+    set(Squish_VERSION "${SQUISH_VERSION_MAJOR}.${SQUISH_VERSION_MINOR}.${SQUISH_VERSION_PATCH}" )
+    set(SQUISH_VERSION "${Squish_VERSION}")
   endif()
 else()
   set(SQUISH_CLIENT_EXECUTABLE_FOUND 0)
@@ -284,7 +314,7 @@ endif()
 # record if Squish was found
 include(FindPackageHandleStandardArgs)
 find_package_handle_standard_args(Squish  REQUIRED_VARS  SQUISH_INSTALL_DIR SQUISH_CLIENT_EXECUTABLE SQUISH_SERVER_EXECUTABLE
-                                          VERSION_VAR  SQUISH_VERSION )
+                                          VERSION_VAR Squish_VERSION)
 
 
 set(_SQUISH_MODULE_DIR "${CMAKE_CURRENT_LIST_DIR}")