FindHSPELL.cmake 1.8 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243
  1. # - Try to find Hspell
  2. # Once done this will define
  3. #
  4. # HSPELL_FOUND - system has Hspell
  5. # HSPELL_INCLUDE_DIR - the Hspell include directory
  6. # HSPELL_LIBRARIES - The libraries needed to use Hspell
  7. # HSPELL_DEFINITIONS - Compiler switches required for using Hspell
  8. #
  9. # HSPELL_VERSION_STRING - The version of Hspell found (x.y)
  10. # HSPELL_MAJOR_VERSION - the major version of Hspell
  11. # HSPELL_MINOR_VERSION - The minor version of Hspell
  12. #=============================================================================
  13. # Copyright 2006-2009 Kitware, Inc.
  14. # Copyright 2006 Alexander Neundorf <[email protected]>
  15. #
  16. # Distributed under the OSI-approved BSD License (the "License");
  17. # see accompanying file Copyright.txt for details.
  18. #
  19. # This software is distributed WITHOUT ANY WARRANTY; without even the
  20. # implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
  21. # See the License for more information.
  22. #=============================================================================
  23. # (To distribute this file outside of CMake, substitute the full
  24. # License text for the above reference.)
  25. FIND_PATH(HSPELL_INCLUDE_DIR hspell.h)
  26. FIND_LIBRARY(HSPELL_LIBRARIES NAMES hspell)
  27. IF (HSPELL_INCLUDE_DIR)
  28. FILE(READ "${HSPELL_INCLUDE_DIR}/hspell.h" HSPELL_H)
  29. STRING(REGEX REPLACE ".*#define HSPELL_VERSION_MAJOR ([0-9]+).*" "\\1" HSPELL_VERSION_MAJOR "${HSPELL_H}")
  30. STRING(REGEX REPLACE ".*#define HSPELL_VERSION_MINOR ([0-9]+).*" "\\1" HSPELL_VERSION_MINOR "${HSPELL_H}")
  31. ENDIF()
  32. # handle the QUIETLY and REQUIRED arguments and set HSPELL_FOUND to TRUE if
  33. # all listed variables are TRUE
  34. INCLUDE(FindPackageHandleStandardArgs)
  35. FIND_PACKAGE_HANDLE_STANDARD_ARGS(HSPELL DEFAULT_MSG HSPELL_LIBRARIES HSPELL_INCLUDE_DIR)
  36. MARK_AS_ADVANCED(HSPELL_INCLUDE_DIR HSPELL_LIBRARIES)