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