mirror of
https://git.lyx.org/repos/lyx.git
synced 2024-11-22 10:00:33 +00:00
Cmake build key tests: Omit the tests and creation of xvkbd command,
if not all needed libs or programs are available. This error is now not fatal.
This commit is contained in:
parent
b58b8e7c73
commit
5431b41d22
@ -5,15 +5,64 @@
|
|||||||
#
|
#
|
||||||
|
|
||||||
if(Q_WS_X11)
|
if(Q_WS_X11)
|
||||||
|
set(Missing)
|
||||||
|
set(XVFBDLIBS)
|
||||||
# Make sure, the needed programs are in PATH
|
# Make sure, the needed programs are in PATH
|
||||||
find_program(PCREGREP_EXE "pcregrep")
|
find_program(PCREGREP_EXE "pcregrep")
|
||||||
|
if (NOT PCREGREP_EXE)
|
||||||
|
list(APPEND Missing "pcregrep")
|
||||||
|
endif()
|
||||||
find_program(WMCTRL_EXE "wmctrl")
|
find_program(WMCTRL_EXE "wmctrl")
|
||||||
|
if(NOT WMCTRL_EXE)
|
||||||
|
list(APPEND Missing "wmctrl")
|
||||||
|
endif()
|
||||||
# This is needed to build xvkbd
|
# This is needed to build xvkbd
|
||||||
# Programs pcregrep wmctrl and xvkbd are used in subsequent scripts
|
# Programs pcregrep wmctrl and xvkbd are used in subsequent scripts
|
||||||
# while testing
|
# while testing
|
||||||
|
|
||||||
|
# Check for needed libraries for xvkbd
|
||||||
|
# do not add autotests, if any of them is lacking
|
||||||
|
|
||||||
find_package(X11)
|
find_package(X11)
|
||||||
if(X11_FOUND AND PCREGREP_EXE AND WMCTRL_EXE)
|
if(NOT X11_FOUND)
|
||||||
#message(STATUS "PCREGREP_EXE and WMCTRL_EXE found")
|
list(APPEND Missing "X11")
|
||||||
|
endif()
|
||||||
|
find_package(PkgConfig)
|
||||||
|
if(PKG_CONFIG_FOUND)
|
||||||
|
pkg_check_modules(XAWLIB xaw7)
|
||||||
|
if (XAWLIB_LIBRARIES)
|
||||||
|
list(APPEND XVFBDLIBS ${XAWLIB_LIBRARIES})
|
||||||
|
else()
|
||||||
|
list(APPEND Missing Xaw7)
|
||||||
|
endif()
|
||||||
|
pkg_check_modules(XTEST xtst)
|
||||||
|
if (XTEST_LIBRARIES)
|
||||||
|
list(APPEND XVFBDLIBS ${XTEST_LIBRARIES})
|
||||||
|
else()
|
||||||
|
list(APPEND Missing xtst)
|
||||||
|
endif()
|
||||||
|
else()
|
||||||
|
find_library(XAW7LIB "Xaw7")
|
||||||
|
if(XAW7LIB)
|
||||||
|
list(APPEND XVFBDLIBS ${XAW7LIB})
|
||||||
|
else()
|
||||||
|
list(APPEND Missing Xaw7)
|
||||||
|
endif()
|
||||||
|
foreach(_lb Xt XTest X11)
|
||||||
|
if(X11_${_lb}_LIB)
|
||||||
|
list(APPEND XVFBDLIBS ${X11_${_lb}_LIB})
|
||||||
|
else()
|
||||||
|
list(APPEND Missing ${_lb})
|
||||||
|
endif()
|
||||||
|
endforeach()
|
||||||
|
endif()
|
||||||
|
|
||||||
|
if(Missing)
|
||||||
|
message(STATUS "Missing Libraries or programms to create xvkbd: ${Missing}")
|
||||||
|
message(STATUS "cmake build is therefore omiting autotests")
|
||||||
|
endif()
|
||||||
|
|
||||||
|
if(NOT Missing)
|
||||||
project(autotests)
|
project(autotests)
|
||||||
|
|
||||||
add_subdirectory(xvkbd)
|
add_subdirectory(xvkbd)
|
||||||
|
@ -3,31 +3,13 @@
|
|||||||
#
|
#
|
||||||
# Copyright (c) 2012 Kornel Benko kornel@lyx.org
|
# Copyright (c) 2012 Kornel Benko kornel@lyx.org
|
||||||
#
|
#
|
||||||
|
# Variable "XVFBDLIBS" created in development/autotests/CMakeLists.txt
|
||||||
|
#
|
||||||
project(xvkbd)
|
project(xvkbd)
|
||||||
|
|
||||||
find_package(PkgConfig)
|
|
||||||
|
|
||||||
add_definitions(-DUSE_XTEST -DUSE_I18N)
|
add_definitions(-DUSE_XTEST -DUSE_I18N)
|
||||||
|
|
||||||
add_executable(xvkbd xvkbd.c findwidget.c)
|
add_executable(xvkbd xvkbd.c findwidget.c)
|
||||||
|
|
||||||
set(XVFBDLIBS)
|
|
||||||
|
|
||||||
if(PKG_CONFIG_FOUND)
|
|
||||||
pkg_check_modules(XAWLIB REQUIRED xaw7)
|
|
||||||
list(APPEND XVFBDLIBS ${XAWLIB_LIBRARIES})
|
|
||||||
pkg_check_modules(XTEST REQUIRED xtst)
|
|
||||||
list(APPEND XVFBDLIBS ${XTEST_LIBRARIES})
|
|
||||||
else()
|
|
||||||
list(APPEND XVFBDLIBS -lXaw7)
|
|
||||||
foreach(_lb Xt XTest X11)
|
|
||||||
if(X11_${_lb}_LIB)
|
|
||||||
list(APPEND XVFBDLIBS ${X11_${_lb}_LIB})
|
|
||||||
else()
|
|
||||||
message(FATAL_ERROR "Library for ${_lb} not found")
|
|
||||||
endif()
|
|
||||||
endforeach()
|
|
||||||
endif()
|
|
||||||
|
|
||||||
target_link_libraries(xvkbd ${XVFBDLIBS})
|
target_link_libraries(xvkbd ${XVFBDLIBS})
|
||||||
add_dependencies(lyx_run_tests xvkbd)
|
add_dependencies(lyx_run_tests xvkbd)
|
||||||
|
Loading…
Reference in New Issue
Block a user