diff options
author | Alex Neundorf <neundorf@kde.org> | 2012-11-04 18:11:43 (GMT) |
---|---|---|
committer | Alex Neundorf <neundorf@kde.org> | 2012-11-04 18:19:40 (GMT) |
commit | 3fe2bc622e75c052e75c351621a8c876070481a3 (patch) | |
tree | 5ed41dd0e0766132ed440c82d03fa3a27acaccd6 /Modules/FindSquish.cmake | |
parent | 314e7fb6e9a8fe48531c8c04de6eadd9333360ee (diff) | |
download | CMake-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.cmake | 19 |
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() |