]> git.lyx.org Git - lyx.git/blob - development/autotests/export.cmake
ceed5e433ff8b5ea886c2a004bf7260dbea705d3
[lyx.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} ${f}")
9     #execute_process(COMMAND ${CMAKE_COMMAND} -E copy ${f} localtest.lyx)
10     execute_process(COMMAND ${CMAKE_COMMAND} -E remove localtest.xhtml localtest.16.lyx)
11     execute_process(
12       COMMAND ${lyx} -E ${format} localtest.lyx ${f}
13       RESULT_VARIABLE _err)
14     string(COMPARE NOTEQUAL  ${_err} 0 _erg)
15     if(_erg)
16       list(APPEND ERRORS "Exporting ${f} to ${format}")
17     endif()
18   endforeach()
19 endforeach()
20 if(ERRORS)
21   foreach(m ${ERRORS})
22     message(STATUS ${m})
23   endforeach()
24   message(FATAL_ERROR "Export failed")
25 endif()