]> git.lyx.org Git - lyx.git/blobdiff - CMakeLists.txt
cmake: move intl config file into source
[lyx.git] / CMakeLists.txt
index d51b5de7219bbde93386e75265c2f5734e4ec330..ad9ecf4b52c0d68336e25254079e1a53a62f16e6 100644 (file)
@@ -51,7 +51,7 @@ LYX_OPTION_INIT()
 # Options for all compilers/systems
 LYX_OPTION(CPACK            "Use the CPack management (Implies LYX_INSTALL option)" OFF ALL)
 LYX_OPTION(INSTALL          "Build install projects/rules (implies a bunch of other options)" OFF ALL)
-LYX_OPTION(NLS              "Use nls" ON ALL)
+LYX_OPTION(NLS              "Enable Native Language Support (NLS)" ON ALL)
 LYX_OPTION(ASPELL           "Require aspell" OFF ALL)
 LYX_OPTION(ENCHANT          "Require Enchant" OFF ALL)
 LYX_OPTION(HUNSPELL         "Require Hunspell" OFF ALL)
@@ -306,8 +306,7 @@ endif()
 
 
 find_package(Qt4 REQUIRED)
-find_package(ICONV REQUIRED)
-find_package(ZLIB REQUIRED)
+
 
 include_directories(${TOP_BINARY_DIR} ${TOP_SRC_DIR}/src)
   
@@ -336,17 +335,23 @@ if(LYX_NLS)
        add_subdirectory(po "${TOP_BINARY_DIR}/po")
 endif()
 
-if(LYX_EXTERNAL_LIBINTL)
-       find_package(Libintl REQUIRED)
-       add_definitions(-DHAVE_GETTEXT) #TODO move to config.h
-else()
-       if(LYX_NLS)
-               add_subdirectory(intl "${TOP_BINARY_DIR}/intl")
+if(LYX_NLS)
+       if(LYX_EXTERNAL_LIBINTL)
+               find_package(Libintl REQUIRED)  
+               if(DEFINED LIBINTL_LIBRARIES)
+                       # find getext when configuring
+                       list(APPEND CMAKE_REQUIRED_LIBRARIES ${LIBINTL_LIBRARIES})      
+                       # on mac use iconv also form ports
+                       get_filename_component(ICONV_RELATIVE_TO_LIBINTL ${LIBINTL_LIBRARIES} PATH)
+               endif()
        else()
-               # do not compile if nls disabled
+               add_subdirectory(intl "${TOP_BINARY_DIR}/intl")
        endif()
 endif()
 
+find_package(ICONV REQUIRED)
+find_package(ZLIB REQUIRED)
+
 if(LYX_EXTERNAL_BOOST)
        message(STATUS "Searching for boost")
        find_package(Boost COMPONENTS signals regex) #TODO could REQUIRED be used
@@ -534,6 +539,22 @@ message(STATUS)
 LYX_OPTION_LIST_ALL(used)
 
 
+if(LYX_NLS)
+       message(STATUS)
+       message(STATUS "Building Native Language Support (LYX_NLS is set), used libraries:")
+       message(STATUS)
+       message(STATUS "  * intl")
+       message(STATUS "     - header : ${LIBINTL_HEADER}")
+       message(STATUS "     - library: ${LIBINTL_LIBRARIES}")
+       message(STATUS "  * iconv")
+       message(STATUS "     - header : ${ICONV_HEADER}")
+       message(STATUS "     - library: ${ICONV_LIBRARY}")
+       message(STATUS "  * zlib")
+       message(STATUS "     - header : ${ZLIB_HEADER}")
+       message(STATUS "     - library: ${ZLIB_LIBRARY}")
+       message(STATUS)
+endif()
+
 set(CPACK_PACKAGE_VERSION_MAJOR "${LYX_MAJOR_VERSION}")
 set(CPACK_PACKAGE_VERSION_MINOR "${LYX_MINOR_VERSION}")
 FILE(STRINGS "${TOP_SRC_DIR}/${LYX_CMAKE_DIR}/LyX_summary.txt" CPACK_PACKAGE_DESCRIPTION_SUMMARY)