KDE 安装目录

发布于 2024-12-02 06:44:05 字数 1560 浏览 0 评论 0原文

我正在尝试为我的新 KDE 项目编写正确的 CMakeLists.txt 文件。但是,我在 KDE 安装目录方面遇到了一些麻烦。

我在 cmake 文件中的部分安装命令如下所示:

INSTALL(TARGETS photolayoutseditoreffectplugin_blur DESTINATION ${PLUGIN_INSTALL_DIR})
INSTALL(FILES photolayoutseditoreffectplugin_blur.desktop DESTINATION ${SERVICES_INSTALL_DIR})
INSTALL(TARGETS photolayoutseditor ${INSTALL_TARGETS_DEFAULT_ARGS})
INSTALL(PROGRAMS plugin/photolayoutseditor.desktop DESTINATION ${XDG_APPS_INSTALL_DIR})
INSTALL(FILES plugin/photolayoutseditorui.rc DESTINATION ${DATA_INSTALL_DIR}/photolayoutseditor)
INSTALL(FILES effects/photolayoutseditoreffectplugin.desktop DESTINATION ${SERVICETYPES_INSTALL_DIR})
INSTALL(FILES borders/photolayoutseditorborderplugin.desktop DESTINATION ${SERVICETYPES_INSTALL_DIR})

如您所见,KDE 软件包设置的安装目录很少。下面我在我的 cmake 脚本中编写了这些变量及其值:

${DATA_INSTALL_DIR} = /usr/local/share/apps/
${SERVICES_INSTALL_DIR} = /usr/local/share/kde4/services/
${SERVICETYPES_INSTALL_DIR} = /usr/local/share/kde4/servicetypes/
${PLUGIN_INSTALL_DIR} = /usr/local/lib/kde4/

如您所见,所有这些路径都包含“本地”文件夹。经过这样的安装后,我的项目对于我的系统仍然不可见。我使用 kde4-config 检查了这些路径,它告诉我:

kde4-config -path data = /usr/share/kde4/apps/
kde4-config -path services = /usr/share/kde4/services/
kde4-config -path servicetypes = /usr/share/kde4/servicetypes/
kde4-config -path lib = /usr/lib/

那么为什么 cmake 文件中的路径与 kde4-config 工具中的路径不同? 我确信 kde4-config 告诉我正确的路径,因为当我将项目文件移动到这些目录(url 中没有“本地”文件夹)时,我的项目对我的系统可见并且可以工作。如何正确配置我的 cmakelists.txt 的安装路径?

感谢您提前提供任何帮助! 此致!

I'm trying to write correct CMakeLists.txt file for my new KDE project. However, I have some troubles with KDE install directories.

Part of my installation commands in cmake file looks like below:

INSTALL(TARGETS photolayoutseditoreffectplugin_blur DESTINATION ${PLUGIN_INSTALL_DIR})
INSTALL(FILES photolayoutseditoreffectplugin_blur.desktop DESTINATION ${SERVICES_INSTALL_DIR})
INSTALL(TARGETS photolayoutseditor ${INSTALL_TARGETS_DEFAULT_ARGS})
INSTALL(PROGRAMS plugin/photolayoutseditor.desktop DESTINATION ${XDG_APPS_INSTALL_DIR})
INSTALL(FILES plugin/photolayoutseditorui.rc DESTINATION ${DATA_INSTALL_DIR}/photolayoutseditor)
INSTALL(FILES effects/photolayoutseditoreffectplugin.desktop DESTINATION ${SERVICETYPES_INSTALL_DIR})
INSTALL(FILES borders/photolayoutseditorborderplugin.desktop DESTINATION ${SERVICETYPES_INSTALL_DIR})

As you see there are few install dirs which are set by KDE package. Below I write those variables with their values in my cmake script:

${DATA_INSTALL_DIR} = /usr/local/share/apps/
${SERVICES_INSTALL_DIR} = /usr/local/share/kde4/services/
${SERVICETYPES_INSTALL_DIR} = /usr/local/share/kde4/servicetypes/
${PLUGIN_INSTALL_DIR} = /usr/local/lib/kde4/

As you see all of this paths contains "local" folder. After such installation my project is still invisible for my system. I checked those paths using kde4-config and it tells me:

kde4-config -path data = /usr/share/kde4/apps/
kde4-config -path services = /usr/share/kde4/services/
kde4-config -path servicetypes = /usr/share/kde4/servicetypes/
kde4-config -path lib = /usr/lib/

So why paths inside cmake file are different from those from kde4-config tool?
I'm sure that kde4-config tells me correct paths becouse when I moved my project files to those directories (without "local" folder in url) my project becomes visible for my system and it works. How to properly configure install paths for my cmakelists.txt ??

Thanks for any help in advance!
Best regards!

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

坦然微笑 2024-12-09 06:44:05

当你运行cmake时,添加标志

-DCMAKE_INSTALL_PREFIX=`kde4-config --prefix`

when you run cmake, add the flag

-DCMAKE_INSTALL_PREFIX=`kde4-config --prefix`
~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文