Unclear message when exceeding CMAKE_OBJECT_PATH_MAX
When an object file path exceeds CMAKE_OBJECT_PATH_MAX, there is a message:
The object file directory [path to directory] has 204 characters. The maximum full path to an object file is 250 characters (see CMAKE_OBJECT_PATH_MAX). Object file [object filename] cannot be safely placed under this directory. The build may not work correctly.
I am in a pretty big team, and everybody interpreted the message as "be careful, you are at 204, you might go beyond the 250 limit". In fact, one should also sum the length of the object filename. Furthermore "the build may not work correctly" does not give any idea of what is going on, and how in fact things are in practice working. There is a hint to look at CMAKE_OBJECT_PATH_MAX, but honestly what one would expect is there they will find a documentation like "this variable says how long a path to an object file can be".
I think the message should be changed so that:
- It mentions somewhere the total path length, that is length(directory path)+length(object filename)
- It mentions that the path will be hashed, and then it says what could go wrong (if anything). Otherwise the user is left without hints of what is going to happen. If in fact hashing is fine, and no real danger is present, the message should be changed to an info message saying something like: "The object file path will be hashed as it exceeds the maximum full path (250). See CMAKE_OBJECT_PATH_MAX doc...".
- It closes with a statement "See CMAKE_OBJECT_PATH_MAX documentation for more details".