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