]> git.lyx.org Git - lyx.git/blob - development/cmake/intl/CMakeLists.txt
25d7ba016d70bbd540cca411221a960dd01def50
[lyx.git] / development / cmake / intl / CMakeLists.txt
1 # This file is part of LyX, the document processor.
2 # Licence details can be found in the file COPYING.
3 #
4 # Copyright (c) 2006, Peter Kümmel, <syntheticpp@gmx.net>
5 #
6
7 project(intl) 
8
9 # libgnuintl.h.in => libintl.h
10 configure_file(libgnuintl.h ${CMAKE_CURRENT_BINARY_DIR}/libgnuintl.h COPYONLY)
11 configure_file(libgnuintl.h ${CMAKE_CURRENT_BINARY_DIR}/libintl.h COPYONLY)
12
13
14 add_definitions(
15     -DHAVE_CONFIG_H=1
16     -DMAKE_INTL_LIB
17     -DIN_LIBINTL
18     -DENABLE_RELOCATABLE=1
19     -DIN_LIBRARY
20     -DNO_XMALLOC
21     -Dset_relocation_prefix=libintl_set_relocation_prefix
22     -Drelocate=libintl_relocate
23     -DDEPENDS_ON_LIBICONV=1
24     )
25     
26 if (NOT APPLE)    
27 add_definitions(
28                 -DLOCALEDIR=\\"${LOACLE_DIR}\\" 
29                 -DLOCALE_ALIAS_PATH=\\"${LOACLE_DIR}\\"
30                 -DLIBDIR=\\"${TOP_SRC_DIR}\\"
31                 -DINSTALLDIR=\\"${PREFIX}\\" 
32                 )
33 else (NOT APPLE) 
34 add_definitions(
35                 -DLOCALEDIR='\"${LOCALE_DIR}\"' 
36                 -DLOCALE_ALIAS_PATH='\"${LOCALE_DIR}\"'
37                 -DLIBDIR='\"${TOP_SRC_DIR}\"'
38                 -DINSTALLDIR='\"${PREFIX}\"' 
39                 )
40 endif (NOT APPLE)
41
42 file(GLOB intl_headers ${TOP_SRC_DIR}/intl/*.h)
43
44 set(intl_sources 
45       bindtextdom.c
46       dcgettext.c
47       dgettext.c
48       gettext.c
49       finddomain.c
50       loadmsgcat.c
51       localealias.c
52       textdomain.c
53       l10nflist.c
54       explodename.c
55       dcigettext.c
56       dcngettext.c
57       dngettext.c
58       ngettext.c
59       plural.c
60       plural-exp.c
61       localcharset.c
62       relocatable.c
63       localename.c
64       log.c
65       printf.c
66       osdep.c
67       intl-compat.c
68 )
69
70 lyx_add_path(intl_sources ${TOP_SRC_DIR}/intl)
71
72 include_directories(${TOP_SRC_DIR}/intl ${CMAKE_CURRENT_BINARY_DIR})
73
74 if(ICONV_FOUND)
75         include_directories(${ICONV_INCLUDE_DIR})
76 endif(ICONV_FOUND)
77
78 add_library(intl STATIC ${intl_sources} ${intl_headers})
79
80 if(ICONV_FOUND)
81         target_link_libraries(intl ${ICONV_LIBRARY})
82 endif(ICONV_FOUND)
83
84 project_source_group("${GROUP_CODE}" intl_sources intl_headers)
85