Help: CMAKE_INSTALL_MODE documentation is missing important details
The CMAKE_INSTALL_MODE
environment variable is new for CMake 3.22, added by !6396 (merged). The documentation as at 3.22.0-rc2 is missing some important details that should be highlighted, including:
- If the target is symlinked instead of copied, the build RPATH will be retained instead of the install RPATH (on platforms where RPATH is supported).
- If a regular file exists at the target destination and
CMAKE_INSTALL_MODE
is set to one of the symlinking modes, that existing file is silently discarded and replaced with a symlink. But if a symlink exists at the target destination andCMAKE_INSTALL_MODE
is NOT set to one of the symlinking modes, the existing symlink is retained instead of being replaced with the file to be installed. This seems like a bug, but if not, it should at least be documented. - The docs should highlight that the environment variable needs to be set at configure time (i.e. when
cmake
is run), not at install time. - Interaction with
CMAKE_IOS_INSTALL_COMBINED
should be investigated and clarified. For that scenario, you would need to set the environment variable at install time as well, otherwise the secondary build won't see it. Personally, I doubt anyone is likely to use this feature withCMAKE_IOS_INSTALL_COMBINED
though, I can't think of a case where that would make much sense.
Edited by Brad King