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>
7 set(_lyx "${PACKAGE_BASE}${PROGRAM_SUFFIX}")
10 include_directories(${TOP_SRC_DIR}/src)
12 add_subdirectory(frontends)
13 add_subdirectory(graphics)
14 add_subdirectory(insets)
15 add_subdirectory(mathed)
16 add_subdirectory(support)
17 add_subdirectory(tex2lyx)
19 add_subdirectory(client)
22 file(GLOB lyx_sources ${TOP_SRC_DIR}/src/${LYX_CPP_FILES})
23 file(GLOB moc_files ${TOP_SRC_DIR}/src/${LYX_MOC_FILES})
24 list(REMOVE_ITEM lyx_sources ${moc_files} .)
25 file(GLOB lyx_headers ${TOP_SRC_DIR}/src/${LYX_HPP_FILES})
27 list(REMOVE_ITEM lyx_sources
28 ${TOP_SRC_DIR}/src/Variables.cpp
29 ${TOP_SRC_DIR}/src/Section.cpp
30 ${TOP_SRC_DIR}/src/lyxcore.cpp
31 ${TOP_SRC_DIR}/src/lyxinsets.cpp
32 ${TOP_SRC_DIR}/src/lyxmathed.cpp)
34 set_property(SOURCE "${TOP_SRC_DIR}/src/version.cpp" APPEND PROPERTY COMPILE_DEFINITIONS LYX_DATE="${LYX_DATE}")
36 list(REMOVE_ITEM lyx_headers
37 ${TOP_SRC_DIR}/src/Variables.h
38 ${TOP_SRC_DIR}/src/Section.h)
41 list(REMOVE_ITEM lyx_sources ${TOP_SRC_DIR}/src/AppleSpellChecker.cpp)
42 list(REMOVE_ITEM lyx_headers ${TOP_SRC_DIR}/src/AppleSpellChecker.h)
46 list(REMOVE_ITEM lyx_sources ${TOP_SRC_DIR}/src/AspellChecker.cpp)
47 list(REMOVE_ITEM lyx_headers ${TOP_SRC_DIR}/src/AspellChecker.h)
49 set(dont_merge ${dont_merge} ${TOP_SRC_DIR}/src/AspellChecker.cpp)
53 list(REMOVE_ITEM lyx_sources ${TOP_SRC_DIR}/src/EnchantChecker.cpp)
54 list(REMOVE_ITEM lyx_headers ${TOP_SRC_DIR}/src/EnchantChecker.h)
56 set(dont_merge ${dont_merge} ${TOP_SRC_DIR}/src/EnchantChecker.cpp)
59 if(NOT HUNSPELL_FOUND)
60 list(REMOVE_ITEM lyx_sources ${TOP_SRC_DIR}/src/HunspellChecker.cpp)
61 list(REMOVE_ITEM lyx_headers ${TOP_SRC_DIR}/src/HunspellChecker.h)
63 set(dont_merge ${dont_merge} ${TOP_SRC_DIR}/src/HunspellChecker.cpp)
67 lyx_automoc(${TOP_SRC_DIR}/src/Compare.cpp)
69 lyx_automoc(${TOP_SRC_DIR}/src/Server.cpp)
72 include_directories(${CMAKE_CURRENT_BINARY_DIR}
73 ${ZLIB_INCLUDE_DIR} ${QT_INCLUDES})
79 list(REMOVE_ITEM lyx_sources ${dont_merge})
81 lyx_const_touched_files(_allinone lyx_sources)
82 set(lyx_sources ${_allinone_files} ${dont_merge})
86 configure_file(${vld_path}/vld.ini ${CMAKE_CURRENT_BINARY_DIR}/vld.ini COPYONLY)
87 set_source_files_properties(${CMAKE_CURRENT_BINARY_DIR}/memory_leak_report.txt PROPERTIES GENERATED TRUE)
88 set(vld_files ${CMAKE_CURRENT_BINARY_DIR}/vld.ini ${CMAKE_CURRENT_BINARY_DIR}/memory_leak_report.txt)
89 lyx_add_info_files(VLD ${vld_files})
93 set(FILE_RC ${TOP_SRC_DIR}/development/cmake/lyx.rc)
94 message(STATUS "Using icon defined in resource file: ${FILE_RC}")
97 lyx_find_info_files(LyXInfoFiles ${TOP_SRC_DIR}/*)
98 lyx_find_info_files(LyXCMakeFiles ${TOP_SRC_DIR}/development/cmake/*.txt)
99 lyx_find_info_files(LyXCMakeFiles ${TOP_SRC_DIR}/development/cmake/*.cmake)
100 lyx_find_info_files(LyXCMakeFiles ${TOP_SRC_DIR}/development/cmake/*.h)
101 lyx_find_info_files(LyXCMakeFiles ${TOP_SRC_DIR}/development/cmake/*.msvc)
102 lyx_find_info_files(LyXCMakeFiles ${TOP_SRC_DIR}/development/cmake/modules/*)
103 lyx_find_info_files(LyXUiFiles ${TOP_SRC_DIR}/lib/ui/*)
105 if (APPLE AND LYX_BUNDLE)
109 add_executable(${_lyx}
122 lyx_add_gcc_pch(${_lyx})
124 target_link_libraries(${_lyx}
138 target_link_libraries(${_lyx} ${HUNSPELL_LIBRARY})
141 target_link_libraries(${_lyx} ${ASPELL_LIBRARY})
144 target_link_libraries(${_lyx} ${ENCHANT_LIBRARY})
147 target_link_libraries(${_lyx} ${Magic_LIBRARY})
151 target_link_libraries(${_lyx} "-bind_at_load")
153 target_link_libraries(${_lyx} "-framework Cocoa")
155 target_link_libraries(${_lyx} "-framework AppKit")
160 target_link_libraries(${_lyx} ole32)
163 project_source_group("${GROUP_CODE}" lyx_sources lyx_headers)
166 install(TARGETS ${_lyx}
167 RUNTIME DESTINATION bin
168 BUNDLE DESTINATION .)
172 set(installed_lyx ${CMAKE_INSTALL_PREFIX}/bin/${_lyx}${CMAKE_EXECUTABLE_SUFFIX})
174 set_target_properties(${_lyx} PROPERTIES MACOSX_BUNDLE_INFO_PLIST "${CMAKE_CURRENT_BINARY_DIR}/../Info.plist")
175 set(installed_lyx ${CMAKE_INSTALL_PREFIX}/${_lyx}.app)
176 set(LYX_BUNDLE_PROPERTY_MODE "ON")
177 include("../Install")
179 install(CODE "include(BundleUtilities)
180 fixup_bundle(\"${installed_lyx}\" \"\" \"\") " COMPONENT RUNTIME)