]> git.lyx.org Git - lyx.git/blob - intl/CMakeLists.txt
MultilingualCaptions.lyx : Correct a typo and a bad link.
[lyx.git] / 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,2011 Peter Kümmel, <syntheticpp@gmx.net>
5 #
6
7 project(intl) 
8
9 # libgnuintl.h.in => libintl.h
10 configure_file("${TOP_SRC_DIR}/intl/libgnuintl.h.cmake" ${CMAKE_BINARY_DIR}/intl/libgnuintl.h)
11 configure_file("${TOP_SRC_DIR}/intl/libgnuintl.h.cmake" ${CMAKE_BINARY_DIR}/intl/libintl.h)
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 if(NOT APPLE)    
26         add_definitions(
27                 -DLOCALEDIR=\\"${LOACLE_DIR}\\" 
28                 -DLOCALE_ALIAS_PATH=\\"${LOACLE_DIR}\\"
29                 -DLIBDIR=\\"${TOP_SRC_DIR}\\"
30                 -DINSTALLDIR=\\"${PREFIX}\\" )
31 else()
32         add_definitions(
33                 -DLOCALEDIR='\"${LOCALE_DIR}\"' 
34                 -DLOCALE_ALIAS_PATH='\"${LOCALE_DIR}\"'
35                 -DLIBDIR='\"${TOP_SRC_DIR}\"'
36                 -DINSTALLDIR='\"${PREFIX}\"' )
37 endif()
38
39 file(GLOB intl_headers ${TOP_SRC_DIR}/intl/*.h)
40
41 file(GLOB intl_sources RELATIVE "${TOP_SRC_DIR}/intl" "${TOP_SRC_DIR}/intl/*.c")
42 list(REMOVE_ITEM intl_sources vasnprintf.c version.c printf-parse.c os2compat.c intl-exports.c)
43
44 lyx_add_path(intl_sources ${TOP_SRC_DIR}/intl)
45
46 include_directories(${TOP_SRC_DIR}/intl ${CMAKE_CURRENT_BINARY_DIR})
47
48 if(ICONV_FOUND)
49         include_directories(${ICONV_INCLUDE_DIR})
50 endif()
51
52 add_library(intl STATIC ${intl_sources} ${intl_headers})
53
54 get_target_property(libintl_location intl LOCATION)
55 set(LIBINTL_LIBRARIES ${libintl_location} CACHE STRING "libintl library" FORCE)
56
57 find_path(LIBINTL_INCLUDE_DIR intl/libintl.h
58         PATHS ${CMAKE_BINARY_DIR} NO_DEFAULT_PATH)
59         
60 find_file(LIBINTL_HEADER intl/libintl.h
61         PATHS ${CMAKE_BINARY_DIR} NO_DEFAULT_PATH)
62                 
63 if(ICONV_FOUND)
64         target_link_libraries(intl ${ICONV_LIBRARY})
65 endif()
66
67 project_source_group("${GROUP_CODE}" intl_sources intl_headers)
68