From 8bede0eebb72f07f86f58faf232a7718e1be4190 Mon Sep 17 00:00:00 2001 From: Sergey Chupligin Date: Wed, 5 Feb 2025 18:23:27 +0300 Subject: [PATCH] [core] Make Theme class public --- src/core/CMakeLists.txt | 23 +++++++++++++++++------ src/core/nemocoreplugin.pc.in | 10 ++++++++++ src/core/plugin.cpp | 1 + src/core/theme.cpp | 2 ++ src/core/theme.h | 3 ++- 5 files changed, 32 insertions(+), 7 deletions(-) create mode 100644 src/core/nemocoreplugin.pc.in diff --git a/src/core/CMakeLists.txt b/src/core/CMakeLists.txt index e3565f1..c00b770 100644 --- a/src/core/CMakeLists.txt +++ b/src/core/CMakeLists.txt @@ -1,3 +1,5 @@ +set(PACKAGE nemocoreplugin) + set(SRC sizing.cpp nemoimageprovider.cpp @@ -11,41 +13,50 @@ set(HEADERS nemoimageprovider.h plugin.h sizing.h - theme.h logging.h themedaemon/mlocalthemedaemonclient.h themedaemon/mabstractthemedaemonclient.h) -add_library(nemocoreplugin SHARED ${SRC} ${MLITE}) +set(PUBLIC_HEADERS + theme.h) + +add_library(${PACKAGE} SHARED ${SRC} ${MLITE}) add_definitions( -DQT_INSTALL_QML="${QT_INSTALL_QML}") -qt6_add_qml_module(nemocoreplugin +qt6_add_qml_module(${PACKAGE} URI Nemo VERSION 2.0 - PLUGIN_TARGET nemocoreplugin + PLUGIN_TARGET ${PACKAGE} NO_GENERATE_PLUGIN_SOURCE SOURCES ${SOURCES} ${HEADERS} + ${PUBLIC_HEADERS} QML_FILES ${QML} OUTPUT_DIRECTORY ${CMAKE_BINARY_DIR}/Nemo ) -target_link_libraries(nemocoreplugin PUBLIC +target_link_libraries(${PACKAGE} PUBLIC Qt6::Core Qt6::Qml Qt6::Quick PkgConfig::MLITE) +configure_file(${PACKAGE}.pc.in ${PACKAGE}.pc @ONLY) -install(TARGETS nemocoreplugin +install(TARGETS ${PACKAGE} RUNTIME DESTINATION "${QT_INSTALL_QML}/Nemo/" BUNDLE DESTINATION "${QT_INSTALL_QML}/Nemo/" LIBRARY DESTINATION "${QT_INSTALL_QML}/Nemo/" ) +install(FILES ${PUBLIC_HEADERS} + DESTINATION ${CMAKE_INSTALL_INCLUDEDIR}/nemocontrols/core/) install(FILES qmldir DESTINATION ${QT_INSTALL_QML}/Nemo/) + +install(FILES ${CMAKE_CURRENT_BINARY_DIR}/${PACKAGE}.pc + DESTINATION ${CMAKE_INSTALL_LIBDIR}/pkgconfig) diff --git a/src/core/nemocoreplugin.pc.in b/src/core/nemocoreplugin.pc.in new file mode 100644 index 0000000..3e8d5df --- /dev/null +++ b/src/core/nemocoreplugin.pc.in @@ -0,0 +1,10 @@ +prefix="@CMAKE_INSTALL_PREFIX@" +exec_prefix=${prefix} +libdir=${prefix}/lib +includedir=${prefix}/include/nemocontrols/core + +Name: @PROJECT_NAME@ +Description: @CMAKE_PROJECT_DESCRIPTION@ +Version: @PROJECT_VERSION@ +Libs: -lnemocoreplugin +Cflags: -I${includedir} diff --git a/src/core/plugin.cpp b/src/core/plugin.cpp index 2fe1d2f..8f8a6d9 100644 --- a/src/core/plugin.cpp +++ b/src/core/plugin.cpp @@ -1,6 +1,7 @@ #include "plugin.h" #include "nemoimageprovider.h" #include "theme.h" +#include "sizing.h" #include void QQuickNemoControlsExtensionPlugin::registerTypes(const char* uri) diff --git a/src/core/theme.cpp b/src/core/theme.cpp index df6e780..e2a0a72 100644 --- a/src/core/theme.cpp +++ b/src/core/theme.cpp @@ -19,6 +19,8 @@ #include "theme.h" #include "logging.h" +#include "sizing.h" + #include #include #include diff --git a/src/core/theme.h b/src/core/theme.h index 84d8b4d..2b00a56 100644 --- a/src/core/theme.h +++ b/src/core/theme.h @@ -1,10 +1,11 @@ #ifndef THEME_H #define THEME_H -#include "sizing.h" #include #include +class Sizing; + class Theme : public QObject { Q_OBJECT