1 # This file is part of LyX, the document processor.
2 # Licence details can be found in the file COPYING.
4 # Copyright (c) 2012 Kornel Benko, <kornel@lyx.org>
9 set(_test_depend "${CMAKE_CURRENT_BINARY_DIR}/test.ltx")
10 set(_test_output "${CMAKE_CURRENT_BINARY_DIR}/test.lyx.tex")
11 foreach(_arg runtests.py DummyDocument.tex test.ltx foo.eps foo.png)
12 configure_file("${TOP_SRC_DIR}/src/tex2lyx/test/${_arg}" "${CMAKE_CURRENT_BINARY_DIR}/${_arg}" COPYONLY)
15 foreach(_arg test-structure test-insets box-color-size-space-align CJK XeTeX-polyglossia)
17 OUTPUT "${CMAKE_CURRENT_BINARY_DIR}/${_arg}.tex"
18 COMMAND ${CMAKE_COMMAND} -E copy_if_different "${TOP_SRC_DIR}/src/tex2lyx/test/${_arg}.tex" "${CMAKE_CURRENT_BINARY_DIR}/${_arg}.tex"
19 DEPENDS "${TOP_SRC_DIR}/src/tex2lyx/test/${_arg}.tex"
21 list(APPEND _test_depend "${CMAKE_CURRENT_BINARY_DIR}/${_arg}.tex")
22 list(APPEND _test_output "${CMAKE_CURRENT_BINARY_DIR}/${_arg}.lyx.tex")
23 list(APPEND _test_output "${CMAKE_CURRENT_BINARY_DIR}/${_arg}.lyx.lyx")
27 OUTPUT ${_test_output}
28 COMMAND ${LYX_PYTHON_EXECUTABLE}
29 ARGS "${CMAKE_CURRENT_BINARY_DIR}/runtests.py" "${TOP_BINARY_DIR}/bin/${_tex2lyx}" "${TOP_SRC_DIR}/lib/scripts"
30 WORKING_DIRECTORY "${CMAKE_CURRENT_BINARY_DIR}"
31 DEPENDS ${_tex2lyx} ${_test_depend}
32 COMMENT "${LYX_PYTHON_EXECUTABLE}" "${CMAKE_CURRENT_BINARY_DIR}/runtests.py" "${TOP_BINARY_DIR}/bin/${_tex2lyx}" "${TOP_SRC_DIR}/lib/scripts"
35 ADD_CUSTOM_TARGET(test DEPENDS ${_tex2lyx} ${_lyx} ${_test_output})