]> git.lyx.org Git - lyx.git/blob - development/cmake/src/CMakeLists.txt
Added enchant to cmake
[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/EnchantChecker.cpp
27         ${TOP_SRC_DIR}/src/AspellChecker.cpp
28         ${TOP_SRC_DIR}/src/HunspellChecker.cpp
29         ${TOP_SRC_DIR}/src/Variables.cpp
30         ${TOP_SRC_DIR}/src/Section.cpp)
31
32 list(REMOVE_ITEM lyx_headers
33         ${TOP_SRC_DIR}/src/EnchantChecker.h
34         ${TOP_SRC_DIR}/src/AspellChecker.h
35         ${TOP_SRC_DIR}/src/HunspellChecker.h
36         ${TOP_SRC_DIR}/src/Variables.h
37         ${TOP_SRC_DIR}/src/Section.h)
38
39 if (HUNSPELL_FOUND)
40         list(APPEND lyx_sources ${TOP_SRC_DIR}/src/HunspellChecker.cpp)
41         list(APPEND lyx_headers ${TOP_SRC_DIR}/src/HunspellChecker.h)
42 endif()
43
44 if (ASPELL_FOUND)
45         include_directories(${ASPELL_INCLUDE_DIR})
46         list(APPEND lyx_sources ${TOP_SRC_DIR}/src/AspellChecker.cpp)
47         list(APPEND lyx_headers ${TOP_SRC_DIR}/src/AspellChecker.h)
48 endif()
49
50 if (ENCHANT_FOUND)
51   include_directories("${ENCHANT_INCLUDE_DIR}")
52   list(APPEND lyx_sources ${TOP_SRC_DIR}/src/EnchantChecker.cpp)
53   list(APPEND lyx_headers ${TOP_SRC_DIR}/src/EnchantChecker.h)
54 endif()
55
56 lyx_automoc(${TOP_SRC_DIR}/src/Compare.cpp ${TOP_SRC_DIR}/src/Server.cpp)
57
58 include_directories(${CMAKE_CURRENT_BINARY_DIR}
59         ${ZLIB_INCLUDE_DIR} ${QT_INCLUDES})
60
61 lyx_add_msvc_pch(lyx)
62
63
64 if (MERGE_FILES)
65         lyx_const_touched_files(_allinone  lyx_sources)
66         set(lyx_sources ${_allinone_files})
67 endif()
68
69 if (LYX_LEAK_DETECTION)
70         configure_file(${vld_path}/vld.ini ${CMAKE_CURRENT_BINARY_DIR}/vld.ini COPYONLY)
71         configure_file(${vld_path}/vld.ini ${CMAKE_CURRENT_BINARY_DIR}/memory_leak_report.txt COPYONLY)
72         set(vld_files ${CMAKE_CURRENT_BINARY_DIR}/vld.ini ${CMAKE_CURRENT_BINARY_DIR}/memory_leak_report.txt)
73 endif()
74
75 add_executable(${_lyx}
76         ${WIN32_CONSOLE}
77         ${lyx_sources}
78         ${lyx_headers}
79         ${vld_files}
80 )
81
82 lyx_add_gcc_pch(${_lyx})
83
84 target_link_libraries(${_lyx}
85         mathed
86         insets
87         frontends
88         frontend_qt4
89         graphics
90         support
91         ${LIBINTL_LIBRARIES}
92         ${ICONV_LIBRARY}
93         ${QT_QTMAIN_LIBRARY}
94         ${vld_dll})
95
96 if (HUNSPELL_FOUND)
97         target_link_libraries(${_lyx} ${HUNSPELL_LIBRARY})
98 endif()
99 if (ASPELL_FOUND)
100         target_link_libraries(${_lyx} ${ASPELL_LIBRARY})
101 endif()
102 if (ENCHANT_FOUND)
103     target_link_libraries(${_lyx} ${ENCHANT_LIBRARY})
104 endif()
105
106 if (APPLE)
107   target_link_libraries(${_lyx} "-bind_at_load")
108   target_link_libraries(${_lyx} "-framework Carbon")
109 endif()
110
111 if (MINGW)
112   target_link_libraries(${_lyx} ole32)
113 endif()
114
115 project_source_group("${GROUP_CODE}" lyx_sources lyx_headers)
116
117 install(TARGETS ${_lyx} DESTINATION bin)
118