2013-06-07 21:01:48 +02:00
|
|
|
# - 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.
|
|
|
|
|
|
|
|
|
2014-04-12 18:00:27 +02:00
|
|
|
if(ENCHANT_INCLUDE_DIR AND ENCHANT_LIBRARIES)
|
2013-06-07 21:01:48 +02:00
|
|
|
# in cache already
|
|
|
|
set(ENCHANT_FOUND TRUE)
|
2014-04-12 18:00:27 +02:00
|
|
|
else()
|
|
|
|
if(NOT WIN32)
|
2013-06-07 21:01:48 +02:00
|
|
|
# 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 enchant)
|
|
|
|
set(ENCHANT_DEFINITIONS ${PC_ENCHANT_CFLAGS_OTHER})
|
2014-04-12 18:00:27 +02:00
|
|
|
endif()
|
2013-06-07 21:01:48 +02:00
|
|
|
|
|
|
|
find_path(ENCHANT_INCLUDE_DIR
|
2019-09-28 20:37:38 +02:00
|
|
|
NAMES enchant++.h
|
|
|
|
HINTS ${PC_ENCHANT_INCLUDEDIR} ${PC_ENCHANT_INCLUDE_DIRS}
|
|
|
|
PATH_SUFFIXES enchant
|
|
|
|
)
|
2013-06-07 21:01:48 +02:00
|
|
|
|
2019-09-28 20:37:38 +02:00
|
|
|
find_library(ENCHANT_LIBRARIES
|
|
|
|
NAMES enchant
|
|
|
|
HINTS ${PC_ENCHANT_LIBDIR}
|
|
|
|
${PC_ENCHANT_LIBRARY_DIRS}
|
|
|
|
)
|
2013-06-07 21:01:48 +02:00
|
|
|
|
|
|
|
include(FindPackageHandleStandardArgs)
|
2019-09-28 20:37:38 +02:00
|
|
|
find_package_handle_standard_args(ENCHANT DEFAULT_MSG ENCHANT_INCLUDE_DIR ENCHANT_LIBRARIES)
|
2013-06-07 21:01:48 +02:00
|
|
|
|
|
|
|
mark_as_advanced(ENCHANT_INCLUDE_DIR ENCHANT_LIBRARIES)
|
|
|
|
|
2014-09-20 11:05:48 +02:00
|
|
|
# check if function enchant_get_version() exists
|
|
|
|
set(CMAKE_REQUIRED_INCLUDES ${ENCHANT_INCLUDE_DIR})
|
|
|
|
set(CMAKE_REQUIRED_LIBRARIES ${ENCHANT_LIBRARIES})
|
|
|
|
check_symbol_exists(enchant_get_version "enchant.h" HAVE_ENCHANT_GET_VERSION)
|
|
|
|
set(CMAKE_REQUIRED_INCLUDES)
|
|
|
|
set(CMAKE_REQUIRED_LIBRARIES)
|
2014-04-12 18:00:27 +02:00
|
|
|
endif()
|