Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
我正在为我的项目使用 CMake/CPack。在 Windows 上,我将 CPack 与 NSIS 一起使用,一切都很好。但是对于 Linux,我使用 CPack 的 DEB 生成器,我遇到了一些问题。也就是说,我找不到在 Gnome/KDE/etc 的菜单中添加图标的正确方法。我知道我可以创建 app.desktop 文件,并将其放在 /usr/share/applications 中。但是有没有其他(推荐的)方法可以用 CPack 来做呢?
看起来最好的方法(实际上还不错)是创建 MyApp.desktop 文件并将以下内容添加到 CMakeLists.txt:
INSTALL(FILES MyApp.desktop DESTINATION share/applications)