diff --git a/CMakeLists.txt b/CMakeLists.txt index 7d4d1f26..62ed019b 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -13,24 +13,18 @@ option(enable-glib "Build GLib support" ON) option(enable-xcb "Compile with xcb support" ON) option(enable-wayland "Compile with support for wayland" ON) -option(enable-qt5-inputcontext "Compile with Qt 5 input context" ON) +option(enable-qt-inputcontext "Compile with Qt input context" ON) option(enable-hwkeyboard "Enable support for the hardware keyboard" ON) option(enable-dbus-activation "Enable dbus activation support for maliit-server" OFF) +option(with-qt6 "Built with Qt 6 instead of Qt 5" OFF) # Install paths include(GNUInstallDirs) -if(NOT DEFINED QT5_PLUGINS_INSTALL_DIR) - set(QT5_PLUGINS_INSTALL_DIR "${CMAKE_INSTALL_LIBDIR}/qt5/plugins" CACHE PATH - "Installation directory for Qt 5 plugins [LIB_INSTALL_DIR/qt5/plugins]") -endif() - -if(NOT DEFINED QT5_MKSPECS_INSTALL_DIR) - set(QT5_MKSPECS_INSTALL_DIR "${CMAKE_INSTALL_LIBDIR}/qt5/mkspecs" CACHE PATH - "Installation directory for Qt 5 mkspecs files [LIB_INSTALL_DIR/qt5/mkspecs]") -endif() - +# Extra find-modules +find_package(ECM QUIET REQUIRED NO_MODULE) +list(APPEND CMAKE_MODULE_PATH ${ECM_MODULE_PATH}) list(APPEND CMAKE_MODULE_PATH "${CMAKE_SOURCE_DIR}/cmake") set(CMAKE_INCLUDE_CURRENT_DIR ON) @@ -38,20 +32,44 @@ set(CMAKE_AUTOMOC ON) find_package(PkgConfig REQUIRED) -find_package(Qt5Core) -find_package(Qt5DBus) -find_package(Qt5Gui REQUIRED PRIVATE) -find_package(Qt5Quick) +if(with-qt6) + find_package(Qt6 6.0 REQUIRED COMPONENTS Core DBus Gui Quick) +endif() + +if(Qt6_FOUND) + set(QT_VERSION_MAJOR 6) +else() + find_package(Qt5 REQUIRED COMPONENTS Core DBus Gui Quick) + set(QT_VERSION_MAJOR 5) +endif() + +if(NOT DEFINED QT_PLUGINS_INSTALL_DIR) + set(QT_PLUGINS_INSTALL_DIR "${CMAKE_INSTALL_LIBDIR}/qt${QT_VERSION_MAJOR}/plugins" CACHE PATH + "Installation directory for Qt ${QT_VERSION_MAJOR} plugins [LIB_INSTALL_DIR/qt${QT_VERSION_MAJOR}/plugins]") +endif() + +if(NOT DEFINED QT_MKSPECS_INSTALL_DIR) + set(QT_MKSPECS_INSTALL_DIR "${CMAKE_INSTALL_LIBDIR}/qt${QT_VERSION_MAJOR}/mkspecs" CACHE PATH + "Installation directory for Qt 5 mkspecs files [LIB_INSTALL_DIR/qt${QT_VERSION_MAJOR}/mkspecs]") +endif() if(enable-wayland) + if (Qt6_FOUND) + find_package(Qt6 REQUIRED COMPONENTS WaylandClient WaylandGlobalPrivate) + else() + find_package(Qt5 5.14 REQUIRED COMPONENTS WaylandClient XkbCommonSupport) + endif() find_package(WaylandProtocols REQUIRED PRIVATE) find_package(QtWaylandScanner REQUIRED) find_package(Wayland REQUIRED) - find_package(Qt5WaylandClient 5.14 REQUIRED PRIVATE) - find_package(Qt5XkbCommonSupport REQUIRED PRIVATE) pkg_check_modules(XKBCOMMON REQUIRED IMPORTED_TARGET xkbcommon) endif() +if (Qt6_FOUND) + include_directories(PRIVATE ${Qt6Gui_PRIVATE_INCLUDE_DIRS}) +else() + include_directories(PRIVATE ${Qt5Gui_PRIVATE_INCLUDE_DIRS}) +endif() include_directories(src common) add_library(maliit-common STATIC @@ -59,7 +77,7 @@ add_library(maliit-common STATIC common/maliit/namespaceinternal.h common/maliit/settingdata.cpp common/maliit/settingdata.h) -target_link_libraries(maliit-common Qt5::Core) +target_link_libraries(maliit-common Qt::Core) target_include_directories(maliit-common PUBLIC common) set(CONNECTION_SOURCES @@ -85,7 +103,8 @@ if(enable-wayland) connection/waylandinputmethodconnection.cpp connection/waylandinputmethodconnection.h) - ecm_add_qtwayland_client_protocol(CONNECTION_SOURCES PROTOCOL ${WAYLANDPROTOCOLS_PATH}/unstable/input-method/input-method-unstable-v1.xml BASENAME input-method-unstable-v1) + ecm_add_qtwayland_client_protocol(CONNECTION_SOURCES PROTOCOL ${WaylandProtocols_DATADIR}/unstable/input-method/input-method-unstable-v1.xml BASENAME input-method-unstable-v1) + ecm_add_qtwayland_client_protocol(CONNECTION_SOURCES PROTOCOL ${WaylandProtocols_DATADIR}/unstable/text-input/text-input-unstable-v1.xml BASENAME text-input-unstable-v1) add_definitions(-DHAVE_WAYLAND) endif() @@ -93,21 +112,27 @@ endif() set_source_files_properties(dbus_interfaces/minputmethodcontext1interface.xml dbus_interfaces/minputmethodserver1interface.xml PROPERTIES INCLUDE maliit/settingdata.h) +if (Qt6_FOUND) +qt6_add_dbus_adaptor(CONNECTION_SOURCES dbus_interfaces/minputmethodcontext1interface.xml dbusserverconnection.h DBusServerConnection) +qt6_add_dbus_adaptor(CONNECTION_SOURCES dbus_interfaces/minputmethodserver1interface.xml dbusinputcontextconnection.h DBusInputContextConnection) + +qt6_add_dbus_interface(CONNECTION_SOURCES dbus_interfaces/minputmethodcontext1interface.xml minputmethodcontext1interface_interface) +qt6_add_dbus_interface(CONNECTION_SOURCES dbus_interfaces/minputmethodserver1interface.xml minputmethodserver1interface_interface) +else() qt5_add_dbus_adaptor(CONNECTION_SOURCES dbus_interfaces/minputmethodcontext1interface.xml dbusserverconnection.h DBusServerConnection) qt5_add_dbus_adaptor(CONNECTION_SOURCES dbus_interfaces/minputmethodserver1interface.xml dbusinputcontextconnection.h DBusInputContextConnection) qt5_add_dbus_interface(CONNECTION_SOURCES dbus_interfaces/minputmethodcontext1interface.xml minputmethodcontext1interface_interface) qt5_add_dbus_interface(CONNECTION_SOURCES dbus_interfaces/minputmethodserver1interface.xml minputmethodserver1interface_interface) +endif() add_library(maliit-connection STATIC ${CONNECTION_SOURCES}) -target_link_libraries(maliit-connection Qt5::Core Qt5::DBus Qt5::Gui maliit-common) +target_link_libraries(maliit-connection Qt::Core Qt::DBus Qt::Gui maliit-common) if(enable-wayland) target_link_libraries(maliit-connection Wayland::Client PkgConfig::XKBCOMMON) - target_include_directories(maliit-connection PRIVATE ${Qt5WaylandClient_PRIVATE_INCLUDE_DIRS}) endif() -target_include_directories(maliit-connection PUBLIC connection) -include_directories(${Qt5Gui_PRIVATE_INCLUDE_DIRS}) +target_include_directories(maliit-connection PUBLIC connection) set(PLUGINS_SOURCES src/maliit/plugins/abstractinputmethod.cpp @@ -187,7 +212,7 @@ if(enable-xcb) list(APPEND PLUGINS_SOURCES src/xcbplatform.cpp src/xcbplatform.h) - find_package(XCB REQUIRED xfixes) + find_package(XCB REQUIRED XFIXES) list(APPEND PLUGINS_INCLUDE_DIRS ${XCB_INCLUDE_DIRS}) list(APPEND PLUGINS_LIBRARIES ${XCB_LIBRARIES}) add_definitions(-DHAVE_XCB) @@ -212,7 +237,7 @@ endif() add_library(maliit-plugins SHARED ${PLUGINS_SOURCES} ${PLUGINS_HEADER}) target_link_libraries(maliit-plugins PRIVATE maliit-common maliit-connection ${PLUGINS_LIBRARIES}) -target_link_libraries(maliit-plugins PUBLIC Qt5::Core Qt5::Gui Qt5::Quick) +target_link_libraries(maliit-plugins PUBLIC Qt::Core Qt::Gui Qt::Quick) target_include_directories(maliit-plugins PRIVATE ${PLUGINS_INCLUDE_DIRS}) set_target_properties(maliit-plugins PROPERTIES SOVERSION ${PROJECT_VERSION_MAJOR} @@ -287,14 +312,14 @@ add_definitions(-DMALIIT_FRAMEWORK_USE_INTERNAL_API add_executable(maliit-server passthroughserver/main.cpp) target_link_libraries(maliit-server maliit-plugins maliit-connection) -if(enable-qt5-inputcontext) +if(enable-qt-inputcontext) set(INPUT_CONTEXT_SOURCES input-context/main.cpp input-context/minputcontext.cpp input-context/minputcontext.h) add_library(maliitplatforminputcontextplugin MODULE ${INPUT_CONTEXT_SOURCES}) - target_link_libraries(maliitplatforminputcontextplugin maliit-connection Qt5::Quick) + target_link_libraries(maliitplatforminputcontextplugin maliit-connection Qt::Quick) endif() if(enable-wayland) @@ -303,34 +328,39 @@ if(enable-wayland) src/qt/plugins/shellintegration/qwaylandinputpanelshellintegration.cpp src/qt/plugins/shellintegration/qwaylandinputpanelshellintegration.h src/qt/plugins/shellintegration/qwaylandinputpanelsurface.cpp src/qt/plugins/shellintegration/qwaylandinputpanelsurface.h) - ecm_add_qtwayland_client_protocol(INPUT_PANEL_SHELL_SOURCES PROTOCOL ${WAYLANDPROTOCOLS_PATH}/unstable/input-method/input-method-unstable-v1.xml BASENAME input-method-unstable-v1) + ecm_add_qtwayland_client_protocol(INPUT_PANEL_SHELL_SOURCES PROTOCOL ${WaylandProtocols_DATADIR}/unstable/input-method/input-method-unstable-v1.xml BASENAME input-method-unstable-v1) add_library(inputpanel-shell MODULE ${INPUT_PANEL_SHELL_SOURCES}) - target_link_libraries(inputpanel-shell Qt5::WaylandClient PkgConfig::XKBCOMMON Wayland::Client) - target_include_directories(inputpanel-shell PRIVATE ${Qt5WaylandClient_PRIVATE_INCLUDE_DIRS} ${Qt5XkbCommonSupport_PRIVATE_INCLUDE_DIRS}) + target_link_libraries(inputpanel-shell Qt::WaylandClient PkgConfig::XKBCOMMON Wayland::Client) + if (Qt6_FOUND) + target_link_libraries(inputpanel-shell Qt::WaylandGlobalPrivate) + target_include_directories(inputpanel-shell PRIVATE ${Qt6WaylandClient_PRIVATE_INCLUDE_DIRS} ${Qt6WaylandGlobalPrivate_PRIVATE_INCLUDE_DIRS} ${Qt6XkbCommonSupport_PRIVATE_INCLUDE_DIRS}) + else() + target_include_directories(inputpanel-shell PRIVATE ${Qt5WaylandClient_PRIVATE_INCLUDE_DIRS} ${Qt5XkbCommonSupport_PRIVATE_INCLUDE_DIRS}) + endif() endif() if(enable-examples) - find_package(Qt5Widgets) + find_package(Qt${QT_VERSION_MAJOR} REQUIRED COMPONENTS Widgets) add_executable(maliit-exampleapp-plainqt examples/apps/plainqt/mainwindow.cpp examples/apps/plainqt/mainwindow.h examples/apps/plainqt/plainqt.cpp) - target_link_libraries(maliit-exampleapp-plainqt Qt5::Gui Qt5::Widgets) + target_link_libraries(maliit-exampleapp-plainqt Qt::Gui Qt::Widgets) add_library(cxxhelloworldplugin MODULE examples/plugins/cxx/helloworld/helloworldinputmethod.cpp examples/plugins/cxx/helloworld/helloworldinputmethod.h examples/plugins/cxx/helloworld/helloworldplugin.cpp examples/plugins/cxx/helloworld/helloworldplugin.h) - target_link_libraries(cxxhelloworldplugin maliit-plugins Qt5::Widgets) + target_link_libraries(cxxhelloworldplugin maliit-plugins Qt::Widgets) add_library(cxxoverrideplugin MODULE examples/plugins/cxx/override/overrideinputmethod.cpp examples/plugins/cxx/override/overrideinputmethod.h examples/plugins/cxx/override/overrideplugin.cpp examples/plugins/cxx/override/overrideplugin.h) - target_link_libraries(cxxoverrideplugin maliit-plugins Qt5::Widgets) + target_link_libraries(cxxoverrideplugin maliit-plugins Qt::Widgets) endif() # Documentation @@ -394,7 +424,7 @@ install(FILES src/mimserver.h install(FILES ${CMAKE_BINARY_DIR}/maliit-framework.pc ${CMAKE_BINARY_DIR}/maliit-plugins.pc ${CMAKE_BINARY_DIR}/maliit-server.pc DESTINATION ${CMAKE_INSTALL_LIBDIR}/pkgconfig) install(FILES ${CMAKE_BINARY_DIR}/maliit-framework.prf ${CMAKE_BINARY_DIR}/maliit-plugins.prf ${CMAKE_BINARY_DIR}/maliit-defines.prf - DESTINATION ${QT5_MKSPECS_INSTALL_DIR}/features) + DESTINATION ${QT_MKSPECS_INSTALL_DIR}/features) install(EXPORT MaliitPluginsTargets FILE MaliitPluginsTargets.cmake DESTINATION ${CMAKE_INSTALL_LIBDIR}/cmake/MaliitPlugins) install(FILES ${CMAKE_CURRENT_BINARY_DIR}/MaliitPluginsConfig.cmake ${CMAKE_CURRENT_BINARY_DIR}/MaliitPluginsConfigVersion.cmake @@ -431,12 +461,12 @@ if(enable-glib) endif() if(enable-qt5-inputcontext) - install(TARGETS maliitplatforminputcontextplugin LIBRARY DESTINATION ${QT5_PLUGINS_INSTALL_DIR}/platforminputcontexts) + install(TARGETS maliitplatforminputcontextplugin LIBRARY DESTINATION ${QT_PLUGINS_INSTALL_DIR}/platforminputcontexts) endif() if(enable-wayland) install(TARGETS inputpanel-shell - LIBRARY DESTINATION ${QT5_PLUGINS_INSTALL_DIR}/wayland-shell-integration) + LIBRARY DESTINATION ${QT_PLUGINS_INSTALL_DIR}/wayland-shell-integration) endif() if(enable-dbus-activation) @@ -455,7 +485,7 @@ endif() if(enable-tests) enable_testing() - find_package(Qt5Test) + find_package(Qt${QT_VERSION_MAJOR} REQUIRED COMPONENTS Test) set(TEST_PLUGINS_DIR ${CMAKE_BINARY_DIR}/tests/plugins) @@ -496,7 +526,7 @@ if(enable-tests) tests/utils/core-utils.h tests/utils/gui-utils.cpp tests/utils/gui-utils.h) - target_link_libraries(test-utils PUBLIC Qt5::Core Qt5::Gui Qt5::Test maliit-connection) + target_link_libraries(test-utils PUBLIC Qt::Core Qt::Gui Qt::Test maliit-connection) target_include_directories(test-utils INTERFACE tests/utils) target_compile_definitions(test-utils PUBLIC -DMALIIT_TEST_PLUGINS_DIR="${CMAKE_INSTALL_FULL_LIBDIR}/maliit-framework-tests/plugins" @@ -507,7 +537,7 @@ if(enable-tests) tests/stubs/mkeyboardstatetracker_stub.h tests/stubs/fakeproperty.cpp tests/stubs/fakeproperty.h) - target_link_libraries(test-stubs PUBLIC Qt5::Core) + target_link_libraries(test-stubs PUBLIC Qt::Core) target_include_directories(test-stubs INTERFACE tests/stubs) function(create_test name) diff --git a/cmake/ECMFindModuleHelpers.cmake b/cmake/ECMFindModuleHelpers.cmake deleted file mode 100644 index 5e16b949..00000000 --- a/cmake/ECMFindModuleHelpers.cmake +++ /dev/null @@ -1,278 +0,0 @@ -#.rst: -# ECMFindModuleHelpers -# -------------------- -# -# Helper macros for find modules: ecm_find_package_version_check(), -# ecm_find_package_parse_components() and -# ecm_find_package_handle_library_components(). -# -# :: -# -# ecm_find_package_version_check() -# -# Prints warnings if the CMake version or the project's required CMake version -# is older than that required by extra-cmake-modules. -# -# :: -# -# ecm_find_package_parse_components( -# RESULT_VAR -# KNOWN_COMPONENTS [ [...]] -# [SKIP_DEPENDENCY_HANDLING]) -# -# This macro will populate with a list of components found in -# _FIND_COMPONENTS, after checking that all those components are in the -# list of KNOWN_COMPONENTS; if there are any unknown components, it will print -# an error or warning (depending on the value of _FIND_REQUIRED) and call -# return(). -# -# The order of components in is guaranteed to match the order they -# are listed in the KNOWN_COMPONENTS argument. -# -# If SKIP_DEPENDENCY_HANDLING is not set, for each component the variable -# __component_deps will be checked for dependent components. -# If is listed in _FIND_COMPONENTS, then all its (transitive) -# dependencies will also be added to . -# -# :: -# -# ecm_find_package_handle_library_components( -# COMPONENTS [ [...]] -# [SKIP_DEPENDENCY_HANDLING]) -# [SKIP_PKG_CONFIG]) -# -# Creates an imported library target for each component. The operation of this -# macro depends on the presence of a number of CMake variables. -# -# The __lib variable should contain the name of this library, -# and __header variable should contain the name of a header -# file associated with it (whatever relative path is normally passed to -# '#include'). __header_subdir variable can be used to specify -# which subdirectory of the include path the headers will be found in. -# ecm_find_package_components() will then search for the library -# and include directory (creating appropriate cache variables) and create an -# imported library target named ::. -# -# Additional variables can be used to provide additional information: -# -# If SKIP_PKG_CONFIG, the __pkg_config variable is set, and -# pkg-config is found, the pkg-config module given by -# __pkg_config will be searched for and used to help locate the -# library and header file. It will also be used to set -# __VERSION. -# -# Note that if version information is found via pkg-config, -# __FIND_VERSION can be set to require a particular version -# for each component. -# -# If SKIP_DEPENDENCY_HANDLING is not set, the INTERFACE_LINK_LIBRARIES property -# of the imported target for will be set to contain the imported -# targets for the components listed in __component_deps. -# _FOUND will also be set to false if any of the compoments in -# __component_deps are not found. This requires the components -# in __component_deps to be listed before in the -# COMPONENTS argument. -# -# The following variables will be set: -# -# ``_TARGETS`` -# the imported targets -# ``_LIBRARIES`` -# the found libraries -# ``_INCLUDE_DIRS`` -# the combined required include directories for the components -# ``_DEFINITIONS`` -# the "other" CFLAGS provided by pkg-config, if any -# ``_VERSION`` -# the value of ``__VERSION`` for the first component that -# has this variable set (note that components are searched for in the order -# they are passed to the macro), although if it is already set, it will not -# be altered -# -# Note that these variables are never cleared, so if -# ecm_find_package_handle_library_components() is called multiple times with -# different components (typically because of multiple find_package() calls) then -# ``_TARGETS``, for example, will contain all the targets found in any -# call (although no duplicates). -# -# Since pre-1.0.0. - -#============================================================================= -# SPDX-FileCopyrightText: 2014 Alex Merry -# -# SPDX-License-Identifier: BSD-3-Clause - -include(CMakeParseArguments) - -macro(ecm_find_package_version_check module_name) - if(CMAKE_VERSION VERSION_LESS 2.8.12) - message(FATAL_ERROR "CMake 2.8.12 is required by Find${module_name}.cmake") - endif() - if(CMAKE_MINIMUM_REQUIRED_VERSION VERSION_LESS 2.8.12) - message(AUTHOR_WARNING "Your project should require at least CMake 2.8.12 to use Find${module_name}.cmake") - endif() -endmacro() - -macro(ecm_find_package_parse_components module_name) - set(ecm_fppc_options SKIP_DEPENDENCY_HANDLING) - set(ecm_fppc_oneValueArgs RESULT_VAR) - set(ecm_fppc_multiValueArgs KNOWN_COMPONENTS DEFAULT_COMPONENTS) - cmake_parse_arguments(ECM_FPPC "${ecm_fppc_options}" "${ecm_fppc_oneValueArgs}" "${ecm_fppc_multiValueArgs}" ${ARGN}) - - if(ECM_FPPC_UNPARSED_ARGUMENTS) - message(FATAL_ERROR "Unexpected arguments to ecm_find_package_parse_components: ${ECM_FPPC_UNPARSED_ARGUMENTS}") - endif() - if(NOT ECM_FPPC_RESULT_VAR) - message(FATAL_ERROR "Missing RESULT_VAR argument to ecm_find_package_parse_components") - endif() - if(NOT ECM_FPPC_KNOWN_COMPONENTS) - message(FATAL_ERROR "Missing KNOWN_COMPONENTS argument to ecm_find_package_parse_components") - endif() - if(NOT ECM_FPPC_DEFAULT_COMPONENTS) - set(ECM_FPPC_DEFAULT_COMPONENTS ${ECM_FPPC_KNOWN_COMPONENTS}) - endif() - - if(${module_name}_FIND_COMPONENTS) - set(ecm_fppc_requestedComps ${${module_name}_FIND_COMPONENTS}) - - if(NOT ECM_FPPC_SKIP_DEPENDENCY_HANDLING) - # Make sure deps are included - foreach(ecm_fppc_comp ${ecm_fppc_requestedComps}) - foreach(ecm_fppc_dep_comp ${${module_name}_${ecm_fppc_comp}_component_deps}) - list(FIND ecm_fppc_requestedComps "${ecm_fppc_dep_comp}" ecm_fppc_index) - if("${ecm_fppc_index}" STREQUAL "-1") - if(NOT ${module_name}_FIND_QUIETLY) - message(STATUS "${module_name}: ${ecm_fppc_comp} requires ${${module_name}_${ecm_fppc_comp}_component_deps}") - endif() - list(APPEND ecm_fppc_requestedComps "${ecm_fppc_dep_comp}") - endif() - endforeach() - endforeach() - else() - message(STATUS "Skipping dependency handling for ${module_name}") - endif() - list(REMOVE_DUPLICATES ecm_fppc_requestedComps) - - # This makes sure components are listed in the same order as - # KNOWN_COMPONENTS (potentially important for inter-dependencies) - set(${ECM_FPPC_RESULT_VAR}) - foreach(ecm_fppc_comp ${ECM_FPPC_KNOWN_COMPONENTS}) - list(FIND ecm_fppc_requestedComps "${ecm_fppc_comp}" ecm_fppc_index) - if(NOT "${ecm_fppc_index}" STREQUAL "-1") - list(APPEND ${ECM_FPPC_RESULT_VAR} "${ecm_fppc_comp}") - list(REMOVE_AT ecm_fppc_requestedComps ${ecm_fppc_index}) - endif() - endforeach() - # if there are any left, they are unknown components - if(ecm_fppc_requestedComps) - set(ecm_fppc_msgType STATUS) - if(${module_name}_FIND_REQUIRED) - set(ecm_fppc_msgType FATAL_ERROR) - endif() - if(NOT ${module_name}_FIND_QUIETLY) - message(${ecm_fppc_msgType} "${module_name}: requested unknown components ${ecm_fppc_requestedComps}") - endif() - return() - endif() - else() - set(${ECM_FPPC_RESULT_VAR} ${ECM_FPPC_DEFAULT_COMPONENTS}) - endif() -endmacro() - -macro(ecm_find_package_handle_library_components module_name) - set(ecm_fpwc_options SKIP_PKG_CONFIG SKIP_DEPENDENCY_HANDLING) - set(ecm_fpwc_oneValueArgs) - set(ecm_fpwc_multiValueArgs COMPONENTS) - cmake_parse_arguments(ECM_FPWC "${ecm_fpwc_options}" "${ecm_fpwc_oneValueArgs}" "${ecm_fpwc_multiValueArgs}" ${ARGN}) - - if(ECM_FPWC_UNPARSED_ARGUMENTS) - message(FATAL_ERROR "Unexpected arguments to ecm_find_package_handle_components: ${ECM_FPWC_UNPARSED_ARGUMENTS}") - endif() - if(NOT ECM_FPWC_COMPONENTS) - message(FATAL_ERROR "Missing COMPONENTS argument to ecm_find_package_handle_components") - endif() - - include(FindPackageHandleStandardArgs) - find_package(PkgConfig) - foreach(ecm_fpwc_comp ${ECM_FPWC_COMPONENTS}) - set(ecm_fpwc_dep_vars) - set(ecm_fpwc_dep_targets) - if(NOT SKIP_DEPENDENCY_HANDLING) - foreach(ecm_fpwc_dep ${${module_name}_${ecm_fpwc_comp}_component_deps}) - list(APPEND ecm_fpwc_dep_vars "${module_name}_${ecm_fpwc_dep}_FOUND") - list(APPEND ecm_fpwc_dep_targets "${module_name}::${ecm_fpwc_dep}") - endforeach() - endif() - - if(NOT ECM_FPWC_SKIP_PKG_CONFIG AND ${module_name}_${ecm_fpwc_comp}_pkg_config) - pkg_check_modules(PKG_${module_name}_${ecm_fpwc_comp} QUIET - ${${module_name}_${ecm_fpwc_comp}_pkg_config}) - endif() - - find_path(${module_name}_${ecm_fpwc_comp}_INCLUDE_DIR - NAMES ${${module_name}_${ecm_fpwc_comp}_header} - HINTS ${PKG_${module_name}_${ecm_fpwc_comp}_INCLUDE_DIRS} - PATH_SUFFIXES ${${module_name}_${ecm_fpwc_comp}_header_subdir} - ) - find_library(${module_name}_${ecm_fpwc_comp}_LIBRARY - NAMES ${${module_name}_${ecm_fpwc_comp}_lib} - HINTS ${PKG_${module_name}_${ecm_fpwc_comp}_LIBRARY_DIRS} - ) - - set(${module_name}_${ecm_fpwc_comp}_VERSION "${PKG_${module_name}_${ecm_fpwc_comp}_VERSION}") - if(NOT ${module_name}_VERSION) - set(${module_name}_VERSION ${${module_name}_${ecm_fpwc_comp}_VERSION}) - endif() - - set(FPHSA_NAME_MISMATCHED 1) - find_package_handle_standard_args(${module_name}_${ecm_fpwc_comp} - FOUND_VAR - ${module_name}_${ecm_fpwc_comp}_FOUND - REQUIRED_VARS - ${module_name}_${ecm_fpwc_comp}_LIBRARY - ${module_name}_${ecm_fpwc_comp}_INCLUDE_DIR - ${ecm_fpwc_dep_vars} - VERSION_VAR - ${module_name}_${ecm_fpwc_comp}_VERSION - ) - unset(FPHSA_NAME_MISMATCHED) - - mark_as_advanced( - ${module_name}_${ecm_fpwc_comp}_LIBRARY - ${module_name}_${ecm_fpwc_comp}_INCLUDE_DIR - ) - - if(${module_name}_${ecm_fpwc_comp}_FOUND) - list(APPEND ${module_name}_LIBRARIES - "${${module_name}_${ecm_fpwc_comp}_LIBRARY}") - list(APPEND ${module_name}_INCLUDE_DIRS - "${${module_name}_${ecm_fpwc_comp}_INCLUDE_DIR}") - set(${module_name}_DEFINITIONS - ${${module_name}_DEFINITIONS} - ${PKG_${module_name}_${ecm_fpwc_comp}_DEFINITIONS}) - if(NOT TARGET ${module_name}::${ecm_fpwc_comp}) - add_library(${module_name}::${ecm_fpwc_comp} UNKNOWN IMPORTED) - set_target_properties(${module_name}::${ecm_fpwc_comp} PROPERTIES - IMPORTED_LOCATION "${${module_name}_${ecm_fpwc_comp}_LIBRARY}" - INTERFACE_COMPILE_OPTIONS "${PKG_${module_name}_${ecm_fpwc_comp}_DEFINITIONS}" - INTERFACE_INCLUDE_DIRECTORIES "${${module_name}_${ecm_fpwc_comp}_INCLUDE_DIR}" - INTERFACE_LINK_LIBRARIES "${ecm_fpwc_dep_targets}" - ) - endif() - list(APPEND ${module_name}_TARGETS - "${module_name}::${ecm_fpwc_comp}") - endif() - endforeach() - if(${module_name}_LIBRARIES) - list(REMOVE_DUPLICATES ${module_name}_LIBRARIES) - endif() - if(${module_name}_INCLUDE_DIRS) - list(REMOVE_DUPLICATES ${module_name}_INCLUDE_DIRS) - endif() - if(${module_name}_DEFINITIONS) - list(REMOVE_DUPLICATES ${module_name}_DEFINITIONS) - endif() - if(${module_name}_TARGETS) - list(REMOVE_DUPLICATES ${module_name}_TARGETS) - endif() -endmacro() diff --git a/cmake/FindGLib2.cmake b/cmake/FindGLib2.cmake deleted file mode 100644 index bc892f78..00000000 --- a/cmake/FindGLib2.cmake +++ /dev/null @@ -1,57 +0,0 @@ -include(FeatureSummary) -set_package_properties(GLib2 PROPERTIES - URL "https://wiki.gnome.org/Projects/GLib" - DESCRIPTION "GLib provides the core application building blocks for libraries and applications written in C") - -find_package(PkgConfig) -pkg_check_modules(PC_GLib2 glib-2.0>=2.38 QUIET) - -set(GLib2_INCLUDE_DIRS ${PC_GLib2_INCLUDE_DIRS}) - -foreach(COMP ${PC_GLib2_LIBRARIES}) - find_library(GLib2_${COMP} NAMES ${COMP} HINTS ${PC_GLib2_LIBRARY_DIRS}) - list(APPEND GLib2_LIBRARIES ${GLib2_${COMP}}) -endforeach() - -execute_process(COMMAND ${PKG_CONFIG_EXECUTABLE} --variable glib_genmarshal glib-2.0 - OUTPUT_VARIABLE GLib2_GENMARHSAL_EXECUTABLE) - -string(REGEX REPLACE "[\r\n]" " " GLib2_GENMARHSAL_EXECUTABLE "${GLib2_GENMARHSAL_EXECUTABLE}") -string(REGEX REPLACE " +$" "" GLib2_GENMARHSAL_EXECUTABLE "${GLib2_GENMARHSAL_EXECUTABLE}") - -# handle the QUIETLY and REQUIRED arguments and set GLib2_FOUND to TRUE if -# all listed variables are TRUE -include(FindPackageHandleStandardArgs) -find_package_handle_standard_args(GLib2 DEFAULT_MSG GLib2_LIBRARIES GLib2_INCLUDE_DIRS) - -mark_as_advanced(GLib2_INCLUDE_DIRS GLib2_LIBRARIES) - -if(PC_GLib2_FOUND AND NOT TARGET GLib2::GLib) - add_library(GLib2::GLib INTERFACE IMPORTED) - - set_property(TARGET GLib2::GLib PROPERTY INTERFACE_INCLUDE_DIRECTORIES ${GLib2_INCLUDE_DIRS}) - set_property(TARGET GLib2::GLib PROPERTY INTERFACE_LINK_LIBRARIES ${GLib2_LIBRARIES}) -endif() - -function(GLib2_ADD_MARSHAL _sources _marshallist) - get_filename_component(_infile ${_marshallist} ABSOLUTE) - get_filename_component(_basename ${_marshallist} NAME_WE) - set(_header "${CMAKE_CURRENT_BINARY_DIR}/${_basename}.h") - set(_body "${CMAKE_CURRENT_BINARY_DIR}/${_basename}.c") - - get_source_file_property(_prefix ${_marshallist} PREFIX) - if(_prefix) - set(_params ${_params} --prefix ${_prefix}) - endif() - - add_custom_command(OUTPUT "${_header}" - COMMAND ${GLib2_GENMARHSAL_EXECUTABLE} --header ${_params} ${_infile} > ${_header} - DEPENDS ${_infile} VERBATIM) - add_custom_command(OUTPUT "${_body}" - COMMAND ${GLib2_GENMARHSAL_EXECUTABLE} --body ${_params} ${_infile} > ${_body} - DEPENDS ${_infile} VERBATIM) - - set_property(SOURCE ${_body} ${_header} PROPERTY SKIP_AUTOMOC ON) - list(APPEND ${_sources} "${_body}" "${_header}") - set(${_sources} ${${_sources}} PARENT_SCOPE) -endfunction() diff --git a/cmake/FindQtWaylandScanner.cmake b/cmake/FindQtWaylandScanner.cmake deleted file mode 100644 index f38ee7f9..00000000 --- a/cmake/FindQtWaylandScanner.cmake +++ /dev/null @@ -1,174 +0,0 @@ -#.rst: -# FindQtWaylandScanner -# -------------------- -# -# Try to find qtwaylandscanner. -# -# If the qtwaylandscanner executable is not in your PATH, you can provide -# an alternative name or full path location with the ``QtWaylandScanner_EXECUTABLE`` -# variable. -# -# This will define the following variables: -# -# ``QtWaylandScanner_FOUND`` -# True if qtwaylandscanner is available -# -# ``QtWaylandScanner_EXECUTABLE`` -# The qtwaylandscanner executable. -# -# If ``QtWaylandScanner_FOUND`` is TRUE, it will also define the following imported -# target: -# -# ``Wayland::QtScanner`` -# The qtwaylandscanner executable. -# -# This module provides the following functions to generate C++ protocol -# implementations: -# -# - ``ecm_add_qtwayland_client_protocol`` -# - ``ecm_add_qtwayland_server_protocol`` -# -# :: -# -# ecm_add_qtwayland_client_protocol( -# PROTOCOL -# BASENAME -# [PREFIX ]) -# -# Generate C++ wrapper to Wayland client protocol files from ```` -# XML definition for the ```` interface and append those files -# to ````. Pass the ```` argument if the interface -# names don't start with ``qt_`` or ``wl_``. -# -# WaylandScanner is required and will be searched for. -# -# :: -# -# ecm_add_qtwayland_server_protocol( -# PROTOCOL -# BASENAME -# [PREFIX ]) -# -# Generate C++ wrapper to Wayland server protocol files from ```` -# XML definition for the ```` interface and append those files -# to ````. Pass the ```` argument if the interface -# names don't start with ``qt_`` or ``wl_``. -# -# WaylandScanner is required and will be searched for. -# -# Since 1.4.0. - -#============================================================================= -# SPDX-FileCopyrightText: 2012-2014 Pier Luigi Fiorini -# -# SPDX-License-Identifier: BSD-3-Clause -#============================================================================= - -include(${CMAKE_CURRENT_LIST_DIR}/ECMFindModuleHelpers.cmake) - -ecm_find_package_version_check(QtWaylandScanner) - -# Find qtwaylandscanner -find_program(QtWaylandScanner_EXECUTABLE NAMES qtwaylandscanner - HINTS /usr/lib64/qt5/bin/ /usr/lib/qt5/bin/) - -include(FindPackageHandleStandardArgs) -find_package_handle_standard_args(QtWaylandScanner - FOUND_VAR - QtWaylandScanner_FOUND - REQUIRED_VARS - QtWaylandScanner_EXECUTABLE -) - -mark_as_advanced(QtWaylandScanner_EXECUTABLE) - -if(NOT TARGET Wayland::QtScanner AND QtWaylandScanner_FOUND) - add_executable(Wayland::QtScanner IMPORTED) - set_target_properties(Wayland::QtScanner PROPERTIES - IMPORTED_LOCATION "${QtWaylandScanner_EXECUTABLE}" - ) -endif() - -include(FeatureSummary) -set_package_properties(QtWaylandScanner PROPERTIES - URL "https://qt.io/" - DESCRIPTION "Executable that converts XML protocol files to C++ code" -) - - -include(CMakeParseArguments) - -function(ecm_add_qtwayland_client_protocol out_var) - # Parse arguments - set(oneValueArgs PROTOCOL BASENAME PREFIX) - cmake_parse_arguments(ARGS "" "${oneValueArgs}" "" ${ARGN}) - - if(ARGS_UNPARSED_ARGUMENTS) - message(FATAL_ERROR "Unknown keywords given to ecm_add_qtwayland_client_protocol(): \"${ARGS_UNPARSED_ARGUMENTS}\"") - endif() - - set(_prefix "${ARGS_PREFIX}") - - find_package(WaylandScanner REQUIRED QUIET) - ecm_add_wayland_client_protocol(${out_var} - PROTOCOL ${ARGS_PROTOCOL} - BASENAME ${ARGS_BASENAME}) - - get_filename_component(_infile ${ARGS_PROTOCOL} ABSOLUTE) - set(_ccode "${CMAKE_CURRENT_BINARY_DIR}/wayland-${ARGS_BASENAME}-client-protocol.c") - set(_cheader "${CMAKE_CURRENT_BINARY_DIR}/wayland-${ARGS_BASENAME}-client-protocol.h") - set(_header "${CMAKE_CURRENT_BINARY_DIR}/qwayland-${ARGS_BASENAME}.h") - set(_code "${CMAKE_CURRENT_BINARY_DIR}/qwayland-${ARGS_BASENAME}.cpp") - - set_source_files_properties(${_header} ${_code} GENERATED) - - add_custom_command(OUTPUT "${_header}" - COMMAND ${QtWaylandScanner_EXECUTABLE} client-header ${_infile} "" ${_prefix} > ${_header} - DEPENDS ${_infile} ${_cheader} VERBATIM) - - add_custom_command(OUTPUT "${_code}" - COMMAND ${QtWaylandScanner_EXECUTABLE} client-code ${_infile} "" ${_prefix} > ${_code} - DEPENDS ${_infile} ${_header} VERBATIM) - - set_property(SOURCE ${_header} ${_code} ${_cheader} ${_ccode} PROPERTY SKIP_AUTOMOC ON) - - list(APPEND ${out_var} "${_code}") - set(${out_var} ${${out_var}} PARENT_SCOPE) -endfunction() - - -function(ecm_add_qtwayland_server_protocol out_var) - # Parse arguments - set(oneValueArgs PROTOCOL BASENAME PREFIX) - cmake_parse_arguments(ARGS "" "${oneValueArgs}" "" ${ARGN}) - - if(ARGS_UNPARSED_ARGUMENTS) - message(FATAL_ERROR "Unknown keywords given to ecm_add_qtwayland_server_protocol(): \"${ARGS_UNPARSED_ARGUMENTS}\"") - endif() - - set(_prefix "${ARGS_PREFIX}") - - find_package(WaylandScanner REQUIRED QUIET) - ecm_add_wayland_server_protocol(${out_var} - PROTOCOL ${ARGS_PROTOCOL} - BASENAME ${ARGS_BASENAME}) - - get_filename_component(_infile ${ARGS_PROTOCOL} ABSOLUTE) - set(_header "${CMAKE_CURRENT_BINARY_DIR}/qwayland-server-${ARGS_BASENAME}.h") - set(_code "${CMAKE_CURRENT_BINARY_DIR}/qwayland-server-${ARGS_BASENAME}.cpp") - - set_source_files_properties(${_header} ${_code} GENERATED) - - add_custom_command(OUTPUT "${_header}" - COMMAND ${QtWaylandScanner_EXECUTABLE} server-header ${_infile} "" ${_prefix} > ${_header} - DEPENDS ${_infile} VERBATIM) - - add_custom_command(OUTPUT "${_code}" - COMMAND ${QtWaylandScanner_EXECUTABLE} server-code ${_infile} "" ${_prefix} > ${_code} - DEPENDS ${_infile} ${_header} VERBATIM) - - set_property(SOURCE ${_header} ${_code} PROPERTY SKIP_AUTOMOC ON) - - list(APPEND ${out_var} "${_code}") - set(${out_var} ${${out_var}} PARENT_SCOPE) -endfunction() diff --git a/cmake/FindUDev.cmake b/cmake/FindUDev.cmake deleted file mode 100644 index e3d584cb..00000000 --- a/cmake/FindUDev.cmake +++ /dev/null @@ -1,72 +0,0 @@ -#.rst: -# FindUDev -# -------- -# -# Try to find the UDev library. -# -# This will define the following variables: -# -# ``UDev_FOUND`` -# System has UDev. -# -# ``UDev_INCLUDE_DIRS`` -# The libudev include directory. -# -# ``UDev_LIBRARIES`` -# The libudev libraries. -# -# ``UDev_VERSION`` -# The libudev version. -# -# If ``UDev_FOUND`` is TRUE, it will also define the following imported -# target: -# -# ``UDev::UDev`` -# The UDev library -# -# Since 5.57.0. - -#============================================================================= -# SPDX-FileCopyrightText: 2010 Rafael Fernández López -# SPDX-FileCopyrightText: 2019 Volker Krause -# -# SPDX-License-Identifier: BSD-3-Clause -#============================================================================= - -find_package(PkgConfig QUIET) -pkg_check_modules(PC_UDEV QUIET libudev) - -find_path(UDev_INCLUDE_DIRS NAMES libudev.h HINTS ${PC_UDEV_INCLUDE_DIRS}) -find_library(UDev_LIBRARIES NAMES udev HINTS ${PC_UDEV_LIBRARY_DIRS}) - -set(UDev_VERSION ${PC_UDEV_VERSION}) - -include(FindPackageHandleStandardArgs) -find_package_handle_standard_args(UDev - FOUND_VAR UDev_FOUND - REQUIRED_VARS UDev_INCLUDE_DIRS UDev_LIBRARIES - VERSION_VAR UDev_VERSION -) - -mark_as_advanced(UDev_INCLUDE_DIRS UDev_LIBRARIES) - -if(UDev_FOUND AND NOT TARGET UDev::UDev) - add_library(UDev::UDev UNKNOWN IMPORTED) - set_target_properties(UDev::UDev PROPERTIES - IMPORTED_LOCATION "${UDev_LIBRARIES}" - INTERFACE_INCLUDE_DIRECTORIES "${UDev_INCLUDE_DIRS}" - INTERFACE_COMPILE_DEFINITIONS "${PC_UDEV_CFLAGS_OTHER}" - ) -endif() - -# backward compat variables, remove for KF6 -set(UDEV_FOUND ${UDev_FOUND}) -set(UDEV_LIBS ${UDev_LIBRARIES}) -set(UDEV_INCLUDE_DIR ${UDev_INCLUDE_DIRS}) -mark_as_advanced(UDEV_FOUND UDEV_LIBS UDEV_INCLUDE_DIR) - -include(FeatureSummary) -set_package_properties(UDev PROPERTIES - DESCRIPTION "API for enumerating and introspecting local devices (part of systemd)" - URL "https://freedesktop.org/wiki/Software/systemd/" -) diff --git a/cmake/FindWayland.cmake b/cmake/FindWayland.cmake deleted file mode 100644 index a22ce553..00000000 --- a/cmake/FindWayland.cmake +++ /dev/null @@ -1,127 +0,0 @@ -#.rst: -# FindWayland -# ----------- -# -# Try to find Wayland. -# -# This is a component-based find module, which makes use of the COMPONENTS -# and OPTIONAL_COMPONENTS arguments to find_module. The following components -# are available:: -# -# Client Server Cursor Egl -# -# If no components are specified, this module will act as though all components -# were passed to OPTIONAL_COMPONENTS. -# -# This module will define the following variables, independently of the -# components searched for or found: -# -# ``Wayland_FOUND`` -# TRUE if (the requested version of) Wayland is available -# ``Wayland_VERSION`` -# Found Wayland version -# ``Wayland_TARGETS`` -# A list of all targets imported by this module (note that there may be more -# than the components that were requested) -# ``Wayland_LIBRARIES`` -# This can be passed to target_link_libraries() instead of the imported -# targets -# ``Wayland_INCLUDE_DIRS`` -# This should be passed to target_include_directories() if the targets are -# not used for linking -# ``Wayland_DEFINITIONS`` -# This should be passed to target_compile_options() if the targets are not -# used for linking -# ``Wayland_DATADIR`` -# The core wayland protocols data directory -# Since 5.73.0 -# -# For each searched-for components, ``Wayland__FOUND`` will be set to -# TRUE if the corresponding Wayland library was found, and FALSE otherwise. If -# ``Wayland__FOUND`` is TRUE, the imported target -# ``Wayland::`` will be defined. This module will also attempt to -# determine ``Wayland_*_VERSION`` variables for each imported target, although -# ``Wayland_VERSION`` should normally be sufficient. -# -# In general we recommend using the imported targets, as they are easier to use -# and provide more control. Bear in mind, however, that if any target is in the -# link interface of an exported library, it must be made available by the -# package config file. -# -# Since pre-1.0.0. - -#============================================================================= -# SPDX-FileCopyrightText: 2014 Alex Merry -# SPDX-FileCopyrightText: 2014 Martin Gräßlin -# -# SPDX-License-Identifier: BSD-3-Clause -#============================================================================= - -include(${CMAKE_CURRENT_LIST_DIR}/ECMFindModuleHelpers.cmake) - -ecm_find_package_version_check(Wayland) - -set(Wayland_known_components - Client - Server - Cursor - Egl -) -foreach(_comp ${Wayland_known_components}) - string(TOLOWER "${_comp}" _lc_comp) - set(Wayland_${_comp}_component_deps) - set(Wayland_${_comp}_pkg_config "wayland-${_lc_comp}") - set(Wayland_${_comp}_lib "wayland-${_lc_comp}") - set(Wayland_${_comp}_header "wayland-${_lc_comp}.h") -endforeach() -set(Wayland_Egl_component_deps Client) - -ecm_find_package_parse_components(Wayland - RESULT_VAR Wayland_components - KNOWN_COMPONENTS ${Wayland_known_components} -) -ecm_find_package_handle_library_components(Wayland - COMPONENTS ${Wayland_components} -) - -# If pkg-config didn't provide us with version information, -# try to extract it from wayland-version.h -# (Note that the version from wayland-egl.pc will probably be -# the Mesa version, rather than the Wayland version, but that -# version will be ignored as we always find wayland-client.pc -# first). -if(NOT Wayland_VERSION) - find_file(Wayland_VERSION_HEADER - NAMES wayland-version.h - HINTS ${Wayland_INCLUDE_DIRS} - ) - mark_as_advanced(Wayland_VERSION_HEADER) - if(Wayland_VERSION_HEADER) - file(READ ${Wayland_VERSION_HEADER} _wayland_version_header_contents) - string(REGEX REPLACE - "^.*[ \t]+WAYLAND_VERSION[ \t]+\"([0-9.]*)\".*$" - "\\1" - Wayland_VERSION - "${_wayland_version_header_contents}" - ) - unset(_wayland_version_header_contents) - endif() -endif() - -find_package_handle_standard_args(Wayland - FOUND_VAR - Wayland_FOUND - REQUIRED_VARS - Wayland_LIBRARIES - VERSION_VAR - Wayland_VERSION - HANDLE_COMPONENTS -) - -pkg_get_variable(Wayland_DATADIR wayland-server pkgdatadir) - -include(FeatureSummary) -set_package_properties(Wayland PROPERTIES - URL "https://wayland.freedesktop.org/" - DESCRIPTION "C library implementation of the Wayland protocol: a protocol for a compositor to talk to its clients" -) diff --git a/cmake/FindWaylandProtocols.cmake b/cmake/FindWaylandProtocols.cmake deleted file mode 100644 index a7882376..00000000 --- a/cmake/FindWaylandProtocols.cmake +++ /dev/null @@ -1,39 +0,0 @@ -#.rst: -# FindWaylandProtocols -# ------- -# -# Find wayland protocol description files -# -# Try to find wayland protocol files. The following values are defined -# -# :: -# -# WAYLANDPROTOCOLS_FOUND - True if wayland protocol files are available -# WAYLANDPROTOCOLS_PATH - Path to wayland protocol files -# -#============================================================================= -# Copyright (c) 2015 Jari Vetoniemi -# -# Distributed under the OSI-approved BSD License (the "License"); -# -# This software is distributed WITHOUT ANY WARRANTY; without even the -# implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. -# See the License for more information. -#============================================================================= - -include(FeatureSummary) -set_package_properties(WaylandProtocols PROPERTIES - URL "https://cgit.freedesktop.org/wayland/wayland-protocols" - DESCRIPTION "Wayland protocol development") - -unset(WAYLANDPROTOCOLS_PATH) - -find_package(PkgConfig) -if (PKG_CONFIG_FOUND) - execute_process(COMMAND ${PKG_CONFIG_EXECUTABLE} --variable=pkgdatadir wayland-protocols - OUTPUT_VARIABLE WAYLANDPROTOCOLS_PATH OUTPUT_STRIP_TRAILING_WHITESPACE) -endif () - -include(FindPackageHandleStandardArgs) -find_package_handle_standard_args(WaylandProtocols DEFAULT_MSG WAYLANDPROTOCOLS_PATH) -mark_as_advanced(WAYLANDPROTOCOLS_PATH) \ No newline at end of file diff --git a/cmake/FindWaylandScanner.cmake b/cmake/FindWaylandScanner.cmake deleted file mode 100644 index a36f0adb..00000000 --- a/cmake/FindWaylandScanner.cmake +++ /dev/null @@ -1,146 +0,0 @@ -#.rst: -# FindWaylandScanner -# ------------------ -# -# Try to find wayland-scanner. -# -# If the wayland-scanner executable is not in your PATH, you can provide -# an alternative name or full path location with the ``WaylandScanner_EXECUTABLE`` -# variable. -# -# This will define the following variables: -# -# ``WaylandScanner_FOUND`` -# True if wayland-scanner is available. -# -# ``WaylandScanner_EXECUTABLE`` -# The wayland-scanner executable. -# -# If ``WaylandScanner_FOUND`` is TRUE, it will also define the following imported -# target: -# -# ``Wayland::Scanner`` -# The wayland-scanner executable. -# -# This module provides the following functions to generate C protocol -# implementations: -# -# - ``ecm_add_wayland_client_protocol`` -# - ``ecm_add_wayland_server_protocol`` -# -# :: -# -# ecm_add_wayland_client_protocol( -# PROTOCOL -# BASENAME ) -# -# Generate Wayland client protocol files from ```` XML -# definition for the ```` interface and append those files -# to ````. -# -# :: -# -# ecm_add_wayland_server_protocol( -# PROTOCOL -# BASENAME ) -# -# Generate Wayland server protocol files from ```` XML -# definition for the ```` interface and append those files -# to ````. -# -# Since 1.4.0. - -#============================================================================= -# SPDX-FileCopyrightText: 2012-2014 Pier Luigi Fiorini -# -# SPDX-License-Identifier: BSD-3-Clause -#============================================================================= - -include(${CMAKE_CURRENT_LIST_DIR}/ECMFindModuleHelpers.cmake) - -ecm_find_package_version_check(WaylandScanner) - -# Find wayland-scanner -find_program(WaylandScanner_EXECUTABLE NAMES wayland-scanner) - -include(FindPackageHandleStandardArgs) -find_package_handle_standard_args(WaylandScanner - FOUND_VAR - WaylandScanner_FOUND - REQUIRED_VARS - WaylandScanner_EXECUTABLE -) - -mark_as_advanced(WaylandScanner_EXECUTABLE) - -if(NOT TARGET Wayland::Scanner AND WaylandScanner_FOUND) - add_executable(Wayland::Scanner IMPORTED) - set_target_properties(Wayland::Scanner PROPERTIES - IMPORTED_LOCATION "${WaylandScanner_EXECUTABLE}" - ) -endif() - -include(FeatureSummary) -set_package_properties(WaylandScanner PROPERTIES - URL "https://wayland.freedesktop.org/" - DESCRIPTION "Executable that converts XML protocol files to C code" -) - - -include(CMakeParseArguments) - -function(ecm_add_wayland_client_protocol out_var) - # Parse arguments - set(oneValueArgs PROTOCOL BASENAME) - cmake_parse_arguments(ARGS "" "${oneValueArgs}" "" ${ARGN}) - - if(ARGS_UNPARSED_ARGUMENTS) - message(FATAL_ERROR "Unknown keywords given to ecm_add_wayland_client_protocol(): \"${ARGS_UNPARSED_ARGUMENTS}\"") - endif() - - get_filename_component(_infile ${ARGS_PROTOCOL} ABSOLUTE) - set(_client_header "${CMAKE_CURRENT_BINARY_DIR}/wayland-${ARGS_BASENAME}-client-protocol.h") - set(_code "${CMAKE_CURRENT_BINARY_DIR}/wayland-${ARGS_BASENAME}-protocol.c") - - set_source_files_properties(${_client_header} GENERATED) - set_source_files_properties(${_code} GENERATED) - set_property(SOURCE ${_client_header} ${_code} PROPERTY SKIP_AUTOMOC ON) - - add_custom_command(OUTPUT "${_client_header}" - COMMAND ${WaylandScanner_EXECUTABLE} client-header ${_infile} ${_client_header} - DEPENDS ${_infile} VERBATIM) - - add_custom_command(OUTPUT "${_code}" - COMMAND ${WaylandScanner_EXECUTABLE} code ${_infile} ${_code} - DEPENDS ${_infile} ${_client_header} VERBATIM) - - list(APPEND ${out_var} "${_client_header}" "${_code}") - set(${out_var} ${${out_var}} PARENT_SCOPE) -endfunction() - - -function(ecm_add_wayland_server_protocol out_var) - # Parse arguments - set(oneValueArgs PROTOCOL BASENAME) - cmake_parse_arguments(ARGS "" "${oneValueArgs}" "" ${ARGN}) - - if(ARGS_UNPARSED_ARGUMENTS) - message(FATAL_ERROR "Unknown keywords given to ecm_add_wayland_server_protocol(): \"${ARGS_UNPARSED_ARGUMENTS}\"") - endif() - - ecm_add_wayland_client_protocol(${out_var} - PROTOCOL ${ARGS_PROTOCOL} - BASENAME ${ARGS_BASENAME}) - - get_filename_component(_infile ${ARGS_PROTOCOL} ABSOLUTE) - set(_server_header "${CMAKE_CURRENT_BINARY_DIR}/wayland-${ARGS_BASENAME}-server-protocol.h") - set_property(SOURCE ${_server_header} PROPERTY SKIP_AUTOMOC ON) - set_source_files_properties(${_server_header} GENERATED) - - add_custom_command(OUTPUT "${_server_header}" - COMMAND ${WaylandScanner_EXECUTABLE} server-header ${_infile} ${_server_header} - DEPENDS ${_infile} VERBATIM) - - list(APPEND ${out_var} "${_server_header}") - set(${out_var} ${${out_var}} PARENT_SCOPE) -endfunction() diff --git a/cmake/FindXCB.cmake b/cmake/FindXCB.cmake deleted file mode 100644 index dc592aa8..00000000 --- a/cmake/FindXCB.cmake +++ /dev/null @@ -1,53 +0,0 @@ -#.rst: -# FindXCB -# ------- -# -# Find XCB libraries -# -# Tries to find xcb libraries on unix systems. -# -# - Be sure to set the COMPONENTS to the components you want to link to -# - The XCB_LIBRARIES variable is set ONLY to your COMPONENTS list -# - To use only a specific component check the XCB_LIBRARIES_${COMPONENT} variable -# -# The following values are defined -# -# :: -# -# XCB_FOUND - True if xcb is available -# XCB_INCLUDE_DIRS - Include directories for xcb -# XCB_LIBRARIES - List of libraries for xcb -# XCB_DEFINITIONS - List of definitions for xcb -# -#============================================================================= -# Copyright (c) 2015 Jari Vetoniemi -# -# Distributed under the OSI-approved BSD License (the "License"); -# -# This software is distributed WITHOUT ANY WARRANTY; without even the -# implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. -# See the License for more information. -#============================================================================= - -include(FeatureSummary) -set_package_properties(XCB PROPERTIES - URL "http://xcb.freedesktop.org/" - DESCRIPTION "X protocol C-language Binding") - -find_package(PkgConfig) -pkg_check_modules(PC_XCB QUIET xcb ${XCB_FIND_COMPONENTS}) - -find_library(XCB_LIBRARIES xcb HINTS ${PC_XCB_LIBRARY_DIRS}) -find_path(XCB_INCLUDE_DIRS xcb/xcb.h PATH_SUFFIXES xcb HINTS ${PC_XCB_INCLUDE_DIRS}) - -foreach(COMPONENT ${XCB_FIND_COMPONENTS}) - find_library(XCB_LIBRARIES_${COMPONENT} xcb-${COMPONENT} HINTS ${PC_XCB_LIBRARY_DIRS}) - list(APPEND XCB_LIBRARIES ${XCB_LIBRARIES_${COMPONENT}}) - mark_as_advanced(XCB_LIBRARIES_${COMPONENT}) -endforeach(COMPONENT ${XCB_FIND_COMPONENTS}) - -set(XCB_DEFINITIONS ${PC_XCB_CFLAGS_OTHER}) - -include(FindPackageHandleStandardArgs) -find_package_handle_standard_args(XCB DEFAULT_MSG XCB_LIBRARIES XCB_INCLUDE_DIRS) -mark_as_advanced(XCB_INCLUDE_DIRS XCB_LIBRARIES XCB_DEFINITIONS) diff --git a/connection/mimserverconnection.h b/connection/mimserverconnection.h index 14c62c67..d67a19e2 100644 --- a/connection/mimserverconnection.h +++ b/connection/mimserverconnection.h @@ -15,6 +15,7 @@ #define MIMSERVERCONNECTION_H #include +#include #include diff --git a/connection/waylandinputmethodconnection.cpp b/connection/waylandinputmethodconnection.cpp index 25e6fbfa..6f9f2837 100644 --- a/connection/waylandinputmethodconnection.cpp +++ b/connection/waylandinputmethodconnection.cpp @@ -18,7 +18,7 @@ #include "wayland-client.h" #include -#include +#include #include @@ -113,37 +113,37 @@ xkb_keysym_t keyFromQt(int qt_key) } } -QtWayland::zwp_text_input_v2::preedit_style preeditStyleFromMaliit(Maliit::PreeditFace face) +QtWayland::zwp_text_input_v1::preedit_style preeditStyleFromMaliit(Maliit::PreeditFace face) { switch (face) { case Maliit::PreeditDefault: - return QtWayland::zwp_text_input_v2::preedit_style_default; + return QtWayland::zwp_text_input_v1::preedit_style_default; case Maliit::PreeditNoCandidates: - return QtWayland::zwp_text_input_v2::preedit_style_incorrect; + return QtWayland::zwp_text_input_v1::preedit_style_incorrect; case Maliit::PreeditKeyPress: - return QtWayland::zwp_text_input_v2::preedit_style_highlight; + return QtWayland::zwp_text_input_v1::preedit_style_highlight; case Maliit::PreeditUnconvertible: - return QtWayland::zwp_text_input_v2::preedit_style_inactive; + return QtWayland::zwp_text_input_v1::preedit_style_inactive; case Maliit::PreeditActive: - return QtWayland::zwp_text_input_v2::preedit_style_active; + return QtWayland::zwp_text_input_v1::preedit_style_active; default: - return QtWayland::zwp_text_input_v2::preedit_style_none; + return QtWayland::zwp_text_input_v1::preedit_style_none; } } Maliit::TextContentType contentTypeFromWayland(uint32_t purpose) { switch (purpose) { - case QtWayland::zwp_text_input_v2::content_purpose_normal: + case QtWayland::zwp_text_input_v1::content_purpose_normal: return Maliit::FreeTextContentType; - case QtWayland::zwp_text_input_v2::content_purpose_digits: - case QtWayland::zwp_text_input_v2::content_purpose_number: + case QtWayland::zwp_text_input_v1::content_purpose_digits: + case QtWayland::zwp_text_input_v1::content_purpose_number: return Maliit::NumberContentType; - case QtWayland::zwp_text_input_v2::content_purpose_phone: + case QtWayland::zwp_text_input_v1::content_purpose_phone: return Maliit::PhoneNumberContentType; - case QtWayland::zwp_text_input_v2::content_purpose_url: + case QtWayland::zwp_text_input_v1::content_purpose_url: return Maliit::UrlContentType; - case QtWayland::zwp_text_input_v2::content_purpose_email: + case QtWayland::zwp_text_input_v1::content_purpose_email: return Maliit::EmailContentType; default: return Maliit::CustomContentType; @@ -338,15 +338,15 @@ void WaylandInputMethodConnection::sendPreeditString(const QString &string, if (replace_length > 0) { int cursor = widgetState().value(CursorPositionAttribute).toInt(); - uint32_t index = string.midRef(qMin(cursor + replace_start, cursor), qAbs(replace_start)).toUtf8().size(); - uint32_t length = string.midRef(cursor + replace_start, replace_length).toUtf8().size(); + uint32_t index = string.mid(qMin(cursor + replace_start, cursor), qAbs(replace_start)).toUtf8().size(); + uint32_t length = string.mid(cursor + replace_start, replace_length).toUtf8().size(); d->context()->delete_surrounding_text(index, length); } Q_FOREACH (const Maliit::PreeditTextFormat& format, preedit_formats) { - QtWayland::zwp_text_input_v2::preedit_style style = preeditStyleFromMaliit(format.preeditFace); - uint32_t index = string.leftRef(format.start).toUtf8().size(); - uint32_t length = string.leftRef(format.start + format.length).toUtf8().size() - index; + QtWayland::zwp_text_input_v1::preedit_style style = preeditStyleFromMaliit(format.preeditFace); + uint32_t index = string.left(format.start).toUtf8().size(); + uint32_t length = string.left(format.start + format.length).toUtf8().size() - index; qCDebug(lcWaylandConnection) << Q_FUNC_INFO << "preedit_styling" << index << length; d->context()->preedit_styling(index, length, style); } @@ -356,8 +356,8 @@ void WaylandInputMethodConnection::sendPreeditString(const QString &string, cursor_pos = string.size() + 1 - cursor_pos; } - qCDebug(lcWaylandConnection) << Q_FUNC_INFO << "preedit_cursor" << string.leftRef(cursor_pos).toUtf8().size(); - d->context()->preedit_cursor(string.leftRef(cursor_pos).toUtf8().size()); + qCDebug(lcWaylandConnection) << Q_FUNC_INFO << "preedit_cursor" << string.left(cursor_pos).toUtf8().size(); + d->context()->preedit_cursor(string.left(cursor_pos).toUtf8().size()); qCDebug(lcWaylandConnection) << Q_FUNC_INFO << "preedit_string" << string; d->context()->preedit_string(d->context()->serial(), string, string); } @@ -384,12 +384,12 @@ void WaylandInputMethodConnection::sendCommitString(const QString &string, if (replace_length > 0) { int cursor = widgetState().value(CursorPositionAttribute).toInt(); - uint32_t index = string.midRef(qMin(cursor + replace_start, cursor), qAbs(replace_start)).toUtf8().size(); - uint32_t length = string.midRef(cursor + replace_start, replace_length).toUtf8().size(); + uint32_t index = string.mid(qMin(cursor + replace_start, cursor), qAbs(replace_start)).toUtf8().size(); + uint32_t length = string.mid(cursor + replace_start, replace_length).toUtf8().size(); d->context()->delete_surrounding_text(index, length); } - cursor_pos = string.leftRef(cursor_pos).toUtf8().size(); + cursor_pos = string.left(cursor_pos).toUtf8().size(); d->context()->cursor_position(cursor_pos, cursor_pos); d->context()->commit_string(d->context()->serial(), string); } @@ -470,8 +470,8 @@ void WaylandInputMethodConnection::setSelection(int start, int length) return; QString surrounding = widgetState().value(SurroundingTextAttribute).toString(); - uint32_t index(surrounding.leftRef(start + length).toUtf8().size()); - uint32_t anchor(surrounding.leftRef(start).toUtf8().size()); + uint32_t index(surrounding.left(start + length).toUtf8().size()); + uint32_t anchor(surrounding.left(start).toUtf8().size()); d->context()->cursor_position(index, anchor); d->context()->commit_string(d->context()->serial(), QString()); @@ -563,10 +563,10 @@ void InputMethodContext::zwp_input_method_context_v1_content_type(uint32_t hint, qCDebug(lcWaylandConnection) << Q_FUNC_INFO; m_stateInfo[ContentTypeAttribute] = contentTypeFromWayland(purpose); - m_stateInfo[AutoCapitalizationAttribute] = matchesFlag(hint, QtWayland::zwp_text_input_v2::content_hint_auto_capitalization); - m_stateInfo[CorrectionAttribute] = matchesFlag(hint, QtWayland::zwp_text_input_v2::content_hint_auto_correction); - m_stateInfo[PredictionAttribute] = matchesFlag(hint, QtWayland::zwp_text_input_v2::content_hint_auto_completion); - m_stateInfo[HiddenTextAttribute] = matchesFlag(hint, QtWayland::zwp_text_input_v2::content_hint_hidden_text); + m_stateInfo[AutoCapitalizationAttribute] = matchesFlag(hint, QtWayland::zwp_text_input_v1::content_hint_auto_capitalization); + m_stateInfo[CorrectionAttribute] = matchesFlag(hint, QtWayland::zwp_text_input_v1::content_hint_auto_correction); + m_stateInfo[PredictionAttribute] = matchesFlag(hint, QtWayland::zwp_text_input_v1::content_hint_auto_completion); + m_stateInfo[HiddenTextAttribute] = matchesFlag(hint, QtWayland::zwp_text_input_v1::content_hint_hidden_text); } void InputMethodContext::zwp_input_method_context_v1_invoke_action(uint32_t button, uint32_t index) diff --git a/examples/plugins/cxx/helloworld/helloworldinputmethod.cpp b/examples/plugins/cxx/helloworld/helloworldinputmethod.cpp index d33febea..64f81864 100644 --- a/examples/plugins/cxx/helloworld/helloworldinputmethod.cpp +++ b/examples/plugins/cxx/helloworld/helloworldinputmethod.cpp @@ -16,8 +16,8 @@ #include #include -#include -#include +#include +#include namespace { @@ -89,7 +89,7 @@ void HelloWorldInputMethod::show() } // Set size of our container to screen size - const QSize screenSize = QApplication::desktop()->screenGeometry().size(); + const QSize screenSize = QGuiApplication::primaryScreen()->size(); mainWidget->parentWidget()->resize(screenSize); // Set size of the input method diff --git a/examples/plugins/cxx/override/overrideinputmethod.cpp b/examples/plugins/cxx/override/overrideinputmethod.cpp index e44e37e5..79aa37c2 100644 --- a/examples/plugins/cxx/override/overrideinputmethod.cpp +++ b/examples/plugins/cxx/override/overrideinputmethod.cpp @@ -16,8 +16,8 @@ #include #include -#include -#include +#include +#include #include namespace { @@ -81,7 +81,7 @@ void OverrideInputMethod::show() } // Set size of the input method - const QSize &screenSize = QApplication::desktop()->screenGeometry().size(); + const QSize &screenSize = QGuiApplication::primaryScreen()->size(); const QSize size(screenSize.width() - 200, 200); surface->setGeometry(QRect(QPoint((screenSize.width() - size.width()) / 2, diff --git a/input-context/minputcontext.cpp b/input-context/minputcontext.cpp index c300753f..4f17e692 100644 --- a/input-context/minputcontext.cpp +++ b/input-context/minputcontext.cpp @@ -624,7 +624,7 @@ void MInputContext::onInvokeAction(const QString &action, const QKeySequence &se const int modifiers = sequence[i] & AllModifiers; QString text(""); if (modifiers == Qt::NoModifier || modifiers == Qt::ShiftModifier) { - text = QString(key); + text = QString(QChar::fromLatin1(key)); } keyEvent(QEvent::KeyPress, key, modifiers, text, false, 1); keyEvent(QEvent::KeyRelease, key, modifiers, text, false, 1); diff --git a/src/mimonscreenplugins.cpp b/src/mimonscreenplugins.cpp index cd500f26..aa8f4180 100644 --- a/src/mimonscreenplugins.cpp +++ b/src/mimonscreenplugins.cpp @@ -19,9 +19,9 @@ #include #include -#include +#include -using namespace std::tr1::placeholders; +using namespace std::placeholders; namespace { @@ -116,10 +116,10 @@ bool MImOnScreenPlugins::isEnabled(const QString &plugin) const std::remove_copy_if(mEnabledSubViews.begin(), mEnabledSubViews.end(), std::back_inserter(mEnabledAndAvailableSubViews), - std::tr1::bind(&MImOnScreenPlugins::isSubViewUnavailable, this, _1)); + std::bind(&MImOnScreenPlugins::isSubViewUnavailable, this, _1)); return std::find_if(mEnabledAndAvailableSubViews.begin(), mEnabledAndAvailableSubViews.end(), - std::tr1::bind(equalPlugin, _1, plugin)) != mEnabledAndAvailableSubViews.end(); + std::bind(equalPlugin, _1, plugin)) != mEnabledAndAvailableSubViews.end(); } bool MImOnScreenPlugins::isSubViewEnabled(const SubView &subView) const @@ -136,7 +136,7 @@ QList MImOnScreenPlugins::enabledSubViews(const QSt { QList result; std::remove_copy_if(mEnabledSubViews.begin(), mEnabledSubViews.end(), - std::back_inserter(result), std::tr1::bind(notEqualPlugin, _1, plugin)); + std::back_inserter(result), std::bind(notEqualPlugin, _1, plugin)); return result; } diff --git a/src/msharedattributeextensionmanager.cpp b/src/msharedattributeextensionmanager.cpp index e8bf50b5..5e09c048 100644 --- a/src/msharedattributeextensionmanager.cpp +++ b/src/msharedattributeextensionmanager.cpp @@ -39,7 +39,7 @@ MSharedAttributeExtensionManager::~MSharedAttributeExtensionManager() void MSharedAttributeExtensionManager::registerPluginSetting(const QString &fullName, Maliit::SettingEntryType type, QVariantMap attributes) { - QString key = fullName.section(1, -1); + QString key = fullName.section(QChar(), 0); QSharedPointer value(new MSharedAttributeExtensionManagerPluginSetting(key, type, attributes)); sharedAttributeExtensions[key] = value; diff --git a/src/quick/inputmethodquick.h b/src/quick/inputmethodquick.h index 1a1af47f..ed5277a9 100644 --- a/src/quick/inputmethodquick.h +++ b/src/quick/inputmethodquick.h @@ -16,6 +16,7 @@ #include #include +#include "keyoverridequick.h" #include "maliitquick.h" #include diff --git a/tests/ft_mimpluginmanager/ft_mimpluginmanager.cpp b/tests/ft_mimpluginmanager/ft_mimpluginmanager.cpp index 32ba5ddc..658084cd 100644 --- a/tests/ft_mimpluginmanager/ft_mimpluginmanager.cpp +++ b/tests/ft_mimpluginmanager/ft_mimpluginmanager.cpp @@ -15,7 +15,6 @@ #include #include -#include #include #include diff --git a/tests/ut_mimpluginmanager/ut_mimpluginmanager.cpp b/tests/ut_mimpluginmanager/ut_mimpluginmanager.cpp index f952107f..dc293619 100644 --- a/tests/ut_mimpluginmanager/ut_mimpluginmanager.cpp +++ b/tests/ut_mimpluginmanager/ut_mimpluginmanager.cpp @@ -11,7 +11,6 @@ #include "core-utils.h" #include -#include #include #include #include diff --git a/tests/ut_mimpluginmanagerconfig/ut_mimpluginmanagerconfig.cpp b/tests/ut_mimpluginmanagerconfig/ut_mimpluginmanagerconfig.cpp index 324b8a9c..252ab58c 100644 --- a/tests/ut_mimpluginmanagerconfig/ut_mimpluginmanagerconfig.cpp +++ b/tests/ut_mimpluginmanagerconfig/ut_mimpluginmanagerconfig.cpp @@ -19,7 +19,6 @@ #include #include -#include #include #include #include @@ -33,8 +32,6 @@ #include "mattributeextensionmanager.h" #include "msharedattributeextensionmanager.h" -using namespace std::tr1; - typedef QSet HandlerStates; Q_DECLARE_METATYPE(HandlerStates); Q_DECLARE_METATYPE(Maliit::HandlerState); diff --git a/tests/ut_mimpluginmanagerconfig/ut_mimpluginmanagerconfig.h b/tests/ut_mimpluginmanagerconfig/ut_mimpluginmanagerconfig.h index c313967b..3ce2376b 100644 --- a/tests/ut_mimpluginmanagerconfig/ut_mimpluginmanagerconfig.h +++ b/tests/ut_mimpluginmanagerconfig/ut_mimpluginmanagerconfig.h @@ -15,7 +15,7 @@ #include "mimserveroptions.h" #include "mimsettingsqsettings.h" -#include +#include #include #include diff --git a/tests/utils/core-utils.cpp b/tests/utils/core-utils.cpp index c9d121f7..08841303 100644 --- a/tests/utils/core-utils.cpp +++ b/tests/utils/core-utils.cpp @@ -16,6 +16,7 @@ #include #include #include +#include namespace { const QString TestingInSandboxEnvVariable("TESTING_IN_SANDBOX"); @@ -30,12 +31,12 @@ namespace { // Returns true on success, false on error bool setPathFromEnvironmentVariable(QString *path, QString envVar) { const QStringList env(QProcess::systemEnvironment()); - int index = env.indexOf(QRegExp('^' + envVar + "=.*", Qt::CaseInsensitive)); + int index = env.indexOf(QRegularExpression('^' + envVar + "=.*", QRegularExpression::CaseInsensitiveOption)); if (index != -1) { QString pathCandidate = env.at(index); pathCandidate = pathCandidate.remove( - QRegExp('^' + envVar + '=', Qt::CaseInsensitive)); + QRegularExpression('^' + envVar + '=', QRegularExpression::CaseInsensitiveOption)); if (!pathCandidate.isEmpty()) { *path = pathCandidate; return true; @@ -57,11 +58,11 @@ bool isTestingInSandbox() { bool testingInSandbox = false; const QStringList env(QProcess::systemEnvironment()); - int index = env.indexOf(QRegExp('^' + TestingInSandboxEnvVariable + "=.*", Qt::CaseInsensitive)); + int index = env.indexOf(QRegularExpression('^' + TestingInSandboxEnvVariable + "=.*", QRegularExpression::CaseInsensitiveOption)); if (index != -1) { QString statusCandidate = env.at(index); statusCandidate = statusCandidate.remove( - QRegExp('^' + TestingInSandboxEnvVariable + '=', Qt::CaseInsensitive)); + QRegularExpression('^' + TestingInSandboxEnvVariable + '=', QRegularExpression::CaseInsensitiveOption)); bool statusOk = false; int status = statusCandidate.toInt(&statusOk); if (statusOk && (status == 0 || status == 1)) {