aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorZack Rusin <zack@kde.org>2006-07-02 20:27:11 +0000
committerZack Rusin <zack@kde.org>2006-07-02 20:27:11 +0000
commit4fa74d074cb501931f954d02d5bbac1deafdc905 (patch)
tree33af5ed2df4bfbf05800ac04140070f6730fd2ba
parent89d143d40654b9afe9a86409da5f559ff849acca (diff)
downloadextra-cmake-modules-4fa74d074cb501931f954d02d5bbac1deafdc905.tar.gz
extra-cmake-modules-4fa74d074cb501931f954d02d5bbac1deafdc905.tar.bz2
adding Enchant plugin and adjust the others to the new naming
svn path=/trunk/KDE/kdelibs/; revision=557286
-rw-r--r--modules/FindENCHANT.cmake54
1 files changed, 54 insertions, 0 deletions
diff --git a/modules/FindENCHANT.cmake b/modules/FindENCHANT.cmake
new file mode 100644
index 00000000..abda9dde
--- /dev/null
+++ b/modules/FindENCHANT.cmake
@@ -0,0 +1,54 @@
+# - 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
+#
+
+if (ENCHANT_INCLUDE_DIR AND ENCHANT_LIBRARIES)
+
+ # in cache already
+ SET(ENCHANT_FOUND TRUE)
+
+else (ENCHANT_INCLUDE_DIR AND ENCHANT_LIBRARIES)
+
+ # use pkg-config to get the directories and then use these values
+ # in the FIND_PATH() and FIND_LIBRARY() calls
+ INCLUDE(UsePkgConfig)
+
+ PKGCONFIG(enchant _ENCHANTIncDir _ENCHANTLinkDir _ENCHANTLinkFlags _ENCHANTCflags)
+
+ set(ENCHANT_DEFINITIONS ${_ENCHANTCflags})
+
+ FIND_PATH(ENCHANT_INCLUDE_DIR enchant/enchant.h
+ ${_ENCHANTIncDir}
+ /usr/include
+ /usr/local/include
+ )
+
+ FIND_LIBRARY(ENCHANT_LIBRARIES NAMES enchant
+ PATHS
+ ${_ENCHANTLinkDir}
+ /usr/lib
+ /usr/local/lib
+ )
+
+ if (ENCHANT_INCLUDE_DIR AND ENCHANT_LIBRARIES)
+ set(ENCHANT_FOUND TRUE)
+ endif (ENCHANT_INCLUDE_DIR AND ENCHANT_LIBRARIES)
+
+ if (ENCHANT_FOUND)
+ if (NOT ENCHANT_FIND_QUIETLY)
+ message(STATUS "Found ENCHANT: ${ENCHANT_LIBRARIES}")
+ endif (NOT ENCHANT_FIND_QUIETLY)
+ else (ENCHANT_FOUND)
+ if (ENCHANT_FIND_REQUIRED)
+ message(FATAL_ERROR "Could NOT find ENCHANT")
+ endif (ENCHANT_FIND_REQUIRED)
+ endif (ENCHANT_FOUND)
+
+ MARK_AS_ADVANCED(ENCHANT_INCLUDE_DIR ENCHANT_LIBRARIES)
+
+endif (ENCHANT_INCLUDE_DIR AND ENCHANT_LIBRARIES)