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 all 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
10 changes: 9 additions & 1 deletion demo/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,10 @@ if(WIN32)
target_sources(Demo PRIVATE demo.rc demo.manifest)
endif()

set(QML_SRC_FILES
MainWindow.qml
)

qt_add_qml_module(Demo
URI Demo
VERSION 1.0
Expand All @@ -39,11 +43,15 @@ qt_add_qml_module(Demo
QtQuick
QtQuick.Controls.Basic
org.wangwenx190.QtAcrylicMaterial
QML_FILES MainWindow.qml
QML_FILES ${QML_SRC_FILES}
IMPORT_PATH ${PROJECT_BINARY_DIR}/imports
ENABLE_TYPE_COMPILER
)

qt6_target_compile_qml_to_cpp(Demo
QML_FILES ${QML_SRC_FILES}
)

set_target_properties(Demo PROPERTIES
MACOSX_BUNDLE_GUI_IDENTIFIER org.wangwenx190.qtacrylicmaterial.demo
MACOSX_BUNDLE_BUNDLE_VERSION 1.0.0.0
Expand Down
18 changes: 18 additions & 0 deletions src/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,8 @@
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 @@ -103,6 +105,10 @@ target_compile_definitions(${PROJECT_NAME} PRIVATE
QTACRYLICMATERIAL_BUILD_LIBRARY
)

if (UNIX)
set_source_files_properties(quickdesktopwallpaper_linux.cpp PROPERTIES COMPILE_FLAGS "-DQT_NO_KEYWORDS -Wno-deprecated-declarations")
endif()

if(QTACRYLICMATERIAL_BUILD_STATIC)
target_compile_definitions(${PROJECT_NAME} PUBLIC
QTACRYLICMATERIAL_BUILD_STATIC
Expand All @@ -125,6 +131,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 Down
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.
*/

#undef signal

#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