From d386ac99bcb9f8583233c0fca2c7d8fd8391e810 Mon Sep 17 00:00:00 2001 From: Neal Gompa Date: Thu, 24 Nov 2016 08:02:48 -0500 Subject: [PATCH] Add path search to find libstemmer headers In Mageia, the libstemmer headers are in /usr/include/libstemmer, while in Fedora and other distributions, they are in /usr/include. We will now support both paths. --- src/CMakeLists.txt | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt index 1132d6ca..987f6133 100644 --- a/src/CMakeLists.txt +++ b/src/CMakeLists.txt @@ -8,12 +8,14 @@ find_library(M_LIB m) pkg_check_modules(YAML REQUIRED yaml-0.1) if (STEMMING) + find_path(SNOWBALL_INCLUDE_DIR libstemmer.h HINTS "/usr/include" "/usr/include/libstemmer") find_library(SNOWBALL_LIB stemmer) - if (NOT SNOWBALL_LIB) + if (NOT SNOWBALL_LIB OR NOT SNOWBALL_INCLUDE_DIR) message (FATAL_ERROR "Stemming support is enabled, but libstemmer was not found. Please install the Snowball development files.") endif () else () set(SNOWBALL_LIB "") + set(SNOWBALL_INCLUDE_DIR "") endif () include(GObjectIntrospectionMacros) @@ -105,6 +107,7 @@ include_directories(${CMAKE_BINARY_DIR} ${GIO2_INCLUDE_DIRS} ${LIBXML2_INCLUDE_DIR} ${YAML_INCLUDE_DIR} + ${SNOWBALL_INCLUDE_DIR} ) add_definitions("-DAS_COMPILATION")