Starting with CMake 3.7.0, it cannot find root directory in specific conditions
A recent update to cmake have shown that some of my scripts started failing with cmake reporting that it cannot find the CMAKE_ROOT while using the relocating package in Windows OS. The reason why cmake failed to find its root directory is because the script invoking cmake had a case change in the bin directory.
Here is an example of the failure.
cmd>%CMAKE_HOME%\BIN\CMake.exe -G "Visual Studio 11 2012" .. CMake Error: Could not find CMAKE_ROOT !!! CMake has most likely not been installed correctly. Modules directory not found in CMake Error: Error executing cmake::LoadCache(). Aborting.
But here is an example with the same release version of cmake.
cmd>%CMAKE_HOME%\bin\CMake.exe -G "Visual Studio 11 2012" .. -- The C compiler identification is MSVC 17.0.61030.0 -- The CXX compiler identification is MSVC 17.0.61030.0 -- Check for working C compiler: C:/Program Files (x86)/Microsoft Visual Studio 11.0/VC/bin/cl.exe -- Check for working C compiler: C:/Program Files (x86)/Microsoft Visual Studio 11.0/VC/bin/cl.exe -- works -- Detecting C compiler ABI info
Take notice on the failing version that the path used for execution is BIN\CMake.exe and the working version is bin\CMake.exe