Windows CMake failures with case senstitive folders (Windows 10 April 2018 update)
So, had this issue were a new sub-project would continuously rebuild when nothing had changed. ie. In 2017 SLN, F5 after a successful build would re-build it all over again. Was stuck on this for a good day. Enable diagnostics and after some googling, found the offending issue. For note, I'm cross compiling from same CMake setup in VS2017 and gcc 6.3 under Debian WSL. Here's what Visual Studio says about the issue:
5>Project is not up-to-date: build input 'c:\git\cambrionix\external\flatbuffers\cmakelists.txt' is missing.
And sure enough from CMD.EXE in Windows, here's the folder. One DIR with the given filename, and once again with the case fully specified:
C:\Program Files (x86)\Microsoft Visual Studio\2017\Community>dir c:\git\cambrionix\external\flatbuffers\cmakelists.txt
Volume in drive C has no label.
Volume Serial Number is 6801-D9E9
Directory of c:\git\cambrionix\external\flatbuffers
File Not Found
C:\Program Files (x86)\Microsoft Visual Studio\2017\Community>dir C:\git\Cambrionix\external\flatbuffers\CMakeLists.txt
Volume in drive C has no label.
Volume Serial Number is 6801-D9E9
Directory of C:\git\Cambrionix\external\flatbuffers
24/06/2018 11:59 AM 11,495 CMakeLists.txt
1 File(s) 11,495 bytes
0 Dir(s) 31,499,501,568 bytes free
It turns out that since the April 2018 update of Windows 10, folders that are created under WSL will automatically have the new case sensitive folder attribute enabled. I'd cloned the specific part from WSL terminal.
I'm not sure where or when CMake decides to lowercase filenames, but it needs to stop. :)
It obviously doesn't do it for other generators, and I can see no good reason to do it for Windows, either now or in the past, regardless of case sensitive filesystem options.
A temporary work-around for this is to disable the case on the folders created under WSL. See: https://www.howtogeek.com/354220/how-to-enable-case-sensitive-folders-on-windows-10/
But this is obviously not a long term solution now that Microsoft have bitten the bullet to allow this.