How to tell CMake to use relative paths

CMake does always use absolute paths. It’s part of the concept. Therefore you can’t move the generated build environment files nor can you e.g. bring them under source control or make the verbose output prettier (you could just play a little with the rule messages like here).

There once was CMAKE_USE_RELATIVE_PATHS, but the documentation reveals:

This variable has no effect. The partially implemented effect it had in previous releases was removed in CMake 3.4.

References

Leave a Comment