Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix cmake builds on linux #1

Open
wants to merge 5 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from 3 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions demo/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,9 @@
SOFTWARE.
]]

set(CMAKE_AUTOMOC true)
enaix marked this conversation as resolved.
Show resolved Hide resolved
cmake_minimum_required(VERSION 3.24)
enaix marked this conversation as resolved.
Show resolved Hide resolved

find_package(Qt6 REQUIRED COMPONENTS Gui Qml Quick QuickControls2)

qt_add_executable(Demo main.cpp)
Expand Down
27 changes: 26 additions & 1 deletion src/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -22,9 +22,15 @@
SOFTWARE.
]]

set(CMAKE_AUTOMOC true)
enaix marked this conversation as resolved.
Show resolved Hide resolved
cmake_minimum_required(VERSION 3.24)
enaix marked this conversation as resolved.
Show resolved Hide resolved


if(UNIX AND NOT APPLE)
find_package(PkgConfig REQUIRED)
pkg_search_module(GTK3 REQUIRED gtk+-3.0)
pkg_search_module(GLIB2 REQUIRED glib-2.0)
pkg_search_module(GCONF2 REQUIRED gconf-2.0)
endif()

find_package(Qt6 REQUIRED COMPONENTS
Expand Down Expand Up @@ -54,6 +60,13 @@ qt_add_qml_module(${PROJECT_NAME}
QtQuick.Controls.Basic
)

list(APPEND QML_DIRS "/usr/lib64/qt6/qml")
enaix marked this conversation as resolved.
Show resolved Hide resolved
#TODO check QML output directory
#list(APPEND QML_DIRS "${PROJECT_SOURCE_DIR}/src")
list(REMOVE_DUPLICATES QML_DIRS)
set(QML_IMPORT_PATH "${QML_DIRS}" CACHE STRING "Add QML imports" FORCE)
enaix marked this conversation as resolved.
Show resolved Hide resolved
set(QML_IMPORT_TRACE true)
enaix marked this conversation as resolved.
Show resolved Hide resolved

target_sources(${PROJECT_NAME} PRIVATE
qtacrylicmaterial.qrc
qtacrylicmaterial_global.h
Expand Down Expand Up @@ -125,6 +138,18 @@ if(UNIX AND NOT APPLE)
target_include_directories(${PROJECT_NAME} PRIVATE
${GTK3_INCLUDE_DIRS}
)
target_link_libraries(${PROJECT_NAME} PRIVATE
${GLIB2_LIBRARIES}
)
target_include_directories(${PROJECT_NAME} PRIVATE
${GLIB2_INCLUDE_DIRS}
)
target_link_libraries(${PROJECT_NAME} PRIVATE
${GCONF2_LIBRARIES}
)
target_include_directories(${PROJECT_NAME} PRIVATE
${GCONF2_INCLUDE_DIRS}
)
endif()

target_include_directories(${PROJECT_NAME} PUBLIC
Expand All @@ -137,6 +162,6 @@ if(MSVC)
)
else()
target_compile_options(${PROJECT_NAME} PRIVATE
-Wall -Wextra -Werror
enaix marked this conversation as resolved.
Show resolved Hide resolved
-Wall -Wextra
)
endif()
4 changes: 4 additions & 0 deletions src/quickdesktopwallpaper_linux.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -22,9 +22,13 @@
* SOFTWARE.
*/

#define QT_NO_KEYWORDS
enaix marked this conversation as resolved.
Show resolved Hide resolved

#include "quickdesktopwallpaper.h"
#include "quickdesktopwallpaper_p.h"
#include <gtk/gtk.h>
#include <glib.h>
#include <gconf/gconf-client.h>

void QuickDesktopWallpaperPrivate::subscribeWallpaperChangeNotification_platform()
{
Expand Down