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}
8 # lyx = ${TOP_BINARY_DIR}/bin/${CMAKE_CFG_INTDIR}/lyx
10 # Script should be called like:
11 # cmake -DLYX_ROOT=xxx \
13 # -P "${TOP_SRC_DIR}/development/autotests/export.cmake"
15 file(GLOB lyx_files "${LYX_ROOT}/lib/doc/*.lyx")
16 message(STATUS "lyx_files = ${lyx_files}")
19 foreach(format lyx16x xhtml)
20 foreach(f ${lyx_files})
21 message(STATUS "Executing ${lyx} -E ${format} localtest.${format} ${f}")
22 execute_process(COMMAND ${CMAKE_COMMAND} -E remove localtest.xhtml localtest.16.lyx)
24 COMMAND ${lyx} -E ${format} localtest.${format} ${f}
26 string(COMPARE NOTEQUAL ${_err} 0 _erg)
28 list(APPEND ERRORS "Exporting ${f} to ${format}")
36 message(FATAL_ERROR "Export failed")