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
|
|
|
|
#
|
|
|
|
#
|
2012-12-13 11:38:38 +00:00
|
|
|
# LYX_ROOT = ${TOP_SRC_DIR}/lib/doc
|
|
|
|
# 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 \
|
|
|
|
# -Dlyx=xxx \
|
2012-12-13 11:38:38 +00:00
|
|
|
# -Dformat=xxx \
|
|
|
|
# -Dextension=xxx \
|
|
|
|
# -Dfile=xxx \
|
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")
|
|
|
|
execute_process(COMMAND ${CMAKE_COMMAND} -E remove ${file}.${extension})
|
|
|
|
execute_process(
|
|
|
|
COMMAND ${lyx} -E ${format} ${file}.${extension} "${LYX_ROOT}/${file}.lyx"
|
|
|
|
RESULT_VARIABLE _err)
|
|
|
|
string(COMPARE NOTEQUAL ${_err} 0 _erg)
|
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()
|