- CMake uses a function to use UNC long-path based paths, even if Windows long paths is disabled, but it's not used in all places where paths are processed within CMake
- CMake uses some ChangeDirectory/ CreateProcess Windows API, that seems to not work with long paths even if the tool is made long path aware, needs rechecking
- CMake could use junctions internally like Qt Creator does, but this is a mitigation
- Just using short file paths doesn't seem to be sufficient, due to the CreateProcess issue
- Just fixing the CreateProcess issue is not sufficient because cl.exe is not long path aware
- Using both short paths and a CreateProcess fix might be enough to circumvent cl.exe issue, but CreateProcess fix would be on Windows side
- Qt also has issues due to using FetchContent, which increases the build path substantially
- user path, creator build dir name, qml uri, `CMakeFiles`, plugin target name,` plugintargetnamePlugin.cpp.obj` file
- Setting CMAKE_OBJECT_PATH_MAX to a lower value like 160, with MinGW prevents the generation of hashes for some reason, as opposed to leaving it at 250
- It's strange that the `CMakeFiles\chapter6-plugins.dir` part is not elided, and why the default path contains `build\Desktop_Qt_6_7_2_MinGW_64_bit-Debug\` in the name
- Commented some of the findings on qt bug
Notes:
There are repsonse files workarounds employed by cmake for command line length limitations,
but not in all cases. These could be improved on case by case basis.
Integrating the junction idea into cmake proper ,does not seem feasible, too much magic,
all tools and diagnostic messages would refer to junctioned paths.
Unclear how to handle relative paths that go out of source dir reliably.
Idea to improve on the long path for the qml case above would be to get rid of the
`MediaLibrary/qml/MediaLibrary/Controls/Styles` part in the build dir
replace the `ABMediaLibraryControlsStylesQMLplugin.dir/` part with a short hash of the dir,
and the `ABMediaLibraryControlsStylesQMLplugin_MediaLibrary_Controls_StylesPlugin.cpp.obj`
with a hash of the object file name. Perhaps allow customizing the object file name directly
via a source file property.
AP: Alexandru: open an issue on cmake's `qt` project bug tracker project.
Open one task for each work item that we are requesting.