]> git.lyx.org Git - lyx.git/blob - development/autotests/export.cmake
I seem to need this to let the 'Lang' keyword work, within *-in.txt files.
[lyx.git] / development / autotests / export.cmake
1 # This file is part of LyX, the document processor.
2 # Licence details can be found in the file COPYING.
3 #
4 # Copyright (c) 2012 Kornel Benko kornel@lyx.org
5 #
6 #
7 # LYX_ROOT  = ${TOP_SRC_DIR}/lib/doc
8 # lyx       = 
9 # format    = lyx16x|xhtml
10 # extension = 16.lyx|xhtml
11 # file      = xxx
12 #
13 # Script should be called like:
14 # cmake -DLYX_ROOT=xxx \
15 #       -Dlyx=xxx \
16 #       -Dformat=xxx \
17 #       -Dextension=xxx \
18 #       -Dfile=xxx \
19 #       -P "${TOP_SRC_DIR}/development/autotests/export.cmake"
20 #
21
22 message(STATUS "Executing ${lyx} -E ${format} ${file}.${extension} ${LYX_ROOT}/${file}.lyx")
23 execute_process(COMMAND ${CMAKE_COMMAND} -E remove ${file}.${extension})
24 execute_process(
25   COMMAND ${lyx} -E ${format} ${file}.${extension} "${LYX_ROOT}/${file}.lyx"
26   RESULT_VARIABLE _err)
27 string(COMPARE NOTEQUAL  ${_err} 0 _erg)
28 if(_erg)
29   message(STATUS "Exporting ${f}.lyx to ${format}")
30   message(FATAL_ERROR "Export failed")
31 endif()