]> git.lyx.org Git - lyx.git/blob - src/support/CMakeLists.txt
C++ style to avoid compiler warning for non-NLS implementation of Messages::available
[lyx.git] / src / support / 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(support)
8
9 file(GLOB support_sources ${TOP_SRC_DIR}/src/support/${LYX_CPP_FILES})
10 file(GLOB moc_files ${TOP_SRC_DIR}/src/support/${LYX_MOC_FILES})
11 list(REMOVE_ITEM support_sources ${moc_files} .)
12 if(APPLE)
13         list(APPEND dont_merge ${TOP_SRC_DIR}/src/support/AppleSpeller.m)
14         list(APPEND dont_merge ${TOP_SRC_DIR}/src/support/AppleScript.m)
15 endif()
16
17 file(GLOB support_headers ${TOP_SRC_DIR}/src/support/${LYX_HPP_FILES})
18
19 file(GLOB support_mythes_sources ${TOP_SRC_DIR}/src/support/mythes/*.cxx)
20 file(GLOB support_mythes_headers ${TOP_SRC_DIR}/src/support/mythes/*.hxx)
21
22 file(GLOB support_linkback_sources ${TOP_SRC_DIR}/src/support/linkback/*.m*)
23 file(GLOB support_linkback_headers ${TOP_SRC_DIR}/src/support/linkback/*.h)
24
25 list(REMOVE_ITEM support_sources
26         ${TOP_SRC_DIR}/src/support/os_win32.cpp
27         ${TOP_SRC_DIR}/src/support/os_unix.cpp
28         ${TOP_SRC_DIR}/src/support/os_cygwin.cpp
29         ${TOP_SRC_DIR}/src/support/os_os2.C
30         ${TOP_SRC_DIR}/src/support/atexit.c
31         ${TOP_SRC_DIR}/src/support/strerror.c
32         ${TOP_SRC_DIR}/src/support/gettext.cpp)
33
34 if(APPLE)
35         message(STATUS "Mac LinkBack support")
36 else()
37         set(support_linkback_sources "")
38         set(support_linkback_headers "")
39 endif()
40
41 # needed to compile tex2lyx in merged mode
42 set(dont_merge ${dont_merge} ${TOP_SRC_DIR}/src/support/gettext.cpp)
43
44 lyx_add_msvc_pch(support)
45
46 lyx_automoc(${support_sources})
47
48 include_directories(
49         ${TOP_SRC_DIR}/src/support
50         ${TOP_BINARY_DIR}/src/support
51         ${TOP_SRC_DIR}/src/support/mythes
52         ${QT_INCLUDES}
53         ${ICONV_INCLUDE_DIR}
54         ${ZLIB_INCLUDE_DIR}
55         ${LIBINTL_INCLUDE_DIR})
56
57
58 if(NOT LYX_MERGE_FILES)
59         set(support_sources ${support_sources} ${support_mythes_sources} ${support_linkback_sources})
60         set(support_headers ${support_headers} ${support_mythes_headers} ${support_linkback_headers})
61         add_library(support ${library_type} ${support_sources} ${support_headers} ${dont_merge})
62 else()
63         # GCC bug: gcc resolves ::bind as boost::bind
64         set(support_separate ${TOP_SRC_DIR}/src/support/socktools.cpp ${TOP_SRC_DIR}/src/support/Messages.cpp)
65         list(REMOVE_ITEM support_sources ${support_separate})
66         lyx_const_touched_files(_allinone  support_sources)
67         set(depends_moc ${support_headers})
68         set_source_files_properties(_allinone_const.C
69                 PROPERTIES OBJECT_DEPENDS "${depends_moc}")
70         set_source_files_properties(_allinone_touched.C
71                 PROPERTIES OBJECT_DEPENDS "${depends_moc}")
72         add_library(support ${library_type} ${_allinone_files} ${support_separate}
73                 ${support_mythes_sources} ${support_linkback_sources} ${support_headers} ${dont_merge})
74 endif()
75
76 target_link_libraries(support ${Lyx_Boost_Libraries} ${QT_QTCORE_LIBRARY} ${ZLIB_LIBRARY})
77
78 lyx_add_gcc_pch(support)
79
80 if(APPLE)
81         target_link_libraries(support "objc" "-framework AppKit" "-framework CoreFoundation")
82 elseif(WIN32)
83         target_link_libraries(support shlwapi psapi)
84 endif()
85
86 project_source_group("${GROUP_CODE}" support_sources support_headers)
87