mirror of
https://git.lyx.org/repos/lyx.git
synced 2024-11-09 18:31:04 +00:00
Cmake build: Search for spell checking libraries unconditionally
New option: LYX_REQUIRE_SPELLCHECK. If set and no spellchecker found stop the compilation if not set, compile in many speckeckers as possible from the set of 'ASPELL', 'Hunspell', 'Enchant'
This commit is contained in:
parent
77ee91ccfe
commit
6dc198ed6e
@ -84,6 +84,7 @@ LYX_OPTION(CPACK "Use the CPack management (Implies LYX_INSTALL optio
|
|||||||
LYX_OPTION(LOCALVERSIONING "Add version info to created package name (only used if LYX_CPACK option set)" OFF ALL)
|
LYX_OPTION(LOCALVERSIONING "Add version info to created package name (only used if LYX_CPACK option set)" OFF ALL)
|
||||||
LYX_OPTION(INSTALL "Build install projects/rules (implies a bunch of other options)" OFF ALL)
|
LYX_OPTION(INSTALL "Build install projects/rules (implies a bunch of other options)" OFF ALL)
|
||||||
LYX_OPTION(NLS "Enable Native Language Support (NLS)" ON ALL)
|
LYX_OPTION(NLS "Enable Native Language Support (NLS)" ON ALL)
|
||||||
|
LYX_OPTION(REQUIRE_SPELLCHECK "Abort if no spellchecker available" OFF ALL)
|
||||||
LYX_OPTION(ASPELL "Require aspell" OFF ALL)
|
LYX_OPTION(ASPELL "Require aspell" OFF ALL)
|
||||||
LYX_OPTION(ENCHANT "Require Enchant" OFF ALL)
|
LYX_OPTION(ENCHANT "Require Enchant" OFF ALL)
|
||||||
LYX_OPTION(HUNSPELL "Require Hunspell" OFF ALL)
|
LYX_OPTION(HUNSPELL "Require Hunspell" OFF ALL)
|
||||||
@ -540,20 +541,22 @@ endif()
|
|||||||
|
|
||||||
include_directories(${TOP_BINARY_DIR} ${TOP_SRC_DIR}/src)
|
include_directories(${TOP_BINARY_DIR} ${TOP_SRC_DIR}/src)
|
||||||
|
|
||||||
if(LYX_ASPELL)
|
set(Spelling_FOUND OFF)
|
||||||
find_package(ASPELL REQUIRED)
|
foreach(_spell "ASPELL" "Enchant" "Hunspell")
|
||||||
include_directories(${ASPELL_INCLUDE_DIR})
|
string(TOUPPER ${_spell} _upspell)
|
||||||
endif()
|
find_package(${_spell})
|
||||||
|
if (${_upspell}_FOUND)
|
||||||
if(LYX_ENCHANT)
|
include_directories(${${_upspell}_INCLUDE_DIR})
|
||||||
find_package(Enchant REQUIRED)
|
set(Spelling_FOUND ON)
|
||||||
include_directories(${ENCHANT_INCLUDE_DIR})
|
message(STATUS "Building with USE_${_upspell}")
|
||||||
endif()
|
else()
|
||||||
|
if(LYX_${_upspell})
|
||||||
if(LYX_HUNSPELL)
|
message(FATAL_ERROR "Required ${_spell} devel package not found")
|
||||||
find_package(Hunspell REQUIRED)
|
else()
|
||||||
include_directories(${HUNSPELL_INCLUDE_DIR})
|
message(STATUS "${_upspell} not found, building without ${_spell} support")
|
||||||
endif()
|
endif()
|
||||||
|
endif()
|
||||||
|
endforeach()
|
||||||
|
|
||||||
if(LYX_NLS)
|
if(LYX_NLS)
|
||||||
FIND_PROGRAM(LYX_PYTHON_EXECUTABLE python2 python HINTS ${GNUWIN32_DIR}/python)
|
FIND_PROGRAM(LYX_PYTHON_EXECUTABLE python2 python HINTS ${GNUWIN32_DIR}/python)
|
||||||
@ -819,6 +822,15 @@ if(LYX_NLS)
|
|||||||
message(STATUS)
|
message(STATUS)
|
||||||
endif()
|
endif()
|
||||||
|
|
||||||
|
if(NOT Spelling_FOUND)
|
||||||
|
if(LYX_REQUIRE_SPELLCHECK)
|
||||||
|
set(_mode "FATAL_ERROR")
|
||||||
|
else()
|
||||||
|
set(_mode "STATUS")
|
||||||
|
endif()
|
||||||
|
message(${_mode} "No spellcheck libraries found. Lyx will be unable use spellchecking")
|
||||||
|
endif()
|
||||||
|
|
||||||
include("${TOP_CMAKE_PATH}/LyxPackaging.cmake")
|
include("${TOP_CMAKE_PATH}/LyxPackaging.cmake")
|
||||||
|
|
||||||
if(ENABLE_DIST)
|
if(ENABLE_DIST)
|
||||||
|
Loading…
Reference in New Issue
Block a user