1 # This file is part of LyX, the document processor.
2 # Licence details can be found in the file COPYING.
4 # Copyright (c) 2012 Kornel Benko kornel@lyx.org
7 # LYX_ROOT = ${TOP_SRC_DIR}/lib/{doc,examples,templates}
9 # format = lyx16x|xhtml
10 # extension = 16.lyx|xhtml
13 # Script should be called like:
14 # cmake -DLYX_ROOT=xxx \
15 # -DWORKDIR=${BUILD_DIR}/autotests/out-home
21 # -P "${TOP_SRC_DIR}/development/autotests/export.cmake"
24 message(STATUS "Executing ${lyx} -E ${format} ${file}.${extension} ${LYX_ROOT}/${file}.lyx")
25 set(ENV{LYX_USERDIR} "${WORKDIR}/.lyx")
26 execute_process(COMMAND ${CMAKE_COMMAND} -E remove ${file}.${extension})
28 COMMAND ${lyx} -E ${format} ${file}.${extension} "${LYX_ROOT}/${file}.lyx"
31 string(COMPARE EQUAL ${_err} 0 _erg)
33 string(COMPARE NOTEQUAL ${_err} 0 _erg)
36 message(STATUS "Exporting ${f}.lyx to ${format}")
37 message(FATAL_ERROR "Export failed")