]> git.lyx.org Git - lyx.git/blobdiff - 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
index b848cb42baec245ef98434e1b4871999e0c833ea..9db019142788ad366130061bdd556e3896c6c6c8 100755 (executable)
@@ -1,24 +1,31 @@
+# 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
+#
+#
+# LYX_ROOT  = ${TOP_SRC_DIR}/lib/doc
+# lyx       = 
+# format    = lyx16x|xhtml
+# extension = 16.lyx|xhtml
+# file      = xxx
+#
+# Script should be called like:
+# cmake -DLYX_ROOT=xxx \
+#       -Dlyx=xxx \
+#       -Dformat=xxx \
+#       -Dextension=xxx \
+#       -Dfile=xxx \
+#       -P "${TOP_SRC_DIR}/development/autotests/export.cmake"
+#
 
-file(GLOB lyx_files "${LYX_ROOT}/lib/doc/*.lyx")
-message(STATUS "lyx_files = ${lyx_files}")
-
-set(ERRORS)
-foreach(format lyx16x xhtml)
-  foreach(f ${lyx_files})
-    message(STATUS "Executing ${lyx} -E ${format} localtest.${format} ${f}")
-    execute_process(COMMAND ${CMAKE_COMMAND} -E remove localtest.xhtml localtest.16.lyx)
-    execute_process(
-      COMMAND ${lyx} -E ${format} localtest.${format} ${f}
-      RESULT_VARIABLE _err)
-    string(COMPARE NOTEQUAL  ${_err} 0 _erg)
-    if(_erg)
-      list(APPEND ERRORS "Exporting ${f} to ${format}")
-    endif()
-  endforeach()
-endforeach()
-if(ERRORS)
-  foreach(m ${ERRORS})
-    message(STATUS ${m})
-  endforeach()
+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)
+if(_erg)
+  message(STATUS "Exporting ${f}.lyx to ${format}")
   message(FATAL_ERROR "Export failed")
 endif()