Skip to content

Commit

Permalink
Update to Qt 6 and ECM
Browse files Browse the repository at this point in the history
  • Loading branch information
plfiorini committed Dec 3, 2023
1 parent c2e3441 commit a2e9daf
Show file tree
Hide file tree
Showing 4 changed files with 53 additions and 36 deletions.
4 changes: 2 additions & 2 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -17,5 +17,5 @@ on:
- develop

jobs:
build-qt5:
uses: lirios/.github/.github/workflows/build-linux-qt5.yml@master
build-qt6:
uses: lirios/.github/.github/workflows/build-linux-qt6.yml@master
52 changes: 33 additions & 19 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -2,40 +2,54 @@
#
# SPDX-License-Identifier: BSD-3-Clause

cmake_minimum_required(VERSION 3.10.0)
cmake_minimum_required(VERSION 3.19)

project("AuroraScanner"
VERSION "0.0.0"
DESCRIPTION "Converts Wayland protocol definition to C++ code"
LANGUAGES CXX C
)

## Shared macros and functions:
if(NOT LIRI_LOCAL_ECM)
find_package(LiriCMakeShared "2.0.0" REQUIRED NO_MODULE)
list(APPEND CMAKE_MODULE_PATH "${LCS_MODULE_PATH}")
endif()

## Add some paths to check for CMake modules:
list(APPEND CMAKE_MODULE_PATH "${CMAKE_CURRENT_SOURCE_DIR}/cmake")

## Liri specific setup common for all modules:
include(LiriSetup)

## Only build on the appropriate platforms.
if(NOT (LINUX OR APPLE OR QNX))
message(NOTICE "Skipping the build as the condition \"LINUX OR APPLE OR QNX\" is not met.")
if(NOT (CMAKE_SYSTEM_NAME MATCHES "Linux" OR CMAKE_SYSTEM_NAME MATCHES "Darwin" OR CMAKE_SYSTEM_NAME MATCHES "QNX"))
message(NOTICE "Skipping the build as the condition \"Linux OR Darwin OR QNX\" is not met.")
return()
endif()

## Find Qt 5:
set(QT_MIN_VERSION "5.15.0")
find_package(Qt5 "${QT_MIN_VERSION}"
CONFIG REQUIRED
## Enable feature summary at the end of the configure run:
include(FeatureSummary)

## Find Qt:
find_package(Qt6
REQUIRED
COMPONENTS
Core
Xml
)

## ECM:
find_package(ECM 5.245.0 REQUIRED NO_MODULE)
list(APPEND CMAKE_MODULE_PATH ${ECM_MODULE_PATH})

## Installation directories:
include(KDEInstallDirs)

## Compiler settings:
set(KDE_SKIP_NULLPTR_WARNINGS_SETTINGS TRUE)
include(KDECompilerSettings NO_POLICY_SCOPE)

## Enable keywords such as emit:
# TODO: Replace keywords such as emit with Q_EMIT
remove_definitions(-DQT_NO_KEYWORDS)

## CMake settings:
include(KDECMakeSettings)

## Project setup:
qt_standard_project_setup(REQUIRES 6.6)

## Disable use of C++ API deprecated in Qt 5.15
add_compile_definitions(QT_DISABLE_DEPRECATED_UP_TO=0x050F00)

## Add subdirectories:
add_subdirectory(src/waylandscanner)
5 changes: 2 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,14 +10,13 @@ Converts Wayland protocol definition to C++ code.

## Dependencies

Qt >= 5.15.0 with at least the following modules is required:
Qt >= 6.6.0 with at least the following modules is required:

* [qtbase](http://code.qt.io/cgit/qt/qtbase.git)

The following modules and their dependencies are required:

* [cmake](https://gitlab.kitware.com/cmake/cmake) >= 3.10.0
* [cmake-shared](https://github.com/lirios/cmake-shared.git) >= 2.0.0
* [cmake](https://gitlab.kitware.com/cmake/cmake) >= 3.19.0

## Installation

Expand Down
28 changes: 16 additions & 12 deletions src/waylandscanner/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -2,19 +2,23 @@
#
# SPDX-License-Identifier: BSD-3-Clause

liri_add_executable(waylandscanner
SOURCES
waylandscanner.cpp
OUTPUT_NAME
aurora-wayland-scanner
DEFINES
QT_NO_CAST_FROM_ASCII
QT_NO_FOREACH
LIBRARIES
Qt::Core
Qt::Xml
qt_add_executable(waylandscanner
MANUAL_FINALIZATION
waylandscanner.cpp
)

liri_finalize_executable(waylandscanner)
set_target_properties(waylandscanner PROPERTIES OUTPUT_NAME aurora-wayland-scanner)

qt_finalize_target(waylandscanner)

target_link_libraries(waylandscanner PUBLIC
Qt6::Core
Qt6::Xml
)

add_executable(Liri::waylandscanner ALIAS waylandscanner)

install(
TARGETS waylandscanner
DESTINATION ${KDE_INSTALL_BINDIR}
)

0 comments on commit a2e9daf

Please sign in to comment.