lyx_mirror/intl/CMakeLists.txt
Kornel Benko 5c1666c0e1 In colaboration with Stephan Witt, adapted to our libintl to MAC
git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@38695 a592a061-630c-0410-9148-cb99ea01b6c8
2011-05-10 19:18:44 +00:00

62 lines
1.7 KiB
CMake

# This file is part of LyX, the document processor.
# Licence details can be found in the file COPYING.
#
# Copyright (c) 2006,2011 Peter Kümmel, <syntheticpp@gmx.net>
#
project(intl)
# libgnuintl.h.in => libintl.h
configure_file("${TOP_SRC_DIR}/${LYX_CMAKE_DIR}/intl/libgnuintl.h" ${CMAKE_CURRENT_BINARY_DIR}/libgnuintl.h COPYONLY)
configure_file("${TOP_SRC_DIR}/${LYX_CMAKE_DIR}/intl/libgnuintl.h" ${CMAKE_CURRENT_BINARY_DIR}/libintl.h COPYONLY)
add_definitions(
-DHAVE_CONFIG_H=1
-DMAKE_INTL_LIB
-DIN_LIBINTL
-DENABLE_RELOCATABLE=1
-DIN_LIBRARY
-DNO_XMALLOC
-Dset_relocation_prefix=libintl_set_relocation_prefix
-Drelocate=libintl_relocate
-DDEPENDS_ON_LIBICONV=1)
if(NOT APPLE)
add_definitions(
-DLOCALEDIR=\\"${LOACLE_DIR}\\"
-DLOCALE_ALIAS_PATH=\\"${LOACLE_DIR}\\"
-DLIBDIR=\\"${TOP_SRC_DIR}\\"
-DINSTALLDIR=\\"${PREFIX}\\" )
else()
add_definitions(
-DLOCALEDIR='\"${LOCALE_DIR}\"'
-DLOCALE_ALIAS_PATH='\"${LOCALE_DIR}\"'
-DLIBDIR='\"${TOP_SRC_DIR}\"'
-DINSTALLDIR='\"${PREFIX}\"' )
endif()
file(GLOB intl_headers ${TOP_SRC_DIR}/intl/*.h)
file(GLOB intl_sources RELATIVE "${TOP_SRC_DIR}/intl" "${TOP_SRC_DIR}/intl/*.c")
list(REMOVE_ITEM intl_sources vasnprintf.c version.c printf-parse.c os2compat.c intl-exports.c)
lyx_add_path(intl_sources ${TOP_SRC_DIR}/intl)
include_directories(${TOP_SRC_DIR}/intl ${CMAKE_CURRENT_BINARY_DIR})
if(ICONV_FOUND)
include_directories(${ICONV_INCLUDE_DIR})
endif()
add_library(intl STATIC ${intl_sources} ${intl_headers})
set(LIBINTL_LIBRARIES intl)
add_custom_target(intl_target DEPENDS intl)
if(ICONV_FOUND)
target_link_libraries(intl ${ICONV_LIBRARY})
endif()
project_source_group("${GROUP_CODE}" intl_sources intl_headers)