Use `CMAKE_INSTALL_MODE` environment variable to implement `--symlink-install` for plain cmake projects
Since CMake 3.22 CMake provides the CMAKE_INSTALL_MODE. This option has been implemented explicitly to replace install with symlink in superbuild/virtualmonorepo workflows, with the advantages discussed in https://gitlab.kitware.com/cmake/cmake/-/issues/21612 and https://gitlab.kitware.com/cmake/cmake/-/merge_requests/6396 (colcon/ament_cmake --symlink-install was explicitly mentioned as one of the inspiration).
The main advantages are the same of the colcon's --symlink-install. Reading about it, I wonder if perhaps it could be used to implement --symlink-install also for plain cmake projects.
I may look into this in the future, but anyhow I wanted to start opening an issue in case someone wanted to discuss the idea. I was not sure if this repo or colcon-cmake was the right place were to open the issue, in case colcon-cmake is better, feel free to move it, thanks!