CMake: Remove libintl

This commit is contained in:
Vincent van Ravesteijn 2013-05-12 15:43:22 +02:00
parent d7e2705228
commit a3c864102a
12 changed files with 6 additions and 122 deletions

View File

@ -92,7 +92,6 @@ LYX_OPTION(MERGE_FILES "Merge source files into one compilation unit" OFF A
LYX_OPTION(MERGE_REBUILD "Rebuild generated files from merged files build" OFF ALL) 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(QUIET "Don't generate verbose makefiles" OFF ALL)
LYX_OPTION(INSTALL_PREFIX "Install path for LyX" 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) LYX_OPTION(BUNDLE "Build bundle (experimental) " OFF ALL)
# GCC specific # GCC specific
@ -518,26 +517,6 @@ if(LYX_NLS)
add_subdirectory(po "${TOP_BINARY_DIR}/po") add_subdirectory(po "${TOP_BINARY_DIR}/po")
endif() 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(ICONV REQUIRED)
find_package(ZLIB REQUIRED) find_package(ZLIB REQUIRED)
@ -778,9 +757,6 @@ if(LYX_NLS)
message(STATUS) message(STATUS)
message(STATUS "Building Native Language Support (LYX_NLS is set), used libraries:") message(STATUS "Building Native Language Support (LYX_NLS is set), used libraries:")
message(STATUS) message(STATUS)
message(STATUS " * intl")
message(STATUS " - header : ${LIBINTL_HEADER}")
message(STATUS " - library: ${LIBINTL_LIBRARIES}")
message(STATUS " * iconv") message(STATUS " * iconv")
message(STATUS " - header : ${ICONV_HEADER}") message(STATUS " - header : ${ICONV_HEADER}")
message(STATUS " - library: ${ICONV_LIBRARY}") message(STATUS " - library: ${ICONV_LIBRARY}")

View File

@ -148,7 +148,6 @@ Build options
-- LYX_MERGE_REBUILD = OFF : Rebuild generated files from merged files build -- LYX_MERGE_REBUILD = OFF : Rebuild generated files from merged files build
-- LYX_QUIET = OFF : Don't generate verbose makefiles -- LYX_QUIET = OFF : Don't generate verbose makefiles
-- LYX_INSTALL_PREFIX = OFF : Install path for LyX -- LYX_INSTALL_PREFIX = OFF : Install path for LyX
-- LYX_EXTERNAL_LIBINTL = ON : Use external libintl
# GCC specific # GCC specific
-- LYX_PROFILE = OFF : Build profile version -- LYX_PROFILE = OFF : Build profile version

View File

@ -105,7 +105,6 @@ cmake/modules/FindEnchant.cmake \
cmake/modules/FindGNUWIN32.cmake \ cmake/modules/FindGNUWIN32.cmake \
cmake/modules/FindHunspell.cmake \ cmake/modules/FindHunspell.cmake \
cmake/modules/FindICONV.cmake \ cmake/modules/FindICONV.cmake \
cmake/modules/FindLibintl.cmake \
cmake/modules/FindLyXGettext.cmake \ cmake/modules/FindLyXGettext.cmake \
cmake/modules/FindMagic.cmake \ cmake/modules/FindMagic.cmake \
cmake/modules/FindMyThesLIB.cmake \ cmake/modules/FindMyThesLIB.cmake \

View File

@ -20,7 +20,6 @@ Bug fixing
This is what I do: copy them from an autotools install into the cmake project. 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. Package.cpp and config.h.cmake has to be fixed.
* check that .tar.gz and .xz are identical to those from autotools * 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 * *.po are too often generated by Visual Studio
* show correct values in cmake-gui: write forced to cache * show correct values in cmake-gui: write forced to cache

View File

@ -83,41 +83,6 @@
#cmakedefine LYX_NLS 1 #cmakedefine LYX_NLS 1
#ifdef LYX_NLS #ifdef LYX_NLS
#define ENABLE_NLS 1 #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 #endif

View File

@ -1,49 +0,0 @@
# 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)

View File

@ -134,7 +134,6 @@ target_link_libraries(${_lyx}
frontend_qt4 frontend_qt4
graphics graphics
support support
${intl_link}
${ICONV_LIBRARY} ${ICONV_LIBRARY}
${QT_QTMAIN_LIBRARY} ${QT_QTMAIN_LIBRARY}
${vld_dll}) ${vld_dll})

View File

