1 # This file is part of LyX, the document processor.
2 # Licence details can be found in the file COPYING.
4 # Copyright (c) 2006-2011 Peter Kümmel, <syntheticpp@gmx.net>
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} .)
13 list(APPEND dont_merge ${TOP_SRC_DIR}/src/support/AppleSpeller.m)
14 list(APPEND dont_merge ${TOP_SRC_DIR}/src/support/AppleScript.m)
17 file(GLOB support_headers ${TOP_SRC_DIR}/src/support/${LYX_HPP_FILES})
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)
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)
25 set_source_files_properties(${support_linkback_sources}
26 ${TOP_SRC_DIR}/src/support/AppleSpeller.m
27 ${TOP_SRC_DIR}/src/support/AppleScript.m
28 PROPERTIES COMPILE_FLAGS "-std=c99")
30 list(REMOVE_ITEM support_sources
31 ${TOP_SRC_DIR}/src/support/os_win32.cpp
32 ${TOP_SRC_DIR}/src/support/os_unix.cpp
33 ${TOP_SRC_DIR}/src/support/os_cygwin.cpp
34 ${TOP_SRC_DIR}/src/support/os_os2.C
35 ${TOP_SRC_DIR}/src/support/gettext.cpp)
36 if(NOT STD_STRING_USES_COW)
37 list(REMOVE_ITEM support_sources ${TOP_SRC_DIR}/src/support/trivstring.cpp)
41 message(STATUS "Mac LinkBack support")
43 set(support_linkback_sources "")
44 set(support_linkback_headers "")
47 add_subdirectory(tests)
49 # needed to compile tex2lyx in merged mode
50 set(dont_merge ${dont_merge} ${TOP_SRC_DIR}/src/support/gettext.cpp)
52 lyx_add_msvc_pch(support)
54 lyx_automoc(${support_sources})
57 ${TOP_SRC_DIR}/src/support
58 ${TOP_BINARY_DIR}/src/support
59 ${TOP_SRC_DIR}/src/support/mythes
65 if(NOT LYX_MERGE_FILES)
66 set(support_sources ${support_sources} ${support_mythes_sources} ${support_linkback_sources})
67 set(support_headers ${support_headers} ${support_mythes_headers} ${support_linkback_headers})
68 add_library(support ${library_type} ${support_sources} ${support_headers} ${dont_merge})
70 # GCC bug: gcc resolves ::bind as boost::bind
71 set(support_separate ${TOP_SRC_DIR}/src/support/socktools.cpp ${TOP_SRC_DIR}/src/support/Messages.cpp)
72 list(REMOVE_ITEM support_sources ${support_separate})
73 lyx_const_touched_files(_allinone support_sources)
74 set(depends_moc ${support_headers})
75 set_source_files_properties(_allinone_const.C
76 PROPERTIES OBJECT_DEPENDS "${depends_moc}")
77 set_source_files_properties(_allinone_touched.C
78 PROPERTIES OBJECT_DEPENDS "${depends_moc}")
79 add_library(support ${library_type} ${_allinone_files} ${support_separate}
80 ${support_mythes_sources} ${support_linkback_sources} ${support_headers} ${dont_merge})
82 set_target_properties(support PROPERTIES FOLDER "applications/LyX")
84 if(USE_MACOSX_PACKAGING AND Qt5Core_FOUND)
85 qt_use_modules(support Core Gui)
87 qt_use_modules(support Core)
90 target_link_libraries(support ${Lyx_Boost_Libraries} ${QT_QTCORE_LIBRARY} ${ZLIB_LIBRARY})
92 lyx_add_gcc_pch(support)
95 target_link_libraries(support "objc" "-framework AppKit" "-framework CoreFoundation")
96 if(CMAKE_COMPILER_IS_GNUCXX)
97 set_source_files_properties(${support_sources} PROPERTIES COMPILE_FLAGS "-fobjc-exceptions")
100 target_link_libraries(support shlwapi psapi)
103 project_source_group("${GROUP_CODE}" support_sources support_headers)