2012-12-12 17:23:25 +00:00
|
|
|
# This file is part of LyX, the document processor.
|
|
|
|
# Licence details can be found in the file COPYING.
|
|
|
|
#
|
|
|
|
# Copyright (c) 2012 Kornel Benko kornel@lyx.org
|
|
|
|
#
|
|
|
|
#
|
2013-07-23 19:42:44 +00:00
|
|
|
# LYX_ROOT = ${TOP_SRC_DIR}/lib/{doc,examples,templates}
|
2012-12-13 11:38:38 +00:00
|
|
|
# lyx =
|
|
|
|
# format = lyx16x|xhtml
|
|
|
|
# extension = 16.lyx|xhtml
|
|
|
|
# file = xxx
|
2012-12-12 17:23:25 +00:00
|
|
|
#
|
|
|
|
# Script should be called like:
|
|
|
|
# cmake -DLYX_ROOT=xxx \
|
2013-07-23 19:42:44 +00:00
|
|
|
# -DWORKDIR=${BUILD_DIR}/autotests/out-home
|
2012-12-12 17:23:25 +00:00
|
|
|
# -Dlyx=xxx \
|
2012-12-13 11:38:38 +00:00
|
|
|
# -Dformat=xxx \
|
|
|
|
# -Dextension=xxx \
|
|
|
|
# -Dfile=xxx \
|
2013-08-04 12:31:47 +00:00
|
|
|
# -Dreverted=[01] \
|
2012-12-12 17:23:25 +00:00
|
|
|
# -P "${TOP_SRC_DIR}/development/autotests/export.cmake"
|
|
|
|
#
|
2012-12-11 14:17:04 +00:00
|
|
|
|
2012-12-13 11:38:38 +00:00
|
|
|
message(STATUS "Executing ${lyx} -E ${format} ${file}.${extension} ${LYX_ROOT}/${file}.lyx")
|
2013-07-23 19:42:44 +00:00
|
|
|
set(ENV{LYX_USERDIR} "${WORKDIR}/.lyx")
|
2012-12-13 11:38:38 +00:00
|
|
|
execute_process(COMMAND ${CMAKE_COMMAND} -E remove ${file}.${extension})
|
|
|
|
execute_process(
|
|
|
|
COMMAND ${lyx} -E ${format} ${file}.${extension} "${LYX_ROOT}/${file}.lyx"
|
|
|
|
RESULT_VARIABLE _err)
|
2013-08-04 12:31:47 +00:00
|
|
|
if(reverted)
|
|
|
|
string(COMPARE EQUAL ${_err} 0 _erg)
|
|
|
|
else()
|
|
|
|
string(COMPARE NOTEQUAL ${_err} 0 _erg)
|
|
|
|
endif()
|
2013-01-21 01:36:42 +00:00
|
|
|
if(_erg)
|
2012-12-13 11:38:38 +00:00
|
|
|
message(STATUS "Exporting ${f}.lyx to ${format}")
|
|
|
|
message(FATAL_ERROR "Export failed")
|
|
|
|
endif()
|