KDE 安装目录
我正在尝试为我的新 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 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
当你运行
cmake
时,添加标志when you run
cmake
, add the flag