From: Kornel Benko Date: Thu, 24 Jan 2013 16:58:44 +0000 (+0100) Subject: Cmake build: Add pdf, pdf2 and pdf5 formats to export testcases X-Git-Tag: 2.1.0beta1~871 X-Git-Url: https://git.lyx.org/gitweb/?a=commitdiff_plain;h=55d32635e186d3c2b6dc793d4ebc96ec9de07885;p=features.git Cmake build: Add pdf, pdf2 and pdf5 formats to export testcases --- diff --git a/development/autotests/CMakeLists.txt b/development/autotests/CMakeLists.txt index d611307e3a..f867033d9c 100644 --- a/development/autotests/CMakeLists.txt +++ b/development/autotests/CMakeLists.txt @@ -47,6 +47,21 @@ if(Q_WS_X11) endif() endif() +macro(getdefaultoutputformat filepath varname) + file(STRINGS "${filepath}" lines) + set(${varname} "pdf") # try at least this one + foreach(_l ${lines}) + if(_l MATCHES "^\\\\default_output_format +\([^ ]+\)") + set(found ${CMAKE_MATCH_1}) + if(found STREQUAL "default") + set(found "pdf" "pdf2" "pdf5") + endif() + set(${varname} ${found}) + break() + endif() + endforeach() +endmacro() + file(GLOB lyx_files RELATIVE "${TOP_SRC_DIR}/lib/doc" "${TOP_SRC_DIR}/lib/doc/*.lyx") foreach(f ${lyx_files}) # Strip extension @@ -59,14 +74,17 @@ foreach(f ${lyx_files}) -Dextension=16.lyx -Dfile=${f} -P "${TOP_SRC_DIR}/development/autotests/export.cmake") - add_test(NAME autotests/export/${f}_xhtml - WORKING_DIRECTORY "${CMAKE_CURRENT_BINARY_DIR}/${LYX_HOME}" - COMMAND ${CMAKE_COMMAND} -DLYX_ROOT=${TOP_SRC_DIR}/lib/doc - -Dlyx=$ - -Dformat=xhtml - -Dextension=xhtml - -Dfile=${f} - -P "${TOP_SRC_DIR}/development/autotests/export.cmake") + getdefaultoutputformat("${TOP_SRC_DIR}/lib/doc/${f}.lyx" formatlist) + foreach(format "xhtml" ${formatlist}) + add_test(NAME autotests/export/${f}_${format} + WORKING_DIRECTORY "${CMAKE_CURRENT_BINARY_DIR}/${LYX_HOME}" + COMMAND ${CMAKE_COMMAND} -DLYX_ROOT=${TOP_SRC_DIR}/lib/doc + -Dlyx=$ + -Dformat=${format} + -Dextension=${format} + -Dfile=${f} + -P "${TOP_SRC_DIR}/development/autotests/export.cmake") + endforeach() endforeach()