lyx_mirror/development/autotests/xvkbd/CMakeLists.txt
Vincent van Ravesteijn 1b3871b302 Add custom target to run tests
This target can depend on the individual test projects and this makes sure
that the test projects are build before running the tests.
2012-12-17 22:26:14 +01:00

34 lines
814 B
CMake

# 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
#
project(xvkbd)
find_package(PkgConfig)
add_definitions(-DUSE_XTEST -DUSE_I18N)
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})
add_dependencies(lyx_run_tests xvkbd)