aboutsummaryrefslogtreecommitdiff
path: root/modules/FindENCHANT.cmake
diff options
context:
space:
mode:
authorAllen Winter <allen.winter@kdab.com>2011-06-28 17:13:05 -0400
committerAllen Winter <allen.winter@kdab.com>2011-06-28 17:13:05 -0400
commite15ffacc69242c89107afbfda6f8ece9f2b56633 (patch)
tree34bed177321c49f883d9d75616947a18f38c037f /modules/FindENCHANT.cmake
parent5c79bed7250cb2f854bfb4f20e4d266925d94b54 (diff)
parentc06badd8d431583071cad638fea082ca0776a0a3 (diff)
downloadextra-cmake-modules-e15ffacc69242c89107afbfda6f8ece9f2b56633.tar.gz
extra-cmake-modules-e15ffacc69242c89107afbfda6f8ece9f2b56633.tar.bz2
Merge branch 'allen' of /data/kde/trunk/KDE/kdelibs
Diffstat (limited to 'modules/FindENCHANT.cmake')
-rw-r--r--modules/FindENCHANT.cmake44
1 files changed, 44 insertions, 0 deletions
diff --git a/modules/FindENCHANT.cmake b/modules/FindENCHANT.cmake
new file mode 100644
index 00000000..9c13c488
--- /dev/null
+++ b/modules/FindENCHANT.cmake
@@ -0,0 +1,44 @@
+# - Try to find the Enchant spell checker
+# Once done this will define
+#
+# ENCHANT_FOUND - system has ENCHANT
+# ENCHANT_INCLUDE_DIR - the ENCHANT include directory
+# ENCHANT_LIBRARIES - Link these to use ENCHANT
+# ENCHANT_DEFINITIONS - Compiler switches required for using ENCHANT
+
+# Copyright (c) 2006, Zack Rusin, <zack@kde.org>
+#
+# Redistribution and use is allowed according to the terms of the BSD license.
+# For details see the accompanying COPYING-CMAKE-SCRIPTS file.
+
+
+if (ENCHANT_INCLUDE_DIR AND ENCHANT_LIBRARIES)
+
+ # in cache already
+ set(ENCHANT_FOUND TRUE)
+
+else (ENCHANT_INCLUDE_DIR AND ENCHANT_LIBRARIES)
+ if (NOT WIN32)
+ # use pkg-config to get the directories and then use these values
+ # in the FIND_PATH() and FIND_LIBRARY() calls
+ find_package(PkgConfig)
+ pkg_check_modules(PC_ENCHANT QUIET enchant)
+ set(ENCHANT_DEFINITIONS ${PC_ENCHANT_CFLAGS_OTHER})
+ endif (NOT WIN32)
+
+ find_path(ENCHANT_INCLUDE_DIR
+ NAMES enchant++.h
+ HINTS ${PC_ENCHANT_INCLUDEDIR}
+ ${PC_ENCHANT_INCLUDE_DIRS}
+ PATH_SUFFIXES enchant )
+
+ find_library(ENCHANT_LIBRARIES NAMES enchant
+ HINTS ${PC_ENCHANT_LIBDIR}
+ ${PC_ENCHANT_LIBRARY_DIRS} )
+
+ include(FindPackageHandleStandardArgs)
+ find_package_handle_standard_args(ENCHANT DEFAULT_MSG ENCHANT_INCLUDE_DIR ENCHANT_LIBRARIES )
+
+ mark_as_advanced(ENCHANT_INCLUDE_DIR ENCHANT_LIBRARIES)
+
+endif (ENCHANT_INCLUDE_DIR AND ENCHANT_LIBRARIES)