]> git.lyx.org Git - lyx.git/blob - development/cmake/src/CMakeLists.txt
cmake: use external libintl on windows
[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 if(LYX_LEAK_DETECTION)
48         configure_file(${vld_path}/vld.ini ${CMAKE_CURRENT_BINARY_DIR}/vld.ini COPYONLY)
49         configure_file(${vld_path}/vld.ini ${CMAKE_CURRENT_BINARY_DIR}/memory_leak_report.txt COPYONLY)
50         set(vld_files ${CMAKE_CURRENT_BINARY_DIR}/vld.ini ${CMAKE_CURRENT_BINARY_DIR}/memory_leak_report.txt)
51 endif()
52
53 add_executable(lyx
54         ${WIN32_CONSOLE}
55         ${lyx_sources} 
56         ${lyx_headers}
57         ${vld_files}
58         )
59
60 target_link_libraries(lyx
61         mathed
62         insets
63         frontends
64         frontend_qt4
65         graphics
66         support
67         ${LIBINTL_LIBRARIES}
68         ${ICONV_LIBRARY}
69         ${QT_QTMAIN_LIBRARY}
70         ${vld_dll})
71
72 if(ASPELL_FOUND)
73         target_link_libraries(lyx ${ASPELL_LIBRARY})
74 endif()
75
76 if(APPLE)
77   target_link_libraries(lyx "-bind_at_load" ) 
78   target_link_libraries(lyx "-framework Carbon" ) 
79 endif()
80
81 project_source_group("${GROUP_CODE}" lyx_sources lyx_headers)
82
83 install(TARGETS lyx DESTINATION bin)
84