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