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