]> git.lyx.org Git - lyx.git/blob - development/cmake/src/CMakeLists.txt
some attempt at cmake beautification
[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
20 file(GLOB lyx_sources ${TOP_SRC_DIR}/src/${LYX_CPP_FILES})
21 file(GLOB lyx_headers ${TOP_SRC_DIR}/src/${LYX_HPP_FILES})
22
23 list(REMOVE_ITEM lyx_sources
24         ${TOP_SRC_DIR}/src/ASpell.cpp
25         ${TOP_SRC_DIR}/src/PSpell.cpp
26         ${TOP_SRC_DIR}/src/ISpell.cpp
27         ${TOP_SRC_DIR}/src/Variables.cpp
28         ${TOP_SRC_DIR}/src/Section.cpp)
29         
30 if(ASPELL_FOUND)
31         include_directories(${ASPELL_INCLUDE_DIR})
32         set(lyx_sources ${lyx_sources} ${TOP_SRC_DIR}/src/ASpell.cpp)
33 endif()
34
35 include_directories(${CMAKE_CURRENT_BINARY_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         boost_iostreams
63 )
64
65 if(ASPELL_FOUND)
66         target_link_libraries(lyx ${ASPELL_LIBRARY})
67 endif()
68
69 if(APPLE)
70   target_link_libraries(lyx "-bind_at_load" ) 
71   target_link_libraries(lyx "-framework Carbon" ) 
72 endif()
73
74 project_source_group("${GROUP_CODE}" lyx_sources lyx_headers)
75
76 install(TARGETS lyx DESTINATION bin)
77