1 # This file is part of LyX, the document processor.
2 # Licence details can be found in the file COPYING.
4 # Copyright (c) 2006, 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 list(REMOVE_ITEM lyx_headers
35 ${TOP_SRC_DIR}/src/Variables.h
36 ${TOP_SRC_DIR}/src/Section.h)
39 list(REMOVE_ITEM lyx_sources ${TOP_SRC_DIR}/src/AppleSpellChecker.cpp)
40 list(REMOVE_ITEM lyx_headers ${TOP_SRC_DIR}/src/AppleSpellChecker.h)
44 list(REMOVE_ITEM lyx_sources ${TOP_SRC_DIR}/src/AspellChecker.cpp)
45 list(REMOVE_ITEM lyx_headers ${TOP_SRC_DIR}/src/AspellChecker.h)
47 set(dont_merge ${dont_merge} ${TOP_SRC_DIR}/src/AspellChecker.cpp)
51 list(REMOVE_ITEM lyx_sources ${TOP_SRC_DIR}/src/EnchantChecker.cpp)
52 list(REMOVE_ITEM lyx_headers ${TOP_SRC_DIR}/src/EnchantChecker.h)
54 set(dont_merge ${dont_merge} ${TOP_SRC_DIR}/src/EnchantChecker.cpp)
57 if(NOT HUNSPELL_FOUND)
58 list(REMOVE_ITEM lyx_sources ${TOP_SRC_DIR}/src/HunspellChecker.cpp)
59 list(REMOVE_ITEM lyx_headers ${TOP_SRC_DIR}/src/HunspellChecker.h)
61 set(dont_merge ${dont_merge} ${TOP_SRC_DIR}/src/HunspellChecker.cpp)
65 lyx_automoc(${TOP_SRC_DIR}/src/Compare.cpp)
67 lyx_automoc(${TOP_SRC_DIR}/src/Server.cpp)
70 include_directories(${CMAKE_CURRENT_BINARY_DIR}
71 ${ZLIB_INCLUDE_DIR} ${QT_INCLUDES})
75 if (LYX_DEVEL_VERSION)
76 add_definitions(-DDEVEL_VERSION)
81 list(REMOVE_ITEM lyx_sources ${dont_merge})
83 lyx_const_touched_files(_allinone lyx_sources)
84 set(lyx_sources ${_allinone_files} ${dont_merge})
88 configure_file(${vld_path}/vld.ini ${CMAKE_CURRENT_BINARY_DIR}/vld.ini COPYONLY)
89 configure_file(${vld_path}/vld.ini ${CMAKE_CURRENT_BINARY_DIR}/memory_leak_report.txt COPYONLY)
90 set(vld_files ${CMAKE_CURRENT_BINARY_DIR}/vld.ini ${CMAKE_CURRENT_BINARY_DIR}/memory_leak_report.txt)
94 set(FILE_RC ${CMAKE_SOURCE_DIR}/lyx.rc)
95 message(STATUS "Using icon defined in resource file: ${FILE_RC}")
99 file(GLOB info_files ${TOP_SRC_DIR}/*)
101 foreach(_it ${info_files})
102 if(NOT IS_DIRECTORY ${_it})
103 set_source_files_properties(${_it} PROPERTIES HEADER_FILE_ONLY TRUE)
104 set(lyx_info_files ${lyx_info_files} ${_it})
107 source_group(LyXInfo FILES ${lyx_info_files})
109 file(GLOB cmake_files1 ${TOP_SRC_DIR}/development/cmake/*)
110 file(GLOB cmake_files2 ${TOP_SRC_DIR}/development/cmake/modules/*)
112 foreach(_it ${cmake_files1} ${cmake_files2})
113 if(NOT IS_DIRECTORY ${_it})
114 get_filename_component(name ${_it} NAME)
115 if(NOT name STREQUAL CMakeLists.txt AND NOT ${_it} MATCHES "^/\\\\..*$;~$")
116 set_source_files_properties(${_it} PROPERTIES HEADER_FILE_ONLY TRUE)
117 set(lyx_cmake_files ${lyx_cmake_files} ${_it})
121 source_group(LyXCMake FILES ${lyx_cmake_files})
124 add_executable(${_lyx}
134 lyx_add_gcc_pch(${_lyx})
136 target_link_libraries(${_lyx}
149 target_link_libraries(${_lyx} ${HUNSPELL_LIBRARY})
152 target_link_libraries(${_lyx} ${ASPELL_LIBRARY})
155 target_link_libraries(${_lyx} ${ENCHANT_LIBRARY})
159 target_link_libraries(${_lyx} "-bind_at_load")
160 target_link_libraries(${_lyx} "-framework Carbon")
164 target_link_libraries(${_lyx} ole32)
167 project_source_group("${GROUP_CODE}" lyx_sources lyx_headers)
169 install(TARGETS ${_lyx} DESTINATION bin)