I've seen many linux applications packaged with their binaries in some path like /opt/mypkg/myexecutable
and a symlink to it in /usr/bin
. I've seen these symlinks in the packaged files.
I want to do the same while packaging my software with cpack, creating deb and rpm packages with CPackDEB and CPackRPM.
Is it possible to create a symlink to an arbitrary, possibly non existent path?
Could I then use
INSTALL(FILES "mysymlink" DESTINATION /usr/bin/myapp COMPONENT MyComponent)
? (Would there be problems with symlinks being followed when the destination actually exists?)Could I change the link destination with something like
CONFIGURE_FILE()
Or am I just missing a cpack directive that does the job correctly?