robin/laufey

git clone https://git.robinwobin.dev/robin/laufey

Johnny Shawfix: deps build for ARM64 MSVC7737f89206

master
17.2 KiB338 linesraw
1cmake_minimum_required(VERSION 3.16)
2project(gettext C)
3
4add_compile_options(-w)
5set(CMAKE_STATIC_LINKER_FLAGS "${CMAKE_STATIC_LINKER_FLAGS} /ignore:4006")
6
7# Adds PREFIX to each item in LIST
8macro(PREFIX_LIST_ITEMS LIST PREFIX)
9  string(REPLACE ";" ";${PREFIX}" ${LIST} ";${${LIST}}")
10endmacro()
11
12file(READ gettext-runtime/config.h.in CONFIG_CONTENT)
13string(REPLACE "#undef HAVE_GETCWD" "#define HAVE_GETCWD 1" CONFIG_CONTENT ${CONFIG_CONTENT})
14string(REPLACE "#undef HAVE_LONG_LONG_INT" "#define HAVE_LONG_LONG_INT 1" CONFIG_CONTENT ${CONFIG_CONTENT})
15string(REPLACE "#undef HAVE_ICONV_H" "#define HAVE_ICONV_H 1" CONFIG_CONTENT ${CONFIG_CONTENT})
16string(REPLACE "#undef HAVE_ICONV" "#define HAVE_ICONV 1" CONFIG_CONTENT ${CONFIG_CONTENT})
17string(REPLACE "#undef ICONV_CONST" "#define ICONV_CONST const" CONFIG_CONTENT ${CONFIG_CONTENT})
18if(MSVC)
19  string(REPLACE "#undef HAVE_STDINT_H_WITH_UINTMAX" "#define HAVE_STDINT_H_WITH_UINTMAX 1" CONFIG_CONTENT ${CONFIG_CONTENT})
20  string(REPLACE "#undef HAVE_STDINT_H" "#define HAVE_STDINT_H 1" CONFIG_CONTENT ${CONFIG_CONTENT})
21else()
22  string(REPLACE "#undef uintmax_t" "
23    #if _WIN64
24    # define intmax_t long long
25    # define uintmax_t unsigned long long
26    #elif _WIN32
27    # define intmax_t long
28    # define uintmax_t unsigned long
29    #endif"
30    CONFIG_CONTENT ${CONFIG_CONTENT})
31  endif()
32file(WRITE ${CMAKE_CURRENT_BINARY_DIR}/gettext-runtime/config.h ${CONFIG_CONTENT})
33
34set(HAVE_NEWLOCALE 0)
35set(HAVE_POSIX_PRINTF 0)
36set(HAVE_SNPRINTF 0)
37set(HAVE_ASPRINTF 0)
38set(HAVE_WPRINTF 0)
39set(HAVE_NAMELESS_LOCALES 0)
40set(HAVE_LONG_LONG_INT 1)
41configure_file(gettext-runtime/intl/libgnuintl.in.h
42  ${CMAKE_CURRENT_BINARY_DIR}/gettext-runtime/intl/libgnuintl.h)
43
44set(LOCALDIR "gettext")
45set(LIBDIR "gettext")
46set(PKGDATADIR "gettext")
47set(PACKAGE_SUFFIX "gettext")
48add_definitions(-DLOCALEDIR=\"${LOCALDIR}\"
49  -DLOCALE_ALIAS_PATH=\"${LOCALDIR}\"
50  -DLIBDIR=\"${LOCALDIR}\"
51  -DINSTALLDIR=\"${LOCALDIR}\"
52  -DEXEEXT=\".exe\"
53  -DLOCALEDIR=\"${LOCALDIR}\"
54  -DLIBDIR=\"${LIBDIR}\"
55  -DPACKAGE_SUFFIX=\"${PACKAGE_SUFFIX}\"
56  -DGETTEXTDATADIR=\"${PKGDATADIR}\"
57  -DBISON_LOCALEDIR=\"${LOCALDIR}\"
58  -DHAVE_CONFIG_H)
59
60set(libintl_SOURCES
61  bindtextdom.c dcgettext.c dcigettext.c dcngettext.c dgettext.c dngettext.c
62  explodename.c finddomain.c gettext.c hash-string.c intl-compat.c l10nflist.c
63  langprefs.c loadmsgcat.c localcharset.c localealias.c localename-table.c
64  localename.c lock.c log.c ngettext.c osdep.c
65  plural-exp.c plural.c printf.c relocatable.c setlocale.c textdomain.c
66  threadlib.c version.c xsize.c)
67
68PREFIX_LIST_ITEMS(libintl_SOURCES "gettext-runtime/intl/")
69
70add_library(libintl ${libintl_SOURCES})
71target_link_libraries(libintl ${LIBICONV_LIBRARIES})
72set_property(TARGET libintl APPEND PROPERTY INCLUDE_DIRECTORIES
73  ${CMAKE_CURRENT_BINARY_DIR}/gettext-runtime
74  ${CMAKE_CURRENT_BINARY_DIR}/gettext-runtime/intl
75  ${LIBICONV_INCLUDE_DIRS})
76set_property(TARGET libintl APPEND PROPERTY COMPILE_DEFINITIONS
77  BUILDING_LIBINTL
78  IN_LIBINTL
79  ENABLE_RELOCATABLE=1
80  IN_LIBRARY
81  NO_XMALLOC
82  set_relocation_prefix=libintl_set_relocation_prefix
83  relocate=libintl_relocate
84  HAVE_CONFIG_H)
85
86
87file(READ gettext-tools/config.h.in CONFIG_CONTENT)
88string(REPLACE "#undef FLEXIBLE_ARRAY_MEMBER" "#define FLEXIBLE_ARRAY_MEMBER 1" CONFIG_CONTENT ${CONFIG_CONTENT})
89string(REPLACE "__declspec (dllimport)" "" CONFIG_CONTENT ${CONFIG_CONTENT})
90string(REPLACE "#undef ENDIANNESS" "#define ENDIANNESS 0" CONFIG_CONTENT ${CONFIG_CONTENT})
91string(REPLACE "#undef GNULIB_FWRITEERROR" "#define GNULIB_FWRITEERROR 1" CONFIG_CONTENT ${CONFIG_CONTENT})
92string(REPLACE "#undef HAVE_DECL_STRERROR_R" "#define HAVE_DECL_STRERROR_R 0" CONFIG_CONTENT ${CONFIG_CONTENT})
93string(REPLACE "#undef HAVE_DUP2" "#define HAVE_DUP2 1" CONFIG_CONTENT ${CONFIG_CONTENT})
94string(REPLACE "#undef HAVE_ICONV_H" "#define HAVE_ICONV_H 1" CONFIG_CONTENT ${CONFIG_CONTENT})
95string(REPLACE "#undef HAVE_ICONV" "#define HAVE_ICONV 1" CONFIG_CONTENT ${CONFIG_CONTENT})
96string(REPLACE "#undef HAVE_LIBUNISTRING" "#define HAVE_LIBUNISTRING 1" CONFIG_CONTENT ${CONFIG_CONTENT})
97string(REPLACE "#undef HAVE_STDINT_H_WITH_UINTMAX" "#define HAVE_STDINT_H_WITH_UINTMAX 1" CONFIG_CONTENT ${CONFIG_CONTENT})
98string(REPLACE "#undef HAVE_STDINT_H" "#define HAVE_STDINT_H 1" CONFIG_CONTENT ${CONFIG_CONTENT})
99string(REPLACE "#undef HAVE_LONG_LONG_INT" "#define HAVE_LONG_LONG_INT 1" CONFIG_CONTENT ${CONFIG_CONTENT})
100string(REPLACE "#undef HAVE_STRING_H" "#define HAVE_STRING_H 1" CONFIG_CONTENT ${CONFIG_CONTENT})
101string(REPLACE "#undef HAVE_SYS_TIMEB_H" "#define HAVE_SYS_TIMEB_H 1" CONFIG_CONTENT ${CONFIG_CONTENT})
102string(REPLACE "#undef HAVE__FTIME" "#define HAVE__FTIME 1" CONFIG_CONTENT ${CONFIG_CONTENT})
103string(REPLACE "#undef HAVE_FLOAT_H" "#define HAVE_FLOAT_H 1" CONFIG_CONTENT ${CONFIG_CONTENT})
104string(REPLACE "#undef ICONV_CONST" "#define ICONV_CONST const" CONFIG_CONTENT ${CONFIG_CONTENT})
105string(REPLACE "#undef PACKAGE" "#define PACKAGE \"gettext\"\n#define gettext_VERSION" CONFIG_CONTENT ${CONFIG_CONTENT})
106string(REPLACE "#undef VERSION" "#define VERSION \"\"" CONFIG_CONTENT ${CONFIG_CONTENT})
107string(REPLACE "#undef mode_t" "#define mode_t int" CONFIG_CONTENT ${CONFIG_CONTENT})
108string(REPLACE "#undef pid_t" "#define pid_t int" CONFIG_CONTENT ${CONFIG_CONTENT})
109string(REPLACE "#undef restrict" "#define restrict __restrict" CONFIG_CONTENT ${CONFIG_CONTENT})
110string(REPLACE "#undef ssize_t" "#include <BaseTsd.h>\n#define ssize_t SSIZE_T" CONFIG_CONTENT ${CONFIG_CONTENT})
111string(REPLACE "#undef uid_t" "#define uid_t int" CONFIG_CONTENT ${CONFIG_CONTENT})
112string(REPLACE "#undef HAVE_DECL___ARGV" "#define HAVE_DECL___ARGV 1" CONFIG_CONTENT ${CONFIG_CONTENT})
113set(CONFIG_CONTENT "${CONFIG_CONTENT}\n#define isatty libtextstyle_isatty")
114file(WRITE ${CMAKE_CURRENT_BINARY_DIR}/gettext-tools/config.h ${CONFIG_CONTENT})
115
116set(libgettextsrc_COMMON_SOURCE
117  message.c po-error.c po-xerror.c read-catalog-abstract.c po-lex.c
118  po-gram-gen.c po-charset.c read-po.c read-properties.c read-stringtable.c
119  open-catalog.c dir-list.c str-list.c)
120
121set(libgettextsrc_FORMAT_SOURCE
122  format.c format-invalid.h format-c.c format-c-parse.h format-sh.c
123  format-python.c format-python-brace.c format-lisp.c format-elisp.c
124  format-librep.c format-scheme.c format-java.c format-csharp.c format-awk.c
125  format-pascal.c format-ycp.c format-tcl.c format-perl.c format-perl-brace.c
126  format-php.c format-gcc-internal.c format-gfc-internal.c format-qt.c
127  format-qt-plural.c format-kde.c format-kde-kuit.c format-boost.c format-lua.c
128  format-javascript.c)
129
130set(libgettextsrc_SOURCES
131  ${libgettextsrc_COMMON_SOURCE} read-catalog.c
132  write-catalog.c write-properties.c write-stringtable.c write-po.c
133  msgl-ascii.c msgl-iconv.c msgl-equal.c msgl-cat.c msgl-header.c msgl-english.c
134  msgl-check.c file-list.c msgl-charset.c po-time.c plural-exp.c plural-eval.c
135  plural-table.c quote.h sentence.h sentence.c
136  ${libgettextsrc_FORMAT_SOURCE}
137  read-desktop.c locating-rule.c its.c search-path.c)
138PREFIX_LIST_ITEMS(libgettextsrc_SOURCES "gettext-tools/src/")
139
140set(GLIBC_SOURCE
141  uniname/uniname.c javaexec.c unsetenv.c classpath.c setenv.c xsetenv.c
142  sh-quote.c execute.c javaversion.c csharpcomp.c csharpexec.c javacomp.c
143  gettimeofday.c getdtablesize.c fcntl.c dup-safer-flag.c cloexec.c
144  fd-safer-flag.c fd-safer.c pipe2.c pipe2-safer.c spawn-pipe.c xmemdup0.c
145  secure_getenv.c tmpdir.c tempname.c mkdtemp.c fnmatch.c clean-temp.c
146  wait-process.c waitpid.c getdelim.c getline.c sigprocmask.c sigaction.c
147  addext.c argmatch.c backupfile.c basename.c c-strcasecmp.c c-strncasecmp.c
148  c-strstr.c closeout.c concat-filename.c error-progname.c error.c exitfail.c
149  fstrcmp.c full-write.c fwriteerror.c getopt.c getopt1.c hash.c libxml/buf.c
150  localcharset.c malloca.c mbchar.c mbslen.c mbsstr.c mbswidth.c obstack.c
151  progname.c printf-args.c printf-parse.c propername.c quotearg.c rawmemchr.c
152  safe-read.c safe-write.c stpcpy.c stpncpy.c strchrnul.c striconv.c
153  striconveh.c striconveha.c strnlen1.c trim.c gcd.c gl_linkedhash_list.c
154  uniconv/u8-conv-from-enc.c unictype/ctype_space.c unilbrk/lbrktables.c
155  unilbrk/u8-possible-linebreaks.c unilbrk/u8-width-linebreaks.c
156  unilbrk/ulc-common.c unilbrk/ulc-width-linebreaks.c unistr/u16-mbtouc-aux.c
157  unistr/u16-mbtouc.c unistr/u8-check.c unistr/u8-mblen.c
158  unistr/u8-mbtouc-aux.c unistr/u8-mbtouc-unsafe-aux.c
159  unistr/u8-mbtouc-unsafe.c unistr/u8-mbtouc.c unistr/u8-mbtoucr.c
160  unistr/u8-prev.c unistr/u8-uctomb-aux.c unistr/u8-uctomb.c uniwidth/width.c
161  vasnprintf.c vasprintf.c wcwidth.c xasprintf.c xconcat-filename.c xerror.c
162  xmalloc.c xstrdup.c xstriconv.c xstriconveh.c xvasprintf.c
163  libxml/DOCBparser.c libxml/HTMLparser.c libxml/HTMLtree.c libxml/SAX.c
164  libxml/SAX2.c libxml/c14n.c libxml/catalog.c libxml/chvalid.c
165  libxml/debugXML.c libxml/dict.c libxml/encoding.c libxml/entities.c
166  libxml/error.c libxml/globals.c libxml/hash.c libxml/legacy.c libxml/list.c
167  libxml/nanoftp.c libxml/nanohttp.c libxml/parser.c libxml/parserInternals.c
168  libxml/pattern.c libxml/relaxng.c libxml/schematron.c libxml/threads.c
169  libxml/tree.c libxml/trionan.c libxml/uri.c libxml/valid.c libxml/xinclude.c
170  libxml/xlink.c libxml/xmlIO.c libxml/xmlmemory.c libxml/xmlmodule.c
171  libxml/xmlreader.c libxml/xmlregexp.c libxml/xmlsave.c libxml/xmlschemas.c
172  libxml/xmlschemastypes.c libxml/xmlstring.c libxml/xmlunicode.c
173  libxml/xmlwriter.c libxml/xpath.c libxml/xpointer.c fatal-signal.c
174  copy-file.c read-file.c ftello.c utime.c gettime.c utimens.c)
175PREFIX_LIST_ITEMS(GLIBC_SOURCE "gettext-tools/gnulib-lib/")
176
177file(WRITE ${CMAKE_CURRENT_BINARY_DIR}/gettext-tools/gnulib-lib/configmake.h "#define PKGDATADIR \"gettext\"")
178
179set(LIBGLIB_SOURCES
180  ghash.c glist.c gmessages.c gprimes.c gstrfuncs.c gstring.c)
181PREFIX_LIST_ITEMS(LIBGLIB_SOURCES "libtextstyle/lib/glib/")
182
183set(LIBTEXTSTYLE_SOURCE
184  gl_array_list.h gl_array_list.c binary-io.h
185  binary-io.c c-ctype.h c-ctype.c c-strcase.h c-strcasecmp.c
186  c-strncasecmp.c concat-filename.c dirname-lgpl.c
187  basename-lgpl.c stripslash.c exitfail.c fatal-signal.h
188  fatal-signal.c fd-hook.c fd-ostream.c file-ostream.c
189  full-write.h full-write.c getprogname.h getprogname.c
190  gettext.h hash.h hash.c html-ostream.c html-styled-ostream.c
191  iconv-ostream.c gl_list.h gl_list.c math.c memory-ostream.c
192  minmax.h noop-styled-ostream.c ostream.c safe-read.c
193  safe-write.c sig-handler.c size_max.h styled-ostream.c
194  term-ostream.c term-style-control.c term-styled-ostream.c
195  unistd.c xalloc.h xmalloc.c xstrdup.c
196  xconcat-filename.c gl_xlist.h gl_xlist.c xsize.h xsize.c
197  xvasprintf.h xvasprintf.c xasprintf.c color.h color.c misc.h
198  misc.c version.c isatty.c fsync.c tparm.c tputs.c)
199PREFIX_LIST_ITEMS(LIBTEXTSTYLE_SOURCE "libtextstyle/lib/")
200
201configure_file(
202  libtextstyle/lib/stdbool.mini.h
203  ${CMAKE_CURRENT_BINARY_DIR}/libtextstyle/lib/textstyle/stdbool.h
204  COPYONLY)
205
206set(LIBCROCO_SOURCES
207  cr-additional-sel.c cr-attr-sel.c cr-cascade.c cr-declaration.c
208  cr-doc-handler.c cr-enc-handler.c cr-fonts.c cr-input.c cr-num.c
209  cr-om-parser.c cr-parser.c cr-parsing-location.c cr-prop-list.c cr-pseudo.c
210  cr-rgb.c cr-sel-eng.c cr-selector.c cr-simple-sel.c cr-statement.c
211  cr-string.c cr-style.c cr-stylesheet.c cr-term.c cr-tknzr.c cr-token.c
212  cr-utils.c)
213PREFIX_LIST_ITEMS(LIBCROCO_SOURCES "libtextstyle/lib/libcroco/")
214
215set(libgettextsrc_SOURCES
216  ${libgettextsrc_SOURCES} ${GLIBC_SOURCE} ${LIBGLIB_SOURCES}
217  ${LIBTEXTSTYLE_SOURCE} ${LIBCROCO_SOURCES})
218
219macro(CONFIGURE_HEADER_FILES HEADER_TEMPLATES_PATH)
220  set(HEADER_TEMPLATES_ABS_PATH "${CMAKE_CURRENT_SOURCE_DIR}/${HEADER_TEMPLATES_PATH}")
221  file(GLOB_RECURSE HEADER_TEMPLATES "${HEADER_TEMPLATES_ABS_PATH}/*.in.h")
222  list(REMOVE_ITEM HEADER_TEMPLATES  "${HEADER_TEMPLATES_ABS_PATH}/stdint.in.h")
223  list(REMOVE_ITEM HEADER_TEMPLATES  "${HEADER_TEMPLATES_ABS_PATH}/wchar.in.h")
224  foreach(HEADER_TEMPLATE ${HEADER_TEMPLATES})
225    file(READ ${HEADER_TEMPLATE} HEADER_CONTENT)
226    string(REPLACE "/* The definition of _GL_ARG_NONNULL is copied here.  */" "#include \"arg-nonnull.h\"" HEADER_CONTENT "${HEADER_CONTENT}")
227    string(REPLACE "/* The definition of _GL_WARN_ON_USE is copied here.  */" "#include \"warn-on-use.h\"" HEADER_CONTENT "${HEADER_CONTENT}")
228    string(REPLACE "/* The definitions of _GL_FUNCDECL_RPL etc. are copied here.  */" "#include \"c++defs.h\"" HEADER_CONTENT "${HEADER_CONTENT}")
229    string(REPLACE "@GNULIB_LSTAT@" "1" HEADER_CONTENT "${HEADER_CONTENT}")
230    string(REPLACE "@GNULIB_MBSINIT@" "1" HEADER_CONTENT "${HEADER_CONTENT}")
231    string(REPLACE "@GNULIB_SIGACTION@" "1" HEADER_CONTENT "${HEADER_CONTENT}")
232    string(REPLACE "@GNULIB_SIGPROCMASK@" "1" HEADER_CONTENT "${HEADER_CONTENT}")
233    string(REPLACE "@GNULIB_STPCPY@" "1" HEADER_CONTENT "${HEADER_CONTENT}")
234    string(REPLACE "@GNULIB_STPNCPY@" "1" HEADER_CONTENT "${HEADER_CONTENT}")
235    string(REPLACE "@GNULIB_STRCHRNUL@" "1" HEADER_CONTENT "${HEADER_CONTENT}")
236    string(REPLACE "@HAVE_ISWCNTRL@" "1" HEADER_CONTENT "${HEADER_CONTENT}")
237    string(REPLACE "@HAVE_WCTYPE_T@" "1" HEADER_CONTENT "${HEADER_CONTENT}")
238    string(REPLACE "@HAVE_STRUCT_TIMEVAL@" "1" HEADER_CONTENT "${HEADER_CONTENT}")
239    string(REPLACE "@HAVE_WINSOCK2_H@" "1" HEADER_CONTENT "${HEADER_CONTENT}")
240    string(REPLACE "@DLL_VARIABLE@" "" HEADER_CONTENT "${HEADER_CONTENT}")
241    string(REPLACE "@HAVE_NEWLOCALE@" "0" HEADER_CONTENT "${HEADER_CONTENT}")
242    string(REPLACE "@PRAGMA_COLUMNS@" "" HEADER_CONTENT "${HEADER_CONTENT}")
243    string(REPLACE "#if @GNULIB_UTIME@" "#if 1\n#define utime gl_utime" HEADER_CONTENT "${HEADER_CONTENT}")
244    string(REPLACE "@HAVE_UTIME@" "1" HEADER_CONTENT "${HEADER_CONTENT}")
245    string(REPLACE "@HAVE_LONG_LONG_INT@" "1" HEADER_CONTENT "${HEADER_CONTENT}")
246
247    string(REGEX REPLACE "^${HEADER_TEMPLATES_ABS_PATH}/" "" HEADER_PATH "${HEADER_TEMPLATE}")
248    string(REPLACE ".in" "" HEADER_PATH ${HEADER_PATH})
249    string(REPLACE "_" "/" HEADER_PATH ${HEADER_PATH})
250    # find_file will create a cache entry for the variable
251    # SYSTEM_HEADER, so reset it before each call
252    set(SYSTEM_HEADER "SYSTEM_HEADER-NOTFOUND")
253    find_file(SYSTEM_HEADER ${HEADER_PATH} PATHS "${LIBICONV_INCLUDE_DIRS}")
254    if(SYSTEM_HEADER)
255      # Gnulib uses #include_next to extend system header files,
256      # but MSVC doesn't support it, so a regular include directive
257      # with a relative path is used instead
258      string(REGEX REPLACE ".*/(.*/${HEADER_PATH})" "../\\1"
259        INCLUDE_PATH "${SYSTEM_HEADER}")
260      string(REGEX REPLACE "@INCLUDE_NEXT[^@]*@ @NEXT_[^@\n]+@"
261        "include <${INCLUDE_PATH}>" HEADER_CONTENT "${HEADER_CONTENT}")
262    endif()
263
264    # Default any remaining template variables to 0
265    string(REGEX REPLACE "@[^@\n]+@" "0" HEADER_CONTENT "${HEADER_CONTENT}")
266
267    file(WRITE "${CMAKE_CURRENT_BINARY_DIR}/${HEADER_TEMPLATES_PATH}/${HEADER_PATH}" "${HEADER_CONTENT}")
268  endforeach()
269endmacro()
270
271CONFIGURE_HEADER_FILES("gettext-tools/gnulib-lib")
272CONFIGURE_HEADER_FILES("libtextstyle/lib")
273
274add_library(libgettextsrc ${libgettextsrc_SOURCES})
275target_link_libraries(libgettextsrc ${LIBICONV_LIBRARIES})
276set_property(TARGET libgettextsrc APPEND PROPERTY COMPILE_DEFINITIONS
277  LIBTEXTSTYLE_DLL_VARIABLE=)
278
279set(msgmerge_SOURCES
280  msgmerge.c msgl-fsearch.c lang-table.c plural-count.c)
281PREFIX_LIST_ITEMS(msgmerge_SOURCES "gettext-tools/src/")
282
283add_executable(msgmerge ${msgmerge_SOURCES})
284target_link_libraries(msgmerge libgettextsrc)
285add_dependencies(msgmerge libgettextsrc libintl)
286
287set(msgfmt_SOURCES
288  msgfmt.c write-mo.c write-java.c write-csharp.c write-resources.c write-tcl.c
289  write-qt.c write-desktop.c write-xml.c
290  ../../gettext-runtime/intl/hash-string.c)
291PREFIX_LIST_ITEMS(msgfmt_SOURCES "gettext-tools/src/")
292
293add_executable(msgfmt ${msgfmt_SOURCES})
294target_link_libraries(msgfmt libgettextsrc)
295add_dependencies(msgfmt libgettextsrc libintl)
296
297set(xgettext_SOURCES
298  xgettext.c xg-pos.c xg-encoding.c xg-mixed-string.c xg-arglist-context.c
299  xg-arglist-callshape.c xg-arglist-parser.c xg-message.c x-c.c x-po.c x-sh.c
300  x-python.c x-lisp.c x-elisp.c x-librep.c x-scheme.c x-smalltalk.c x-java.c
301  x-csharp.c x-awk.c x-ycp.c x-tcl.c x-perl.c x-php.c x-rst.c x-lua.c
302  x-javascript.c x-vala.c x-desktop.c)
303PREFIX_LIST_ITEMS(xgettext_SOURCES "gettext-tools/src/")
304
305add_executable(xgettext ${xgettext_SOURCES})
306target_link_libraries(xgettext libgettextsrc)
307add_dependencies(xgettext libgettextsrc libintl)
308
309set_property(TARGET msgmerge msgfmt xgettext libgettextsrc APPEND PROPERTY
310  INCLUDE_DIRECTORIES
311    ${CMAKE_CURRENT_SOURCE_DIR}/gettext-runtime/intl
312    ${CMAKE_CURRENT_SOURCE_DIR}/gettext-tools/libgettextpo
313    ${CMAKE_CURRENT_SOURCE_DIR}/gettext-tools/gnulib-lib
314    ${CMAKE_CURRENT_SOURCE_DIR}/gettext-tools/gnulib-lib/libcroco
315    ${CMAKE_CURRENT_SOURCE_DIR}/build-aux/snippet
316    ${CMAKE_CURRENT_SOURCE_DIR}/libtextstyle/lib
317    ${CMAKE_CURRENT_SOURCE_DIR}/libtextstyle/lib/libcroco
318    ${CMAKE_CURRENT_BINARY_DIR}/gettext-runtime/intl
319    ${CMAKE_CURRENT_BINARY_DIR}/gettext-tools
320    ${CMAKE_CURRENT_BINARY_DIR}/gettext-tools/gnulib-lib
321    ${CMAKE_CURRENT_BINARY_DIR}/libtextstyle/lib
322    ${CMAKE_CURRENT_BINARY_DIR}/libtextstyle/lib/textstyle
323    ${LIBICONV_INCLUDE_DIRS})
324
325include(GNUInstallDirs)
326
327install(FILES
328  ${CMAKE_CURRENT_BINARY_DIR}/gettext-runtime/intl/libgnuintl.h
329  DESTINATION ${CMAKE_INSTALL_INCLUDEDIR}
330  RENAME libintl.h)
331
332install(TARGETS libintl msgmerge msgfmt xgettext
333  ARCHIVE DESTINATION ${CMAKE_INSTALL_LIBDIR}
334  LIBRARY DESTINATION ${CMAKE_INSTALL_LIBDIR}
335  PUBLIC_HEADER DESTINATION ${CMAKE_INSTALL_INCLUDEDIR}
336  RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR})
337
338# vim: set ft=cmake: