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
7 # LYX_ROOT = ${TOP_SRC_DIR}/lib/doc
9 # format = lyx16x|xhtml
10 # extension = 16.lyx|xhtml
13 # Script should be called like:
14 # cmake -DLYX_ROOT=xxx \
19 # -P "${TOP_SRC_DIR}/development/autotests/export.cmake"
22 message(STATUS "Executing ${lyx} -E ${format} ${file}.${extension} ${LYX_ROOT}/${file}.lyx")
23 execute_process(COMMAND ${CMAKE_COMMAND} -E remove ${file}.${extension})
25 COMMAND ${lyx} -E ${format} ${file}.${extension} "${LYX_ROOT}/${file}.lyx"
27 string(COMPARE NOTEQUAL ${_err} 0 _erg)
29 message(STATUS "Exporting ${f}.lyx to ${format}")
30 message(FATAL_ERROR "Export failed")
32 # This script invokes the keytest.py script with the simple set-up needed
33 # to re-run deterministic regression tests that one would like to have.
35 # AUTOTEST_ROOT = ${LYX_ROOT}/development/autotests
36 # KEYTEST_INFILE = xxx-in.txt
37 # KEYTEST_OUTFILE = xxx-out.txt
38 # BINDIR = ${BUILD_DIR}/bin
39 # WORKDIR = ${BUILD_DIR}/autotests/out-home
40 # LOCALE_DIR = ${BUILD_DIR}/autotests/locale
41 # PO_BUILD_DIR = ${BUILD_DIR}/po
44 # Script should be called like:
45 # cmake -DAUTOTEST_ROOT=xxxx \
46 # -DKEYTEST_INFILE=xxxx \
47 # -DKEYTEST_OUTFILE=xxx \
51 # -DPO_BUILD_DIR=xxx \
53 # -P ${AUTOTEST_ROOT}/single-test.cmake
55 set(KEYTEST "${AUTOTEST_ROOT}/keytest.py")
57 execute_process(COMMAND pidof lyx OUTPUT_VARIABLE LYX_PID RESULT_VARIABLE pidstat OUTPUT_VARIABLE pidres)
58 message(STATUS "pidres = ${pidres}")
60 # lyx already running, remove trailing '\n' from pid
61 string(REGEX REPLACE "\n" "" pidres ${pidres})
62 execute_process(COMMAND wmctrl -l -p OUTPUT_VARIABLE _wmco)
63 string(REGEX REPLACE "[\n]+" ";" _wmc ${_wmco})
65 string(REGEX MATCH "${pidres}" _wr ${_w})
66 if (${_wr} MATCHES ${pidres})
67 # this entry contains the pid, go search for X11-window-id
68 string(REGEX REPLACE " .*" "" _wr ${_w})
69 set(LYX_WINDOW_NAME ${_wr})
70 message(STATUS "Set LYX_WINDOW_NAME to ${_wr}")
75 set(LYX_WINDOW_NAME "")