]> git.lyx.org Git - features.git/blob - development/autotests/export.cmake
b848cb42baec245ef98434e1b4871999e0c833ea
[features.git] / development / autotests / export.cmake
1
2 file(GLOB lyx_files "${LYX_ROOT}/lib/doc/*.lyx")
3 message(STATUS "lyx_files = ${lyx_files}")
4
5 set(ERRORS)
6 foreach(format lyx16x xhtml)
7   foreach(f ${lyx_files})
8     message(STATUS "Executing ${lyx} -E ${format} localtest.${format} ${f}")
9     execute_process(COMMAND ${CMAKE_COMMAND} -E remove localtest.xhtml localtest.16.lyx)
10     execute_process(
11       COMMAND ${lyx} -E ${format} localtest.${format} ${f}
12       RESULT_VARIABLE _err)
13     string(COMPARE NOTEQUAL  ${_err} 0 _erg)
14     if(_erg)
15       list(APPEND ERRORS "Exporting ${f} to ${format}")
16     endif()
17   endforeach()
18 endforeach()
19 if(ERRORS)
20   foreach(m ${ERRORS})
21     message(STATUS ${m})
22   endforeach()
23   message(FATAL_ERROR "Export failed")
24 endif()