Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to create desktop icons for a deb package created with CPack?

Tags:

linux

cpack

deb

I am using CMake/CPack for my project. On Windows, I use CPack with NSIS, and it's all good. But for Linux, I use the DEB generator for CPack, and I have run into a few issues. Namely, I cannot find a proper way to add an icon in the menu of Gnome/KDE/etc. I know that I can create app.desktop file, and put it in /usr/share/applications. But is there some other (recommended) way of doing it with CPack?

like image 487
Amy Avatar asked Oct 25 '25 06:10

Amy


1 Answers

It looks like the best approach (which isn't bad actually) is to just create the MyApp.desktop file and add the following to CMakeLists.txt:

INSTALL(FILES MyApp.desktop DESTINATION share/applications)
like image 164
Amy Avatar answered Oct 26 '25 19:10

Amy