UPDATE
Check this repository for a complete example including automatic desktop/icon file install :
https://gitlab.com/InstitutMaupertuis...
Read below if you want to manually create a desktop launcher.
First, create a directory for your icons, then copy the application icon to the directory:
sudo mkdir /usr/local/share/icons -p
sudo cp ros.png /usr/local/share/icons/
After that we need to create a .desktop
file:
sudo mkdir /usr/local/share/applications/ -p
sudo gedit /usr/local/share/applications/ros_fanuc_m10ia_support.desktop
Make sure to have ros-indigo-fanuc
package installed for this example:
[Desktop Entry]
Name=Fanuc M10iA support
Comment=ROS - Fanuc M10iA support
Exec=bash -c "source /opt/ros/indigo/setup.bash && roslaunch fanuc_m10ia_support test_m10ia.launch"
Icon=/usr/local/share/icons/ros.png
Type=Application
Categories=ROS;
StartupNotify=true
Once this is done, use the Unity launcher and search for fanuc
:
Click to launch the application:
You can also pin the application in the launch bar like any other application:
Of course, this process would be ideally incorporated to the install target of your CMake script.
This way the launcher would be automatically created at the application installation.