@ -17,8 +17,7 @@ list(REMOVE_ITEM _lyxclient_sources "${TOP_SRC_DIR}/src/client/lyxclient.cpp")
include_directories(BEFORE include_directories(BEFORE
"${TOP_SRC_DIR}/src/client" "${TOP_SRC_DIR}/src/client"
"${TOP_SRC_DIR}/boost" "${TOP_SRC_DIR}/boost"
${ZLIB_INCLUDE_DIR} ${ZLIB_INCLUDE_DIR})
${LIBINTL_INCLUDE_DIR})
if(LYX_MERGE_FILES) if(LYX_MERGE_FILES)
set(_lyxclient_sources ${_lyxclient_sources} ${TOP_SRC_DIR}/src/TexRow.cpp) set(_lyxclient_sources ${_lyxclient_sources} ${TOP_SRC_DIR}/src/TexRow.cpp)
@ -29,7 +28,6 @@ add_executable(${_lyxclient} ${_lyxclient_sources} ${_lyxclient_headers})
target_link_libraries(${_lyxclient} target_link_libraries(${_lyxclient}
support support
${Lyx_Boost_Libraries} ${Lyx_Boost_Libraries}
${intl_link}
${ICONV_LIBRARY} ${ICONV_LIBRARY}
${QT_QTCORE_LIBRARY} ${QT_QTCORE_LIBRARY}
${QT_QTGUI_LIBRARY}) ${QT_QTGUI_LIBRARY})

View File

@ -53,8 +53,7 @@ include_directories(
${TOP_SRC_DIR}/src/support/mythes ${TOP_SRC_DIR}/src/support/mythes
${QT_INCLUDES} ${QT_INCLUDES}
${ICONV_INCLUDE_DIR} ${ICONV_INCLUDE_DIR}
${ZLIB_INCLUDE_DIR} ${ZLIB_INCLUDE_DIR})
${LIBINTL_INCLUDE_DIR})
if(NOT LYX_MERGE_FILES) if(NOT LYX_MERGE_FILES)

View File

@ -13,7 +13,7 @@ macro(sources _program)
endforeach() endforeach()
set(${_program}_SOURCES ${_tmplist}) set(${_program}_SOURCES ${_tmplist})
add_executable(${_program} ${_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} ${Lyx_Boost_Libraries} ${QT_QTGUI_LIBRARY} ${QT_QTCORE_LIBRARY}
${ZLIB_LIBRARY} ${ICONV_LIBRARY}) ${ZLIB_LIBRARY} ${ICONV_LIBRARY})
endmacro() endmacro()
@ -24,8 +24,7 @@ include_directories(
${TOP_SRC_DIR}/src/support/tests ${TOP_SRC_DIR}/src/support/tests
${QT_INCLUDES} ${QT_INCLUDES}
${ICONV_INCLUDE_DIR} ${ICONV_INCLUDE_DIR}
${ZLIB_INCLUDE_DIR} ${ZLIB_INCLUDE_DIR})
${LIBINTL_INCLUDE_DIR})
set(check_PROGRAMS check_convert check_filetools check_lstrings) set(check_PROGRAMS check_convert check_filetools check_lstrings)

View File

@ -23,9 +23,10 @@ else()
message(STATUS "Allow multiple definitions for cxx-compiler ${CMAKE_CXX_COMPILER_ID} not handled") message(STATUS "Allow multiple definitions for cxx-compiler ${CMAKE_CXX_COMPILER_ID} not handled")
endif() endif()
target_link_libraries(check_layout support ${intl_link} target_link_libraries(check_layout support
${Lyx_Boost_Libraries} ${QT_QTGUI_LIBRARY} ${QT_QTCORE_LIBRARY} ${Lyx_Boost_Libraries} ${QT_QTGUI_LIBRARY} ${QT_QTCORE_LIBRARY}
${ZLIB_LIBRARY} ${ICONV_LIBRARY}) ${ZLIB_LIBRARY} ${ICONV_LIBRARY})
add_dependencies(lyx_run_tests check_layout) add_dependencies(lyx_run_tests check_layout)
set_target_properties(check_layout PROPERTIES FOLDER "tests/src") set_target_properties(check_layout PROPERTIES FOLDER "tests/src")

View File

@ -51,7 +51,6 @@ target_link_libraries(${_tex2lyx}
${Lyx_Boost_Libraries} ${Lyx_Boost_Libraries}
${QT_QTCORE_LIBRARY} ${QT_QTCORE_LIBRARY}
${QT_QTGUI_LIBRARY} ${QT_QTGUI_LIBRARY}
${intl_link}
${ICONV_LIBRARY}) ${ICONV_LIBRARY})
add_dependencies(${_tex2lyx} lyx_version) add_dependencies(${_tex2lyx} lyx_version)