+foreach(_spell "ASPELL" "Enchant" "Hunspell")
+ string(TOUPPER ${_spell} _upspell)
+ if (NOT ${_upspell}_FOUND)
+ find_package(${_spell})
+ endif()
+ if (${_upspell}_FOUND)
+ include_directories(${${_upspell}_INCLUDE_DIR})
+ set(Spelling_FOUND ON)
+ message(STATUS "Building with USE_${_upspell}")
+ set(Include_used_spellchecker "${Include_used_spellchecker}#define USE_${_upspell} 1\n")
+ else()
+ if(LYX_${_upspell})
+ message(FATAL_ERROR "Required ${_spell} devel package not found")
+ else()
+ message(STATUS "${_upspell} not found, building without ${_spell} support")
+ endif()
+ endif()
+endforeach()
+
+if(NOT LYX_PYTHON_EXECUTABLE)
+ find_package(PythonInterp 2.7 QUIET)
+ if(PYTHONINTERP_FOUND)
+ if(PYTHON_VERSION_STRING VERSION_GREATER 2.8)
+ unset(PYTHONINTERP_FOUND)
+ endif()
+ endif()
+
+ if(NOT PYTHONINTERP_FOUND AND NOT GNUWIN32_DIR)
+ unset(PYTHON_EXECUTABLE CACHE)
+ unset(PYTHON_VERSION_MAJOR)
+ unset(PYTHON_VERSION_MINOR)
+ unset(PYTHON_VERSION_STRING)
+ find_package(PythonInterp 3.3 REQUIRED)
+ endif()
+
+ set(LYX_PYTHON_EXECUTABLE ${PYTHON_EXECUTABLE} CACHE FILEPATH "Python to be used by LyX")