]> git.lyx.org Git - lyx.git/blob - src/tex2lyx/CMakeLists.txt
08ce121c0004fb8966c623714156093a98104972
[lyx.git] / src / tex2lyx / 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-2011 Peter Kümmel, <syntheticpp@gmx.net>
5 # Copyright (c) 2008-2011 Kornel Benko, <Kornel.Benko@berlin.de>
6 #
7
8 set(_tex2lyx tex2lyx${PROGRAM_SUFFIX})
9 project(${_tex2lyx})
10
11 # There is no header file lengthcommon.h
12 set(LINKED_sources ${TOP_SRC_DIR}/src/lengthcommon.cpp)
13 set(LINKED_headers)
14
15 foreach(_src insets/InsetLayout Author Color Counters
16         Encoding FloatList Floating FontInfo LaTeXPackages
17         Layout LayoutFile LayoutModuleList Lexer ModuleList TextClass
18         Spacing version)
19         list(APPEND LINKED_sources ${TOP_SRC_DIR}/src/${_src}.cpp)
20         list(APPEND LINKED_headers ${TOP_SRC_DIR}/src/${_src}.h)
21 endforeach(_src)
22
23 file(GLOB tex2lyx_sources ${TOP_SRC_DIR}/src/tex2lyx/${LYX_CPP_FILES})
24
25 file(GLOB tex2lyx_headers ${TOP_SRC_DIR}/src/tex2lyx/${LYX_HPP_FILES})
26
27 include_directories(BEFORE
28         ${TOP_SRC_DIR}/src/tex2lyx
29         ${TOP_SRC_DIR}/src/support/minizip
30         ${ZLIB_INCLUDE_DIR})
31
32 add_definitions(-DTEX2LYX)
33
34 if(WIN32)
35         set(FILE_RC ${TOP_SRC_DIR}/development/cmake/lyx.rc)
36         message(STATUS "Using icon defined in resource file: ${FILE_RC}")
37 endif()
38
39 if(NOT LYX_MERGE_FILES)
40         add_executable(${_tex2lyx} ${tex2lyx_sources} ${LINKED_sources} ${tex2lyx_headers} ${LINKED_headers}    ${FILE_RC})
41 else()
42         lyx_const_touched_files(_allinone  tex2lyx_sources)
43         lyx_const_touched_files(_allinone_linked  LINKED_sources)
44         add_executable(${_tex2lyx} ${_allinone_files} ${_allinone_linked_files} ${FILE_RC})
45 endif()
46
47 target_link_libraries(${_tex2lyx}
48         support
49         ${Lyx_Boost_Libraries}
50         ${QT_QTCORE_LIBRARY}
51         ${LIBINTL_LIBRARIES}
52         ${ICONV_LIBRARY})
53
54 if(WIN32)
55         target_link_libraries(${_tex2lyx} shlwapi ole32 psapi)
56 endif()
57
58 if(APPLE)
59         target_link_libraries(${_tex2lyx} "-framework AppKit")
60 endif()
61
62
63 project_source_group("${GROUP_CODE}" tex2lyx_sources tex2lyx_headers)
64
65 if(LYX_BUNDLE)
66         install(TARGETS ${_tex2lyx}
67                 RUNTIME DESTINATION bin
68                 BUNDLE DESTINATION .)
69 else()
70         install(TARGETS ${_tex2lyx} DESTINATION bin)
71 endif()
72