LYX_OPTION(MERGE_REBUILD "Rebuild generated files from merged files build" OFF ALL)
LYX_OPTION(QUIET "Don't generate verbose makefiles" OFF ALL)
LYX_OPTION(INSTALL_PREFIX "Install path for LyX" OFF ALL)
-LYX_OPTION(EXTERNAL_LIBINTL "Use external libintl" ON ALL)
LYX_OPTION(BUNDLE "Build bundle (experimental) " OFF ALL)
# GCC specific
add_subdirectory(po "${TOP_BINARY_DIR}/po")
endif()
-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()
- add_subdirectory(intl "${TOP_BINARY_DIR}/intl")
- endif()
-endif()
-
-if(LYX_EXTERNAL_LIBINTL)
- set(intl_link ${LIBINTL_LIBRARIES})
-else()
- set(intl_link intl)
-endif()
-
find_package(ICONV REQUIRED)
find_package(ZLIB REQUIRED)
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}")
-- LYX_MERGE_REBUILD = OFF : Rebuild generated files from merged files build
-- LYX_QUIET = OFF : Don't generate verbose makefiles
-- LYX_INSTALL_PREFIX = OFF : Install path for LyX
- -- LYX_EXTERNAL_LIBINTL = ON : Use external libintl
# GCC specific
-- LYX_PROFILE = OFF : Build profile version
cmake/modules/FindGNUWIN32.cmake \
cmake/modules/FindHunspell.cmake \
cmake/modules/FindICONV.cmake \
-cmake/modules/FindLibintl.cmake \
cmake/modules/FindLyXGettext.cmake \
cmake/modules/FindMagic.cmake \
cmake/modules/FindMyThesLIB.cmake \
This is what I do: copy them from an autotools install into the cmake project.
Package.cpp and config.h.cmake has to be fixed.
* check that .tar.gz and .xz are identical to those from autotools
- * DONE: Fix libintl, LYX_EXTERNAL_LIBINTL=OFF triggers compilation in intl even when LYX_NLS is OFF
* *.po are too often generated by Visual Studio
* show correct values in cmake-gui: write forced to cache
#cmakedefine LYX_NLS 1
#ifdef LYX_NLS
#define ENABLE_NLS 1
-// These are needed when building included gettext (taken from autoconf macro)
-#cmakedefine LYX_EXTERNAL_LIBINTL 1
-#if !defined(LYX_EXTERNAL_LIBINTL)
-// this only makes sense when LYX_EXTERNAL_LIBINTL is OFF.
-#define __libc_lock_t gl_lock_t
-#define __libc_lock_define gl_lock_define
-#define __libc_lock_define_initialized gl_lock_define_initialized
-#define __libc_lock_init gl_lock_init
-#define __libc_lock_lock gl_lock_lock
-#define __libc_lock_unlock gl_lock_unlock
-#define __libc_lock_recursive_t gl_recursive_lock_t
-#define __libc_lock_define_recursive gl_recursive_lock_define
-#define __libc_lock_define_initialized_recursive gl_recursive_lock_define_initialized
-#define __libc_lock_init_recursive gl_recursive_lock_init
-#define __libc_lock_lock_recursive gl_recursive_lock_lock
-#define __libc_lock_unlock_recursive gl_recursive_lock_unlock
-#define glthread_in_use libintl_thread_in_use
-#define glthread_lock_init libintl_lock_init
-#define glthread_lock_lock libintl_lock_lock
-#define glthread_lock_unlock libintl_lock_unlock
-#define glthread_lock_destroy libintl_lock_destroy
-#define glthread_rwlock_init libintl_rwlock_init
-#define glthread_rwlock_rdlock libintl_rwlock_rdlock
-#define glthread_rwlock_wrlock libintl_rwlock_wrlock
-#define glthread_rwlock_unlock libintl_rwlock_unlock
-#define glthread_rwlock_destroy libintl_rwlock_destroy
-#define glthread_recursive_lock_init libintl_recursive_lock_init
-#define glthread_recursive_lock_lock libintl_recursive_lock_lock
-#define glthread_recursive_lock_unlock libintl_recursive_lock_unlock
-#define glthread_recursive_lock_destroy libintl_recursive_lock_destroy
-#define glthread_once libintl_once
-#define glthread_once_call libintl_once_call
-#define glthread_once_singlethreaded libintl_once_singlethreaded
-#define hash_string libintl_hash_string
-#endif /* LYX_EXTERNAL_LIBINTL */
#endif
+++ /dev/null
-# Try to find Libintl functionality
-# Once done this will define
-#
-# LIBINTL_FOUND - system has Libintl
-# LIBINTL_INCLUDE_DIR - Libintl include directory
-# LIBINTL_LIBRARIES - Libraries needed to use Libintl
-#
-# TODO: This will enable translations only if Gettext functionality is
-# present in libc. Must have more robust system for release, where Gettext
-# functionality can also reside in standalone Gettext library, or the one
-# embedded within kdelibs (cf. gettext.m4 from Gettext source).
-
-# Copyright (c) 2006, Chusslove Illich, <caslav.ilic@gmx.net>
-# Copyright (c) 2007, Alexander Neundorf, <neundorf@kde.org>
-#
-# Redistribution and use is allowed according to the terms of the BSD license.
-# For details see the accompanying COPYING-CMAKE-SCRIPTS file.
-
-if(LIBINTL_INCLUDE_DIR AND LIBINTL_LIB_FOUND)
- set(Libintl_FIND_QUIETLY TRUE)
-endif(LIBINTL_INCLUDE_DIR AND LIBINTL_LIB_FOUND)
-
-find_path(LIBINTL_INCLUDE_DIR libintl.h)
-
-find_file(LIBINTL_HEADER libintl.h
- PATHS ${LIBINTL_INCLUDE_DIR} NO_DEFAULT_PATH)
-
-set(LIBINTL_LIB_FOUND FALSE)
-
-if(LIBINTL_INCLUDE_DIR)
- include(CheckFunctionExists)
- check_function_exists(dgettext LIBINTL_LIBC_HAS_DGETTEXT)
-
- if (LIBINTL_LIBC_HAS_DGETTEXT)
- set(LIBINTL_LIBRARIES)
- set(LIBINTL_LIB_FOUND TRUE)
- else (LIBINTL_LIBC_HAS_DGETTEXT)
- find_library(LIBINTL_LIBRARIES NAMES intl libintl )
- if(LIBINTL_LIBRARIES)
- set(LIBINTL_LIB_FOUND TRUE)
- endif(LIBINTL_LIBRARIES)
- endif (LIBINTL_LIBC_HAS_DGETTEXT)
-
-endif(LIBINTL_INCLUDE_DIR)
-
-#include(FindPackageHandleStandardArgs)
-#find_package_handle_standard_args(Libintl DEFAULT_MSG LIBINTL_INCLUDE_DIR LIBINTL_LIB_FOUND)
-
-mark_as_advanced(LIBINTL_INCLUDE_DIR LIBINTL_LIBRARIES LIBINTL_LIBC_HAS_DGETTEXT LIBINTL_LIB_FOUND)
frontend_qt4
graphics
support
- ${intl_link}
${ICONV_LIBRARY}
${QT_QTMAIN_LIBRARY}
${vld_dll})
include_directories(BEFORE
"${TOP_SRC_DIR}/src/client"
"${TOP_SRC_DIR}/boost"
- ${ZLIB_INCLUDE_DIR}
- ${LIBINTL_INCLUDE_DIR})
+ ${ZLIB_INCLUDE_DIR})
if(LYX_MERGE_FILES)
set(_lyxclient_sources ${_lyxclient_sources} ${TOP_SRC_DIR}/src/TexRow.cpp)
target_link_libraries(${_lyxclient}
support
${Lyx_Boost_Libraries}
- ${intl_link}
${ICONV_LIBRARY}
${QT_QTCORE_LIBRARY}
${QT_QTGUI_LIBRARY})
${TOP_SRC_DIR}/src/support/mythes
${QT_INCLUDES}
${ICONV_INCLUDE_DIR}
- ${ZLIB_INCLUDE_DIR}
- ${LIBINTL_INCLUDE_DIR})
+ ${ZLIB_INCLUDE_DIR})
if(NOT LYX_MERGE_FILES)
endforeach()
set(${_program}_SOURCES ${_tmplist})
add_executable(${_program} ${_tmplist})
- target_link_libraries(${_program} support ${intl_link}
+ target_link_libraries(${_program} support
${Lyx_Boost_Libraries} ${QT_QTGUI_LIBRARY} ${QT_QTCORE_LIBRARY}
${ZLIB_LIBRARY} ${ICONV_LIBRARY})
endmacro()
${TOP_SRC_DIR}/src/support/tests
${QT_INCLUDES}
${ICONV_INCLUDE_DIR}
- ${ZLIB_INCLUDE_DIR}
- ${LIBINTL_INCLUDE_DIR})
+ ${ZLIB_INCLUDE_DIR})
set(check_PROGRAMS check_convert check_filetools check_lstrings)
message(STATUS "Allow multiple definitions for cxx-compiler ${CMAKE_CXX_COMPILER_ID} not handled")
endif()
-target_link_libraries(check_layout support ${intl_link}
+target_link_libraries(check_layout support
${Lyx_Boost_Libraries} ${QT_QTGUI_LIBRARY} ${QT_QTCORE_LIBRARY}
${ZLIB_LIBRARY} ${ICONV_LIBRARY})
+
add_dependencies(lyx_run_tests check_layout)
set_target_properties(check_layout PROPERTIES FOLDER "tests/src")
${Lyx_Boost_Libraries}
${QT_QTCORE_LIBRARY}
${QT_QTGUI_LIBRARY}
- ${intl_link}
${ICONV_LIBRARY})
add_dependencies(${_tex2lyx} lyx_version)