From 4182205ca840f8abe2e34f6f4cd57caa51af44fe Mon Sep 17 00:00:00 2001 From: Kornel Benko Date: Wed, 12 Dec 2012 18:23:25 +0100 Subject: [PATCH] Cmake build: autotests Make the export test available to all, since it is independent of X11 --- development/autotests/CMakeLists.txt | 19 +++++++++++++------ development/autotests/export.cmake | 15 ++++++++++++++- 2 files changed, 27 insertions(+), 7 deletions(-) diff --git a/development/autotests/CMakeLists.txt b/development/autotests/CMakeLists.txt index 3a85964935..7bdd2efbc0 100644 --- a/development/autotests/CMakeLists.txt +++ b/development/autotests/CMakeLists.txt @@ -4,9 +4,16 @@ # Copyright (c) 2012 Kornel Benko kornel@lyx.org # -if(UNIX) +if(Q_WS_X11) + # Make sure, the needed programs are in PATH + find_program(PCREGREP_EXE "pcregrep") + find_program(WMCTRL_EXE "wmctrl") + # This is needed to build xvkbd + # Programs pcregrep wmctrl and xvkbd are used in subsequent scripts + # while testing find_package(X11) - if(X11_FOUND) + if(X11_FOUND AND PCREGREP_EXE AND WMCTRL_EXE) + message(STATUS "PCREGREP_EXE and WMCTRL_EXE found") project(autotests) add_subdirectory(xvkbd) @@ -36,9 +43,9 @@ if(UNIX) -DLOCALE_DIR=${LOCALE_DIR} -P ${TOP_SRC_DIR}/development/autotests/single-test.cmake) endforeach() - add_test(NAME lyx_export - WORKING_DIRECTORY "${CMAKE_CURRENT_BINARY_DIR}/${LYX_HOME}" - COMMAND ${CMAKE_COMMAND} -DLYX_ROOT=${TOP_SRC_DIR} -Dlyx=${TOP_BINARY_DIR}/bin/${CMAKE_CFG_INTDIR}/lyx -P "${TOP_SRC_DIR}/development/autotests/export.cmake") - set_tests_properties(lyx_export PROPERTIES DEPENDS lyx) endif() endif() +add_test(NAME lyx_export + WORKING_DIRECTORY "${CMAKE_CURRENT_BINARY_DIR}/${LYX_HOME}" + COMMAND ${CMAKE_COMMAND} -DLYX_ROOT=${TOP_SRC_DIR} -Dlyx=${TOP_BINARY_DIR}/bin/${CMAKE_CFG_INTDIR}/lyx -P "${TOP_SRC_DIR}/development/autotests/export.cmake") +set_tests_properties(lyx_export PROPERTIES DEPENDS lyx) diff --git a/development/autotests/export.cmake b/development/autotests/export.cmake index b848cb42ba..6693e097d0 100755 --- a/development/autotests/export.cmake +++ b/development/autotests/export.cmake @@ -1,4 +1,17 @@ - +# This file is part of LyX, the document processor. +# Licence details can be found in the file COPYING. +# +# Copyright (c) 2012 Kornel Benko kornel@lyx.org +# +# +# LYX_ROOT = ${TOP_SRC_DIR} +# lyx = ${TOP_BINARY_DIR}/bin/${CMAKE_CFG_INTDIR}/lyx +# +# Script should be called like: +# cmake -DLYX_ROOT=xxx \ +# -Dlyx=xxx \ +# -P "${TOP_SRC_DIR}/development/autotests/export.cmake" +# file(GLOB lyx_files "${LYX_ROOT}/lib/doc/*.lyx") message(STATUS "lyx_files = ${lyx_files}") -- 2.39.2