]> git.lyx.org Git - lyx.git/blobdiff - development/cmake/CMakeLists.txt
cmake: more cleanup
[lyx.git] / development / cmake / CMakeLists.txt
index a368fc24c39e71a9b9afee920cbfe2bae68fa639..a99547253f7a6852ae4d0fb7bfd6a93c3f6b8923 100644 (file)
@@ -38,6 +38,7 @@ LYX_OPTION(NLS "Use nls" OFF ALL)
 LYX_OPTION(ASPELL "Require aspell" OFF ALL)
 LYX_OPTION(AIKSAURUS "Require Aiksaurus" OFF ALL)
 LYX_OPTION(ENCHANT "Require Enchant" OFF ALL)
+LYX_OPTION(HUNSPELL "Require Hunspell" OFF ALL)
 LYX_OPTION(DEBUG "Build debug version" OFF ALL)
 LYX_OPTION(RELEASE "Build release version" ON ALL)
 LYX_OPTION(PROFILE "Build profile version" OFF GCC)
@@ -64,6 +65,9 @@ if(LYX_INSTALL)
        set(LYX_NLS ON CACHE BOOL "Nls option" FORCE)
        set(LYX_ASPELL ON CACHE BOOL "Aspell option" FORCE)
        set(LYX_AIKSAURUS ON CACHE BOOL "Aiksaurus option" FORCE)
+       if (WIN32)
+               set(LYX_HUNSPELL ON CACHE BOOL "Hunspell option" FORCE)
+       endif()
        set(LYX_NO_CONSOLE ON CACHE BOOL "No console option" FORCE)
        set(LYX_PACKAGE_SUFFIX ON CACHE BOOL "Package suffix option" FORCE)
        set(LYX_RELEASE ON CACHE BOOL "Release option" FORCE)
@@ -246,6 +250,7 @@ add_definitions(-DQT_NO_STL -DQT_NO_KEYWORDS)
 
 find_package(ZLIB REQUIRED)
 
+
 if(LYX_ASPELL)
        find_package(ASPELL)
        include_directories(${ASPELL_INCLUDE_DIR})
@@ -261,36 +266,28 @@ if(LYX_ENCHANT)
        include_directories(${ENCHANT_INCLUDE_DIR})
 endif()
 
+if(LYX_HUNSPELL)
+       find_package(Hunspell REQUIRED)
+       include_directories(${HUNSPELL_INCLUDE_DIR})
+endif()
 
-if(LYX_USE_EXTERNAL_LIBINTL)
-       find_package(Libintl REQUIRED)
-       add_definitions(-DHAVE_GETTEXT)
+if(LYX_NLS)
+       FIND_PROGRAM(LYX_PYTHON_EXECUTABLE python)
+       if(${LYX_PYTHON_EXECUTABLE} MATCHES "-NOTFOUND")
+               message(FATAL_ERROR "Python 2.6 needed!")
+       endif()
+       find_package(LyXGettext REQUIRED)
+       include_directories(${TOP_SRC_DIR}/po)
 endif()
 
 
-#TODO move to FindHunstall.cmake
-if(WIN32)
-  find_library(HUNSPELL_LIBRARY "libhunspell")
-else()
-  #find_library(HUNSPELL_LIBRARY NAME "hunspell" PATH "/usr/local/lib" "/usr/lib" NO_DEFAULT_PATH)
-  find_library(HUNSPELL_LIBRARY NAMES "hunspell" "hunspell-1.2" PATHS "/usr/local/lib" "/usr/lib" "/usr/lib64")
-endif()
-if (HUNSPELL_LIBRARY)
-  find_file(HUNSPELL_FOUND "hunspell/hunspell.hxx")
-endif()
-if (HUNSPELL_FOUND)
-  add_definitions(-DUSE_HUNSPELL=1)
-  message(STATUS "Building with USE_HUNSPELL")
-else()
-  message(STATUS "Hunspell not found, building without hunspell support")
+if(LYX_USE_EXTERNAL_LIBINTL)
+       find_package(Libintl REQUIRED)
+       add_definitions(-DHAVE_GETTEXT)
 endif()
 
 
 
-if(LYX_NLS)
-       add_definitions(-DENABLE_NLS=1)
-endif()
-
 
 if(WIN32)
        if(LYX_NO_CONSOLE)
@@ -427,14 +424,6 @@ if(MSVC)
 
 endif()
 
-FIND_PROGRAM(LYX_PYTHON_EXECUTABLE python)
-if( NOT ${LYX_PYTHON_EXECUTABLE} MATCHES "-NOTFOUND")
-    if(LYX_NLS)
-      find_package(LyXGettext REQUIRED)
-      include_directories(${TOP_SRC_DIR}/po)
-      add_subdirectory(po)
-    endif()
-endif()
 
 if(LYX_DEBUG_GLIBC)
   set(_GLIBCXX_DEBUG 1)
@@ -499,6 +488,9 @@ if(LYX_INSTALL)
 endif()
 add_subdirectory(lyx2lyx)
 add_subdirectory(scripts)
+if(LYX_NLS)
+       add_subdirectory(po)
+endif()
 
 if(LYX_INSTALL)
        include(../Install)
@@ -547,9 +539,7 @@ endif()
 # so we do not provide infofiles for
 # CPACK_RESOURCE_FILE_README and CPACK_RESOURCE_FILE_WELCOME
 
-if(LYX_INSTALL)
-       include(CPack)
-endif()
+include(CPack)
 
 #Now it is possible to create some packages
 # cd <BuildDir>