]> git.lyx.org Git - lyx.git/blob - src/tex2lyx/CMakeLists.txt
Fix layout tests for autotools
[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 project(${_tex2lyx})
9
10 # There is no header file lengthcommon.h
11 set(LINKED_sources ${TOP_SRC_DIR}/src/lengthcommon.cpp)
12 set(LINKED_headers)
13
14 foreach(_src graphics/GraphicsParams insets/ExternalTemplate
15         insets/ExternalTransforms insets/InsetLayout Author Color Counters
16         Encoding FloatList Floating FontInfo LaTeXPackages Layout
17         LayoutFile LayoutModuleList Length 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 add_definitions(-DNO_LAYOUT_CSS)
34
35 if(WIN32)
36         set(FILE_RC ${TOP_CMAKE_PATH}/lyx.rc)
37         message(STATUS "Using icon defined in resource file: ${FILE_RC}")
38 endif()
39
40 if(NOT LYX_MERGE_FILES)
41         add_executable(${_tex2lyx} ${tex2lyx_sources} ${LINKED_sources} ${tex2lyx_headers} ${LINKED_headers}    ${FILE_RC})
42 else()
43         lyx_const_touched_files(_allinone  tex2lyx_sources)
44         lyx_const_touched_files(_allinone_linked  LINKED_sources)
45         add_executable(${_tex2lyx} ${_allinone_files} ${_allinone_linked_files} ${FILE_RC})
46 endif()
47 set_target_properties(${_tex2lyx} PROPERTIES FOLDER "applications/TeX2LyX")
48
49 target_link_libraries(${_tex2lyx}
50         support
51         ${Lyx_Boost_Libraries}
52         ${QT_QTCORE_LIBRARY}
53         ${QT_QTGUI_LIBRARY}
54         ${intl_link}
55         ${ICONV_LIBRARY})
56
57 add_dependencies(${_tex2lyx} lyx_version)
58
59 if(WIN32)
60         target_link_libraries(${_tex2lyx} shlwapi ole32 psapi)
61 endif()
62
63 if(APPLE)
64         target_link_libraries(${_tex2lyx} "-framework AppKit")
65 endif()
66
67
68 project_source_group("${GROUP_CODE}" tex2lyx_sources tex2lyx_headers)
69
70 add_subdirectory(test)
71
72 if(LYX_BUNDLE)
73         install(TARGETS ${_tex2lyx}
74                 RUNTIME DESTINATION bin
75                 BUNDLE DESTINATION .)
76 else()
77         install(TARGETS ${_tex2lyx} DESTINATION bin)
78 endif()
79