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 Jan 18, 2024
1 parent fdc7c20 commit 3a8f9de
Show file tree
Hide file tree
Showing 5 changed files with 110 additions and 88 deletions.
71 changes: 46 additions & 25 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -1,42 +1,63 @@
cmake_minimum_required(VERSION 3.10.0)
cmake_minimum_required(VERSION 3.19)

project("PulseAudio"
VERSION "0.9.0"
DESCRIPTION "PulseAudio support for Liri"
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}")
## Only build on the appropriate platforms.
if(NOT (UNIX OR NOT CMAKE_SYSTEM_NAME MATCHES "Android"))
message(NOTICE "Skipping the build as the condition \"UNIX OR NOT Android\" is not met.")
return()
endif()

## Add some paths to check for CMake modules:
list(APPEND CMAKE_MODULE_PATH "${CMAKE_CURRENT_SOURCE_DIR}/cmake")
## ECM:
find_package(ECM 5.245.0 REQUIRED NO_MODULE)
list(APPEND CMAKE_MODULE_PATH ${ECM_MODULE_PATH})

## Set minimum versions required:
set(QT_MIN_VERSION "5.15.0")
## Installation directories:
include(KDEInstallDirs)

## Liri specific setup common for all modules:
include(LiriSetup)
## Compiler settings:
set(KDE_SKIP_NULLPTR_WARNINGS_SETTINGS TRUE)
include(KDECompilerSettings NO_POLICY_SCOPE)

## Only build on the appropriate platforms.
if(NOT UNIX OR ANDROID)
message(NOTICE "Skipping the build as the condition \"UNIX OR ANDROID\" is not met.")
return()
## Enable keywords such as emit:
# TODO: Replace keywords such as emit with Q_EMIT
remove_definitions(-DQT_NO_KEYWORDS)

## CMake settings:
include(KDECMakeSettings)

## QML module:
include(ECMQmlModule)

## ECM:
include(ECMQtDeclareLoggingCategory)

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

## QML import path:
if(NOT QML_IMPORT_PATH)
set(QML_IMPORT_PATH ${CMAKE_SOURCE_DIR}/bin CACHE STRING "" FORCE)
endif()

## Find Qt 5:
find_package(Qt5 "${QT_MIN_VERSION}"
CONFIG REQUIRED
COMPONENTS
Core
Gui
Qml
Quick
LinguistTools
)
## 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)

## Features:
include(features.cmake)

## Add subdirectories:
add_subdirectory(src/imports/pulseaudio)
Expand Down
9 changes: 5 additions & 4 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -18,16 +18,17 @@ This repository contains:

