I've got a custom toolchain. I set CMAKE_AR variable with path to a proper ar program. However while I am building a static library, I've got the error:
cmd.exe /C "cd . && "C:\Program Files (x86)\CMake\bin\cmake.exe" -E remove Library\libLibrary.a && "" qc Library\libLibrary.a Library/CMakeFiles/Library.dir/src/Library.cpp.obj && cd ."
'""' is not recognized as an internal or external command,
If I noticed correctly, CMake is using CMAKE_CXX_ARCHIVE_CREATE variable to create library. Its default value is:
set(CMAKE_CXX_ARCHIVE_CREATE "<CMAKE_AR> qc <TARGET> <LINK_FLAGS> <OBJECTS>")
(https://github.com/Kitware/CMake/blob/v3.10.3/Modules/CMakeCXXInformation.cmake) The problem is that part is not replaced by CMAKE_AR variable. It is weird, because and seem to be correct. I know that I can change in CMAKE_CXX_ARCHIVE_CREATE by replacing it by path to ar program, but I would have to also change other variables.
CMake: 3.10.2 OS: Windows 10
It seems to be a bug in CMake.