]> git.lyx.org Git - lyx.git/blob - src/tex2lyx/CMakeLists.txt
Cmake build:
[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 graphics/GraphicsParams insets/ExternalTemplate
16         insets/ExternalTransforms insets/InsetLayout Author Color Counters
17         Encoding FloatList Floating FontInfo LaTeXPackages Layout
18         LayoutFile LayoutModuleList Length Lexer ModuleList TextClass
19         Spacing version)
20         list(APPEND LINKED_sources ${TOP_SRC_DIR}/src/${_src}.cpp)
21         list(APPEND LINKED_headers ${TOP_SRC_DIR}/src/${_src}.h)
22 endforeach(_src)
23
24 set_property(SOURCE "${TOP_SRC_DIR}/src/version.cpp" APPEND PROPERTY COMPILE_DEFINITIONS  LYX_DATE="${LYX_DATE}")
25
26 file(GLOB tex2lyx_sources ${TOP_SRC_DIR}/src/tex2lyx/${LYX_CPP_FILES})
27
28 file(GLOB tex2lyx_headers ${TOP_SRC_DIR}/src/tex2lyx/${LYX_HPP_FILES})
29
30 include_directories(BEFORE
31         ${TOP_SRC_DIR}/src/tex2lyx
32         ${TOP_SRC_DIR}/src/support/minizip
33         ${ZLIB_INCLUDE_DIR})
34
35 add_definitions(-DTEX2LYX)
36
37 if(WIN32)
38         set(FILE_RC ${TOP_SRC_DIR}/development/cmake/lyx.rc)
39         message(STATUS "Using icon defined in resource file: ${FILE_RC}")
40 endif()
41
42 if(NOT LYX_MERGE_FILES)
43         add_executable(${_tex2lyx} ${tex2lyx_sources} ${LINKED_sources} ${tex2lyx_headers} ${LINKED_headers}    ${FILE_RC})
44 else()
45         lyx_const_touched_files(_allinone  tex2lyx_sources)
46         lyx_const_touched_files(_allinone_linked  LINKED_sources)
47         add_executable(${_tex2lyx} ${_allinone_files} ${_allinone_linked_files} ${FILE_RC})
48 endif()
49
50 target_link_libraries(${_tex2lyx}
51         support
52         ${Lyx_Boost_Libraries}
53         ${QT_QTCORE_LIBRARY}
54         ${QT_QTGUI_LIBRARY}
55         ${LIBINTL_LIBRARIES}
56         ${ICONV_LIBRARY})
57
58 if(WIN32)
59         target_link_libraries(${_tex2lyx} shlwapi ole32 psapi)
60 endif()
61
62 if(APPLE)
63         target_link_libraries(${_tex2lyx} "-framework AppKit")
64 endif()
65
66
67 project_source_group("${GROUP_CODE}" tex2lyx_sources tex2lyx_headers)
68
69 add_subdirectory(test)
70
71 if(LYX_BUNDLE)
72         install(TARGETS ${_tex2lyx}
73                 RUNTIME DESTINATION bin
74                 BUNDLE DESTINATION .)
75 else()
76         install(TARGETS ${_tex2lyx} DESTINATION bin)
77 endif()
78