]> git.lyx.org Git - lyx.git/blob - development/cmake/src/CMakeLists.txt
Check for hunspell
[lyx.git] / development / cmake / src / 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 set(_lyx ${PACKAGE_BASE}${PROGRAM_SUFFIX})
8 project(${_lyx})
9
10 include_directories(${TOP_SRC_DIR}/src)
11
12 add_subdirectory(frontends)
13 add_subdirectory(graphics)
14 add_subdirectory(insets)
15 add_subdirectory(mathed)
16 add_subdirectory(support)
17 add_subdirectory(tex2lyx)
18 if (UNIX)
19   add_subdirectory(client)
20 endif()
21
22 file(GLOB lyx_sources ${TOP_SRC_DIR}/src/${LYX_CPP_FILES})
23 file(GLOB lyx_headers ${TOP_SRC_DIR}/src/${LYX_HPP_FILES})
24
25 list(REMOVE_ITEM lyx_sources
26         ${TOP_SRC_DIR}/src/ASpell.cpp
27         ${TOP_SRC_DIR}/src/PSpell.cpp
28         ${TOP_SRC_DIR}/src/ISpell.cpp
29         ${TOP_SRC_DIR}/src/Variables.cpp
30         ${TOP_SRC_DIR}/src/Section.cpp)
31
32 if (NOT HUNSPELL_FOUND)
33     list(REMOVE_ITEM lyx_sources ${TOP_SRC_DIR}/src/HunspellSpellChecker.cpp)
34 endif()
35
36 if (ASPELL_FOUND)
37   include_directories(${ASPELL_INCLUDE_DIR})
38   list(APPEND lyx_sources ${TOP_SRC_DIR}/src/ASpell.cpp)
39 endif()
40
41 include_directories(${CMAKE_CURRENT_BINARY_DIR}
42         ${ZLIB_INCLUDE_DIR} ${QT_INCLUDES})
43
44 lyx_add_msvc_pch(lyx)
45
46
47 if (MERGE_FILES)
48   lyx_const_touched_files(_allinone  lyx_sources)
49   set(lyx_sources ${_allinone_files})
50 endif()
51
52 if (LYX_LEAK_DETECTION)
53         configure_file(${vld_path}/vld.ini ${CMAKE_CURRENT_BINARY_DIR}/vld.ini COPYONLY)
54         configure_file(${vld_path}/vld.ini ${CMAKE_CURRENT_BINARY_DIR}/memory_leak_report.txt COPYONLY)
55         set(vld_files ${CMAKE_CURRENT_BINARY_DIR}/vld.ini ${CMAKE_CURRENT_BINARY_DIR}/memory_leak_report.txt)
56 endif()
57
58 add_executable(${_lyx}
59         ${WIN32_CONSOLE}
60         ${lyx_sources}
61         ${lyx_headers}
62         ${vld_files}
63 )
64
65 target_link_libraries(${_lyx}
66         mathed
67         insets
68         frontends
69         frontend_qt4
70         graphics
71         support
72         ${LIBINTL_LIBRARIES}
73         ${ICONV_LIBRARY}
74         ${QT_QTMAIN_LIBRARY}
75         ${vld_dll})
76
77 if (ASPELL_FOUND)
78         target_link_libraries(${_lyx} ${ASPELL_LIBRARY})
79 endif()
80
81 if (APPLE)
82   target_link_libraries(${_lyx} "-bind_at_load")
83   target_link_libraries(${_lyx} "-framework Carbon")
84 endif()
85
86 if (MINGW)
87   target_link_libraries(${_lyx} ole32)
88 endif()
89
90 project_source_group("${GROUP_CODE}" lyx_sources lyx_headers)
91
92 install(TARGETS ${_lyx} DESTINATION bin)
93