summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorOBATA Akio <obache@wizdas.com>2020-08-19 15:53:58 +0900
committerSlávek Banko <slavek.banko@axis.cz>2020-09-27 19:26:16 +0200
commit6736088603213890fba2c83b0c926db821d31b6e (patch)
tree8cf61e1b9db0e9ef899c3b617a961314d8af28ba
parent1b5d591d76e23d1997c40af8d33f376d5c0c8208 (diff)
downloadtdelibs-6736088603213890fba2c83b0c926db821d31b6e.tar.gz
tdelibs-6736088603213890fba2c83b0c926db821d31b6e.zip
Port ASPELL_DATADIR detection to CMake
Signed-off-by: OBATA Akio <obache@wizdas.com> (cherry picked from commit ba75e441eab1713cac9219d93d06c478c0bc93df) Signed-off-by: Slávek Banko <slavek.banko@axis.cz>
-rw-r--r--CMakeLists.txt14
1 files changed, 13 insertions, 1 deletions
diff --git a/CMakeLists.txt b/CMakeLists.txt
index 78c595b18..4a295520c 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -1144,14 +1144,26 @@ if ( NOT ISPELL_LIBDIR )
endif ( NOT ISPELL_LIBDIR )
##### check for aspell ##########################
-# we need ASPELL_DATADIR too
if( WITH_ASPELL )
find_package( ASPELL )
if( NOT ASPELL_FOUND )
message(FATAL_ERROR "\nASPELL support are requested, but not found on your system" )
endif( NOT ASPELL_FOUND )
+ if( NOT ASPELL_DATADIR )
+ find_program( PSPELL_CONFIG_EXECUTABLE NAMES pspell-config DOC "path to the pspell-config executable" )
+ if( PSPELL_CONFIG_EXECUTABLE )
+ execute_process (
+ COMMAND ${PSPELL_CONFIG_EXECUTABLE} --pkgdatadir
+ OUTPUT_VARIABLE ASPELL_DATADIR
+ OUTPUT_STRIP_TRAILING_WHITESPACE)
+ endif( PSPELL_CONFIG_EXECUTABLE )
+ endif( NOT ASPELL_DATADIR )
endif( WITH_ASPELL )
+if( NOT ASPELL_DATADIR )
+ set ( ASPELL_DATADIR "/usr/lib/aspell" )
+endif( NOT ASPELL_DATADIR )
+set ( ASPELL_DATADIR "${ASPELL_DATADIR}" CACHE PATH "aspell data directory" )
##### check for hspell ##########################