CMAKE_CONFIG_TYPE env variable is ignored for Visual Studio 16 2019
Relevant logs from the Github CI workflow where I noticed this.
For those without a Github account to see the logs:
Run cmake --build build/install -j 3
cmake --build build/install -j 3
shell: C:\Program Files\PowerShell\7\pwsh.EXE -command ". '{0}'"
env:
CMAKE_CONFIG_TYPE: Release
CTEST_OUTPUT_ON_FAILURE: 1
Microsoft (R) Build Engine version 16.7.0+b89cb5fde for .NET Framework
Copyright (C) Microsoft Corporation. All rights reserved.
Checking Build System
Building Custom Rule D:/a/cpp-lazy/cpp-lazy/build/install/_deps/fmt-src/CMakeLists.txt
format.cc
os.cc
Generating Code...
fmt.vcxproj -> D:\a\cpp-lazy\cpp-lazy\build\install\_deps\fmt-build\Debug\fmtd.lib
Building Custom Rule D:/a/cpp-lazy/cpp-lazy/CMakeLists.txt
Install phase:
Run cmake --install build/install
cmake --install build/install
shell: C:\Program Files\PowerShell\7\pwsh.EXE -command ". '{0}'"
env:
CMAKE_CONFIG_TYPE: Release
CTEST_OUTPUT_ON_FAILURE: 1
-- Install configuration: "Release"
-- Installing: D:/a/cpp-lazy/cpp-lazy/build/prefix/lib/cmake/fmt/fmt-config.cmake
-- Installing: D:/a/cpp-lazy/cpp-lazy/build/prefix/lib/cmake/fmt/fmt-config-version.cmake
-- Installing: D:/a/cpp-lazy/cpp-lazy/build/prefix/lib/cmake/fmt/fmt-targets.cmake
-- Installing: D:/a/cpp-lazy/cpp-lazy/build/prefix/lib/cmake/fmt/fmt-targets-release.cmake
CMake Error at build/install/_deps/fmt-build/cmake_install.cmake:74 (file):
file INSTALL cannot find
"D:/a/cpp-lazy/cpp-lazy/build/install/_deps/fmt-build/Release/fmt.lib":
File exists.
Call Stack (most recent call first):
build/install/cmake_install.cmake:37 (include)
The CMake in question is version 3.17.0 and according to the docs this env variable provides a value when there is no explicit configuration given.
Is this a bug? Are the docs wrong?
Edited by friendlyanon