diff --git a/CMakeLists.txt b/CMakeLists.txt --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -39,6 +39,7 @@ include(FeatureSummary) include(ECMQtDeclareLoggingCategory) include(ECMAddTests) +include(ECMQueryQmake) add_definitions(-DQT_NO_URL_CAST_FROM_STRING -DQT_NO_CAST_FROM_ASCII -DQT_NO_FOREACH) if (EXISTS "${CMAKE_SOURCE_DIR}/.git") @@ -112,6 +113,9 @@ message(FATAL_ERROR "No suitable backend platform was found. Currently supported platforms are: XCB Components Required: ${XCB_COMPONENTS_ERRORS}") endif() +# locate qdbus in the Qt path because not every distro makes a symlink at /usr/bin/qdbus +query_qmake(QtBinariesDir QT_INSTALL_BINS) + # hand off to subdirectories add_subdirectory(src) diff --git a/desktop/CMakeLists.txt b/desktop/CMakeLists.txt --- a/desktop/CMakeLists.txt +++ b/desktop/CMakeLists.txt @@ -1,7 +1,8 @@ # install the .desktop and rc files in the correct place +configure_file(org.kde.spectacle.desktop.cmake ${CMAKE_CURRENT_BINARY_DIR}/org.kde.spectacle.desktop) install( - PROGRAMS org.kde.spectacle.desktop + PROGRAMS ${CMAKE_CURRENT_BINARY_DIR}/org.kde.spectacle.desktop DESTINATION ${XDG_APPS_INSTALL_DIR} ) diff --git a/desktop/org.kde.spectacle.desktop b/desktop/org.kde.spectacle.desktop.cmake rename from desktop/org.kde.spectacle.desktop rename to desktop/org.kde.spectacle.desktop.cmake --- a/desktop/org.kde.spectacle.desktop +++ b/desktop/org.kde.spectacle.desktop.cmake @@ -136,7 +136,7 @@ Keywords[x-test]=xxsnapshotxx;xxcapturexx;xxprintxx;xxscreenshotxx;xxsnippingxx;xxsnipxx; Keywords[zh_CN]=snapshot;capture;print;screenshot;snipping;snip;快照;截图;抓取;屏幕截图;截屏;抓屏; Keywords[zh_TW]=snapshot;capture;print;screenshot;snipping;snip;截圖;擷取;截圖程式 -Exec=qdbus org.kde.Spectacle / StartAgent +Exec=@QtBinariesDir@/qdbus org.kde.Spectacle / StartAgent Icon=spectacle Type=Application Terminal=false @@ -186,7 +186,7 @@ Name[x-test]=xxCapture Entire Desktopxx Name[zh_CN]=截取整个桌面 Name[zh_TW]=擷取整個桌面 -Exec=qdbus org.kde.Spectacle / FullScreen false +Exec=@QtBinariesDir@/qdbus org.kde.Spectacle / FullScreen false X-KDE-Shortcuts=Shift+Print [Desktop Action CurrentMonitorScreenShot] @@ -229,7 +229,7 @@ Name[x-test]=xxCapture Current Monitorxx Name[zh_CN]=截取当前显示器 Name[zh_TW]=擷取目前螢幕 -Exec=qdbus org.kde.Spectacle / CurrentScreen false +Exec=@QtBinariesDir@/qdbus org.kde.Spectacle / CurrentScreen false [Desktop Action ActiveWindowScreenShot] @@ -272,7 +272,7 @@ Name[x-test]=xxCapture Active Windowxx Name[zh_CN]=截取活动窗口 Name[zh_TW]=擷取作用中的視窗 -Exec=qdbus org.kde.Spectacle / ActiveWindow true false +Exec=@QtBinariesDir@/qdbus org.kde.Spectacle / ActiveWindow true false X-KDE-Shortcuts=Meta+Print [Desktop Action RectangularRegionScreenShot] @@ -315,5 +315,5 @@ Name[x-test]=xxCapture Rectangular Regionxx Name[zh_CN]=截取矩形区域 Name[zh_TW]=擷取矩形區域 -Exec=qdbus org.kde.Spectacle / RectangularRegion true +Exec=@QtBinariesDir@/qdbus org.kde.Spectacle / RectangularRegion true X-KDE-Shortcuts=Meta+Shift+Print