summaryrefslogtreecommitdiffstats
path: root/Modules/FindHSPELL.cmake
diff options
context:
space:
mode:
authorKovarththanan Rajaratnam <kovarththanan.rajaratnam@gmail.com>2010-04-16 08:25:02 (GMT)
committerKovarththanan Rajaratnam <kovarththanan.rajaratnam@gmail.com>2010-04-16 08:25:02 (GMT)
commit810d9a30eff731e0f36a3e0efe090037a8736626 (patch)
tree8311cec55992a0d81d17e41e2eb636386aec76ad /Modules/FindHSPELL.cmake
parent99313f4fe99302c9688874ec7a36ef657e9a12b7 (diff)
downloadCMake-810d9a30eff731e0f36a3e0efe090037a8736626.zip
CMake-810d9a30eff731e0f36a3e0efe090037a8736626.tar.gz
CMake-810d9a30eff731e0f36a3e0efe090037a8736626.tar.bz2
FindHSPELL: add version support
Diffstat (limited to 'Modules/FindHSPELL.cmake')
-rw-r--r--Modules/FindHSPELL.cmake10
1 files changed, 10 insertions, 0 deletions
diff --git a/Modules/FindHSPELL.cmake b/Modules/FindHSPELL.cmake
index 8942b25..6b6f21f 100644
--- a/Modules/FindHSPELL.cmake
+++ b/Modules/FindHSPELL.cmake
@@ -5,6 +5,10 @@
# HSPELL_INCLUDE_DIR - the HSPELL include directory
# HSPELL_LIBRARIES - The libraries needed to use HSPELL
# HSPELL_DEFINITIONS - Compiler switches required for using HSPELL
+#
+# HSPELL_VERSION_STRING - The version of Hspell found (x.y)
+# HSPELL_MAJOR_VERSION - the major version of Hspell
+# HSPELL_MINOR_VERSION - The minor version of Hspell
#=============================================================================
# Copyright 2006-2009 Kitware, Inc.
@@ -24,6 +28,12 @@ FIND_PATH(HSPELL_INCLUDE_DIR hspell.h)
FIND_LIBRARY(HSPELL_LIBRARIES NAMES hspell)
+IF (HSPELL_INCLUDE_DIR)
+ FILE(READ "${HSPELL_INCLUDE_DIR}/hspell.h" HSPELL_H)
+ STRING(REGEX REPLACE ".*#define HSPELL_VERSION_MAJOR ([0-9]+).*" "\\1" HSPELL_VERSION_MAJOR "${HSPELL_H}")
+ STRING(REGEX REPLACE ".*#define HSPELL_VERSION_MINOR ([0-9]+).*" "\\1" HSPELL_VERSION_MINOR "${HSPELL_H}")
+ENDIF()
+
# handle the QUIETLY and REQUIRED arguments and set HSPELL_FOUND to TRUE if
# all listed variables are TRUE
INCLUDE(FindPackageHandleStandardArgs)