I tried multiple approaches:
install(TARGETS tgt RUNTIME DESTINATION /usr/bin RENAME another_name)
ignores RENAME without any warning. Documentation says no about RENAME for TARGETS.add_executable(zbus-publish ALIAS zbus-example-publisher)
gives an errorinstall TARGETS given target "zbus-publish" which is an alias.
tried to install symlinks to installed targets
install(CODE "execute_process(COMMAND ln -s zbus-example-publisher ${DESTDIR}/${CMAKE_INSTALL_PREFIX}/${CMAKE_INSTALL_BINDIR}/zbus-publish COMMAND ln -s zbus-example-subscriber ${DESTDIR}/${CMAKE_INSTALL_PREFIX}/${CMAKE_INSTALL_BINDIR}/zbus-subscribe) message(==================================================)"
But it expands DESTDIR to nothing.
I need DESTDIR because use make DESTDIR=xxxx
to test my installation. It is very convenient. And also useful when cross-compiling.
CMake version 3.17.2