summaryrefslogtreecommitdiffstats
path: root/Modules/FindSquish.cmake
diff options
context:
space:
mode:
authorAlex Neundorf <neundorf@kde.org>2012-11-04 18:11:43 (GMT)
committerAlex Neundorf <neundorf@kde.org>2012-11-04 18:19:40 (GMT)
commit3fe2bc622e75c052e75c351621a8c876070481a3 (patch)
tree5ed41dd0e0766132ed440c82d03fa3a27acaccd6 /Modules/FindSquish.cmake
parent314e7fb6e9a8fe48531c8c04de6eadd9333360ee (diff)
downloadCMake-3fe2bc622e75c052e75c351621a8c876070481a3.zip
CMake-3fe2bc622e75c052e75c351621a8c876070481a3.tar.gz
CMake-3fe2bc622e75c052e75c351621a8c876070481a3.tar.bz2
Squish: detect version
Alex
Diffstat (limited to 'Modules/FindSquish.cmake')
-rw-r--r--Modules/FindSquish.cmake19
1 files changed, 19 insertions, 0 deletions
diff --git a/Modules/FindSquish.cmake b/Modules/FindSquish.cmake
index a032496..032ed97 100644
--- a/Modules/FindSquish.cmake
+++ b/Modules/FindSquish.cmake
@@ -4,6 +4,10 @@
#
# ---- Variables and Macros
# SQUISH_FOUND If false, don't try to use Squish
+# SQUISH_VERSION The full version of Squish found
+# SQUISH_VERSION_MAJOR The major version of Squish found
+# SQUISH_VERSION_MINOR The minor version of Squish found
+# SQUISH_VERSION_PATCH The patch version of Squish found
#
# SQUISH_INSTALL_DIR The Squish installation directory (containing bin, lib, etc)
# SQUISH_SERVER_EXECUTABLE The squishserver executable
@@ -86,9 +90,24 @@ else()
set(SQUISH_INSTALL_DIR_FOUND 0)
endif()
+
+set(SQUISH_VERSION)
+set(SQUISH_VERSION_MAJOR )
+set(SQUISH_VERSION_MINOR )
+set(SQUISH_VERSION_PATCH )
+
# record if executables are set
if(SQUISH_CLIENT_EXECUTABLE)
set(SQUISH_CLIENT_EXECUTABLE_FOUND 1)
+ execute_process(COMMAND "${SQUISH_CLIENT_EXECUTABLE}" --version
+ OUTPUT_VARIABLE _squishVersionOutput
+ ERROR_QUIET )
+ if("${_squishVersionOutput}" MATCHES "([0-9]+)\\.([0-9]+)\\.([0-9]+).*$")
+ 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}" )
+ endif()
else()
set(SQUISH_CLIENT_EXECUTABLE_FOUND 0)
endif()