Warning, /office/kexi/cmake/modules/CheckIfQtGuiCanBeExecuted.cmake is written in an unsupported language. File is not indexed.
0001 # Copyright (C) 2016 Jarosław Staniek <staniek@kde.org>
0002 #
0003 # Redistribution and use is allowed according to the terms of the BSD license.
0004 # For details see the accompanying COPYING-CMAKE-SCRIPTS file.
0005
0006 # Global variables
0007 # KEXI_QTGUI_RUNTIME_AVAILABLE - TRUE if Qt GUI can be used at runtime for configuration and test apps
0008 #
0009 # CMake options
0010 # KEXI_ENABLE_QTGUI_FOR_TESTS - TRUE if configuration or test apps that require Qt GUI
0011 # should be executed; by default equal to ${KEXI_QTGUI_RUNTIME_AVAILABLE}
0012
0013 if(NOT DEFINED KEXI_QTGUI_RUNTIME_AVAILABLE)
0014 set(KEXI_QTGUI_RUNTIME_AVAILABLE TRUE CACHE BOOL "TRUE if Qt GUI can be used at runtime for configuration and test apps")
0015 if(${CMAKE_SYSTEM_NAME} MATCHES "Linux" OR ${CMAKE_SYSTEM_NAME} MATCHES "BSD" OR ${CMAKE_SYSTEM_NAME} MATCHES "GNU")
0016 execute_process(COMMAND xset q # check presence of X11; TODO support Wayland, etc.
0017 RESULT_VARIABLE XSET_RESULT
0018 )
0019 if(NOT ${XSET_RESULT} EQUAL 0)
0020 set(KEXI_QTGUI_RUNTIME_AVAILABLE FALSE)
0021 endif()
0022 endif()
0023 mark_as_advanced(KEXI_QTGUI_RUNTIME_AVAILABLE)
0024 endif()
0025
0026 if(NOT KEXI_QTGUI_RUNTIME_AVAILABLE)
0027 message(STATUS "Note: Graphical interface is not available so configuration and test apps that require Qt GUI won't be executed")
0028 endif()
0029
0030 option(KEXI_ENABLE_QTGUI_FOR_TESTS "Enable using GUI for running tests or configuration programs. Switch it off if your build environment."
0031 ${KEXI_QTGUI_RUNTIME_AVAILABLE})