## 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)
* [qtdeclarative](http://code.qt.io/cgit/qt/qtdeclarative.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
* [fluid](https://github.com/lirios/fluid) >= 1.0.0
* [cmake](https://gitlab.kitware.com/cmake/cmake) >= 3.19.0
* [liri-settings](https://github.com/lirios/settings)
* [liri-shell](https://github.com/lirios/shell)
* [fluid](https://github.com/lirios/fluid) >= 2.0.0
* [pulseadio](https://cgit.freedesktop.org/pulseaudio/pulseaudio/) >= 5.0.0

## Installation
Expand Down
21 changes: 21 additions & 0 deletions features.cmake
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
# SPDX-FileCopyrightText: 2024 Pier Luigi Fiorini <[email protected]>
# SPDX-License-Identifier: BSD-3-Clause

## Find Qt:
find_package(Qt6 "6.6.0"
REQUIRED
COMPONENTS
Core
Gui
Qml
Quick
LinguistTools
)

## Find pulse:
find_package(Libpulse REQUIRED)

## Features summary:
if(NOT LIRI_SUPERBUILD)
feature_summary(WHAT ENABLED_FEATURES DISABLED_FEATURES)
endif()
97 changes: 38 additions & 59 deletions src/imports/pulseaudio/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -1,64 +1,43 @@
find_package(Libpulse REQUIRED)
ecm_add_qml_module(PulseAudioQmlPlugin
URI Liri.PulseAudio
VERSION 1.0
CLASS_NAME PulseAudioPlugin
NO_GENERATE_PLUGIN_SOURCE
DEPENDENCIES QtQuick
)

liri_add_qml_plugin(PulseAudioQmlPlugin
MODULE_PATH
"Liri/PulseAudio"
VERSION
"1.0"
OUTPUT_NAME
"pulseaudioplugin"
SOURCES
target_sources(PulseAudioQmlPlugin
PRIVATE
qpulseaudio/card.cpp qpulseaudio/card.h
qpulseaudio/client.cpp qpulseaudio/client.h
qpulseaudio/context.cpp qpulseaudio/context.h
qpulseaudio/debug.cpp qpulseaudio/debug.h
qpulseaudio/device.cpp qpulseaudio/device.h
qpulseaudio/maps.cpp qpulseaudio/maps.h
qpulseaudio/operation.cpp qpulseaudio/operation.h
qpulseaudio/port.cpp qpulseaudio/port.h
qpulseaudio/profile.cpp qpulseaudio/profile.h
qpulseaudio/pulseaudio.cpp qpulseaudio/pulseaudio.h
qpulseaudio/pulseobject.cpp qpulseaudio/pulseobject.h
qpulseaudio/ref.cpp qpulseaudio/ref.h
qpulseaudio/server.cpp qpulseaudio/server.h
qpulseaudio/sink.cpp qpulseaudio/sink.h
qpulseaudio/sinkinput.cpp qpulseaudio/sinkinput.h
qpulseaudio/source.cpp qpulseaudio/source.h
qpulseaudio/sourceoutput.cpp qpulseaudio/sourceoutput.h
qpulseaudio/stream.cpp qpulseaudio/stream.h
qpulseaudio/streamrestore.cpp qpulseaudio/streamrestore.h
qpulseaudio/volumeobject.cpp qpulseaudio/volumeobject.h
plugin.cpp
qpulseaudio/card.cpp
qpulseaudio/card.h
qpulseaudio/client.cpp
qpulseaudio/client.h
qpulseaudio/context.cpp
qpulseaudio/context.h
qpulseaudio/debug.cpp
qpulseaudio/debug.h
qpulseaudio/device.cpp
qpulseaudio/device.h
qpulseaudio/maps.cpp
qpulseaudio/maps.h
qpulseaudio/operation.cpp
qpulseaudio/operation.h
qpulseaudio/port.cpp
qpulseaudio/port.h
qpulseaudio/profile.cpp
qpulseaudio/profile.h
qpulseaudio/pulseaudio.cpp
qpulseaudio/pulseaudio.h
qpulseaudio/pulseobject.cpp
qpulseaudio/pulseobject.h
qpulseaudio/ref.cpp
qpulseaudio/ref.h
qpulseaudio/server.cpp
qpulseaudio/server.h
qpulseaudio/sink.cpp
qpulseaudio/sink.h
qpulseaudio/sinkinput.cpp
qpulseaudio/sinkinput.h
qpulseaudio/source.cpp
qpulseaudio/source.h
qpulseaudio/sourceoutput.cpp
qpulseaudio/sourceoutput.h
qpulseaudio/stream.cpp
qpulseaudio/stream.h
qpulseaudio/streamrestore.cpp
qpulseaudio/streamrestore.h
qpulseaudio/volumeobject.cpp
qpulseaudio/volumeobject.h
INCLUDE_DIRECTORIES
"${CMAKE_CURRENT_SOURCE_DIR}/qpulseaudio"
QML_FILES
)

ecm_target_qml_sources(PulseAudioQmlPlugin
SOURCES
VolumeControl.qml
qmldir
#DEFINES
#QT_NO_CAST_FROM_ASCII
#QT_NO_FOREACH
LIBRARIES
PkgConfig::Libpulse
)

liri_finalize_qml_plugin(PulseAudioQmlPlugin)
target_include_directories(PulseAudioQmlPlugin PRIVATE "${CMAKE_CURRENT_SOURCE_DIR}/qpulseaudio")

target_link_libraries(PulseAudioQmlPlugin PRIVATE Qt6::Qml PkgConfig::Libpulse)

ecm_finalize_qml_module(PulseAudioQmlPlugin)
Empty file.

0 comments on commit 3a8f9de

Please sign in to comment.