]> git.lyx.org Git - lyx.git/blob - development/cmake/src/CMakeLists.txt
5efceab267dbaecd8971e5d45fb307205891007f
[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
18
19 file(GLOB lyx_sources ${TOP_SRC_DIR}/src/${LYX_CPP_FILES})
20 file(GLOB lyx_headers ${TOP_SRC_DIR}/src/${LYX_HPP_FILES})
21
22 list(REMOVE_ITEM lyx_sources
23         ${TOP_SRC_DIR}/src/ASpell.cpp
24         ${TOP_SRC_DIR}/src/PSpell.cpp
25         ${TOP_SRC_DIR}/src/ISpell.cpp
26         ${TOP_SRC_DIR}/src/Variables.cpp
27         ${TOP_SRC_DIR}/src/Section.cpp)
28         
29 if(ASPELL_FOUND)
30         include_directories(${ASPELL_INCLUDE_DIR})
31         set(lyx_sources ${lyx_sources} ${TOP_SRC_DIR}/src/ASpell.cpp)
32 endif()
33
34 include_directories(${CMAKE_CURRENT_BINARY_DIR}
35         ${ZLIB_INCLUDE_DIR})
36
37 lyx_add_msvc_pch(lyx)
38
39
40 if(NOT MERGE_FILES)
41         set(lyx_sources ${lyx_sources})
42 else()
43         lyx_const_touched_files(_allinone  lyx_sources)
44         set(lyx_sources ${_allinone_files})
45 endif()
46
47 add_executable(lyx
48         ${WIN32_CONSOLE}
49         ${lyx_sources} 
50         ${lyx_headers}
51         )
52
53 target_link_libraries(lyx
54         mathed
55         insets
56         frontends
57         frontend_qt4
58         graphics
59         support
60         intl
61         ${QT_QTMAIN_LIBRARY})
62
63 if(ASPELL_FOUND)
64         target_link_libraries(lyx ${ASPELL_LIBRARY})
65 endif()
66
67 if(APPLE)
68   target_link_libraries(lyx "-bind_at_load" ) 
69   target_link_libraries(lyx "-framework Carbon" ) 
70 endif()
71
72 project_source_group("${GROUP_CODE}" lyx_sources lyx_headers)
73
74 install(TARGETS lyx DESTINATION bin)
75