lyx_mirror/development/autotests/export.cmake
Kornel Benko 57b04ac7f4 Cmake build: First try to use autotests.
Many test are not running, but if changed the '-dbg xxx' to '-dbg any'
then all of sudden they pass ...
(The buffered output of lyx is often disrupted too early with 'kill -9',
so the expected data are not available for the appropriate test)
2012-12-11 15:17:04 +01:00

26 lines
758 B
CMake
Executable File

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} ${f}")
#execute_process(COMMAND ${CMAKE_COMMAND} -E copy ${f} localtest.lyx)
execute_process(COMMAND ${CMAKE_COMMAND} -E remove localtest.xhtml localtest.16.lyx)
execute_process(
COMMAND ${lyx} -E ${format} localtest.lyx ${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(FATAL_ERROR "Export failed")
endif()