microsoft / vscode-cmake-tools

CMake integration in Visual Studio Code
https://marketplace.visualstudio.com/items?itemName=vector-of-bool.cmake-tools
MIT License
1.47k stars 454 forks source link

Selecting CMake Variant does not have an effect on Quick Start Project #1469

Closed nolanhergert closed 4 years ago

nolanhergert commented 4 years ago

Brief Issue Summary

After creating a CMake Quick Start project in VSCode and picking any variant, I do not see CMAKE_BUILD_TYPE getting set to any value inside of CMakeLists.txt file (it is empty)

Expected:

  1. Add message print to default CMakeLists.txt showing the CMAKE_BUILD_TYPE variable: message(CMAKE_BUILD_TYPE: ${CMAKE_BUILD_TYPE})
  2. Select a variant by using Ctrl+Shift+P and typing in "Variant". Select Release.
  3. CMake reconfigures, and I would expect the below message: [cmake] CMAKE_BUILD_TYPE: Release

Apparent Behavior:

On step 3, this is what is outputted: [cmake] CMAKE_BUILD_TYPE:

No change in behavior after deleting cache.

CMake Tools Log

[main] Configuring folder: foo 
[main] Saving open files before configure/build
[driver] Removing c:/foo/build/CMakeCache.txt
[driver] Removing c:\foo\build\CMakeFiles
[driver] Run _refreshExpansions
[driver] Run _refreshExpansions cb
[driver] Start configure 
[driver] Runnnig pre-configure checks and steps
[driver] Run _refreshExpansions
[driver] Run _refreshExpansions cb
[cmakefileapi-driver] Invoking CMake C:\Program Files\CMake\bin\cmake.EXE with arguments ["--no-warn-unused-cli","-DCMAKE_EXPORT_COMPILE_COMMANDS:BOOL=TRUE","-Hc:/foo","-Bc:/foo/build","-G","Visual Studio 16 2019","-T","host=x64","-A","x64"]
[proc] Executing command: "C:\Program Files\CMake\bin\cmake.EXE" --no-warn-unused-cli -DCMAKE_EXPORT_COMPILE_COMMANDS:BOOL=TRUE -Hc:/foo -Bc:/foo/build -G "Visual Studio 16 2019" -T host=x64 -A x64
[cmake] Not searching for unused variables given on the command line.
[cmake] -- Selecting Windows SDK version 10.0.19041.0 to target Windows 10.0.17763.
[cmake] -- The C compiler identification is MSVC 19.27.29110.0
[cmake] -- The CXX compiler identification is MSVC 19.27.29110.0
[cmake] -- Detecting C compiler ABI info
[cmake] -- Detecting C compiler ABI info - done
[cmake] -- Check for working C compiler: C:/Program Files (x86)/Microsoft Visual Studio/2019/Community/VC/Tools/MSVC/14.27.29110/bin/Hostx64/x64/cl.exe - skipped
[cmake] -- Detecting C compile features
[cmake] -- Detecting C compile features - done
[cmake] -- Detecting CXX compiler ABI info
[cmake] -- Detecting CXX compiler ABI info - done
[cmake] -- Check for working CXX compiler: C:/Program Files (x86)/Microsoft Visual Studio/2019/Community/VC/Tools/MSVC/14.27.29110/bin/Hostx64/x64/cl.exe - skipped
[cmake] -- Detecting CXX compile features
[cmake] -- Detecting CXX compile features - done
[cmake] BUILD_TYPE:
[cmake] CMAKE_BUILD_TYPE:
[cmake] -- Configuring done
[cmake] -- Generating done
[cmake] -- Build files have been written to: C:/foo/build
[cmakefileapi-parser] Read reply folder: c:\foo\build\.cmake\api\v1\reply
[cmakefileapi-parser] Found index files: ["cache-v2-95392764c56547d98563.json","codemodel-v2-3e0e115abe2f2a335738.json","index-2020-10-07T00-00-48-0827.json","target-ALL_BUILD-Debug-390a7bda798f26df05f5.json","target-ALL_BUILD-MinSizeRel-390a7bda798f26df05f5.json","target-ALL_BUILD-Release-390a7bda798f26df05f5.json","target-ALL_BUILD-RelWithDebInfo-390a7bda798f26df05f5.json","target-Continuous-Debug-b323e107c9f7121c89fa.json","target-Continuous-MinSizeRel-b323e107c9f7121c89fa.json","target-Continuous-Release-b323e107c9f7121c89fa.json","target-Continuous-RelWithDebInfo-b323e107c9f7121c89fa.json","target-Experimental-Debug-135cb15c6e1279a2bd69.json","target-Experimental-MinSizeRel-135cb15c6e1279a2bd69.json","target-Experimental-Release-135cb15c6e1279a2bd69.json","target-Experimental-RelWithDebInfo-135cb15c6e1279a2bd69.json","target-Foo-Debug-00ed2959d2839ad230b9.json","target-Foo-MinSizeRel-725ad08dd06275635722.json","target-Foo-Release-985aca1bb543e0a6de02.json","target-Foo-RelWithDebInfo-2e071a6f5268309de583.json","target-Nightly-Debug-633c94a9e9dd84ea2d3c.json","target-Nightly-MinSizeRel-633c94a9e9dd84ea2d3c.json","target-Nightly-Release-633c94a9e9dd84ea2d3c.json","target-Nightly-RelWithDebInfo-633c94a9e9dd84ea2d3c.json","target-NightlyMemoryCheck-Debug-a81246527a3ee0a36f6d.json","target-NightlyMemoryCheck-MinSizeRel-a81246527a3ee0a36f6d.json","target-NightlyMemoryCheck-Release-a81246527a3ee0a36f6d.json","target-NightlyMemoryCheck-RelWithDebInfo-a81246527a3ee0a36f6d.json","target-ZERO_CHECK-Debug-b0f86e285f3756ac7660.json","target-ZERO_CHECK-MinSizeRel-b0f86e285f3756ac7660.json","target-ZERO_CHECK-Release-b0f86e285f3756ac7660.json","target-ZERO_CHECK-RelWithDebInfo-b0f86e285f3756ac7660.json"]
[cmakefileapi-parser] Code model version (2.1) of cmake-file-api is unexpected. Expecting (2.0). IntelliSense configuration may be incorrect.
[cmakefileapi-parser] Code model version (2.1) of cmake-file-api is unexpected. Expecting (2.0). IntelliSense configuration may be incorrect.
[cache] Reading CMake cache file c:/foo/build/CMakeCache.txt
[cache] Parsing CMake cache string
[extension] [4801] cmake.cleanConfigure finished (returned 0)
[kit] OK running C:\Program Files (x86)\Microsoft Visual Studio\2019\Community\VC\Auxiliary\Build\vcvarsall.bat x64, env vars: [["CL",""],["_CL_",""],["INCLUDE","C:\\Program Files (x86)\\Microsoft Visual Studio\\2019\\Community\\VC\\Tools\\MSVC\\14.27.29110\\ATLMFC\\include;C:\\Program Files (x86)\\Microsoft Visual Studio\\2019\\Community\\VC\\Tools\\MSVC\\14.27.29110\\include;C:\\Program Files (x86)\\Windows Kits\\NETFXSDK\\4.8\\include\\um;C:\\Program Files (x86)\\Windows Kits\\10\\include\\10.0.19041.0\\ucrt;C:\\Program Files (x86)\\Windows Kits\\10\\include\\10.0.19041.0\\shared;C:\\Program Files (x86)\\Windows Kits\\10\\include\\10.0.19041.0\\um;C:\\Program Files (x86)\\Windows Kits\\10\\include\\10.0.19041.0\\winrt;C:\\Program Files (x86)\\Windows Kits\\10\\include\\10.0.19041.0\\cppwinrt"],["LIBPATH","C:\\Program Files (x86)\\Microsoft Visual Studio\\2019\\Community\\VC\\Tools\\MSVC\\14.27.29110\\ATLMFC\\lib\\x64;C:\\Program Files (x86)\\Microsoft Visual Studio\\2019\\Community\\VC\\Tools\\MSVC\\14.27.29110\\lib\\x64;C:\\Program Files (x86)\\Microsoft Visual Studio\\2019\\Community\\VC\\Tools\\MSVC\\14.27.29110\\lib\\x86\\store\\references;C:\\Program Files (x86)\\Windows Kits\\10\\UnionMetadata\\10.0.19041.0;C:\\Program Files (x86)\\Windows Kits\\10\\References\\10.0.19041.0;C:\\windows\\Microsoft.NET\\Framework64\\v4.0.30319"],["LINK",""],["_LINK_",""],["LIB","C:\\Program Files (x86)\\Microsoft Visual Studio\\2019\\Community\\VC\\Tools\\MSVC\\14.27.29110\\ATLMFC\\lib\\x64;C:\\Program Files (x86)\\Microsoft Visual Studio\\2019\\Community\\VC\\Tools\\MSVC\\14.27.29110\\lib\\x64;C:\\Program Files (x86)\\Windows Kits\\NETFXSDK\\4.8\\lib\\um\\x64;C:\\Program Files (x86)\\Windows Kits\\10\\lib\\10.0.19041.0\\ucrt\\x64;C:\\Program Files (x86)\\Windows Kits\\10\\lib\\10.0.19041.0\\um\\x64"],["PATH","C:\\Program Files (x86)\\Microsoft Visual Studio\\2019\\Community\\Common7\\IDE\\\\Extensions\\Microsoft\\IntelliCode\\CLI;C:\\Program Files (x86)\\Microsoft Visual Studio\\2019\\Community\\VC\\Tools\\MSVC\\14.27.29110\\bin\\HostX64\\x64;C:\\Program Files (x86)\\Microsoft Visual Studio\\2019\\Community\\Common7\\IDE\\VC\\VCPackages;C:\\Program Files (x86)\\Microsoft Visual Studio\\2019\\Community\\Common7\\IDE\\CommonExtensions\\Microsoft\\TestWindow;C:\\Program Files (x86)\\Microsoft Visual Studio\\2019\\Community\\Common7\\IDE\\CommonExtensions\\Microsoft\\TeamFoundation\\Team Explorer;C:\\Program Files (x86)\\Microsoft Visual Studio\\2019\\Community\\MSBuild\\Current\\bin\\Roslyn;C:\\Program Files (x86)\\Microsoft Visual Studio\\2019\\Community\\Team Tools\\Performance Tools\\x64;C:\\Program Files (x86)\\Microsoft Visual Studio\\2019\\Community\\Team Tools\\Performance Tools;C:\\Program Files (x86)\\Microsoft Visual Studio\\Shared\\Common\\VSPerfCollectionTools\\vs2019\\\\x64;C:\\Program Files (x86)\\Microsoft Visual Studio\\Shared\\Common\\VSPerfCollectionTools\\vs2019\\;C:\\Program Files (x86)\\Microsoft SDKs\\Windows\\v10.0A\\bin\\NETFX 4.8 Tools\\x64\\;C:\\Program Files (x86)\\Windows Kits\\10\\bin\\10.0.19041.0\\x64;C:\\Program Files (x86)\\Windows Kits\\10\\bin\\x64;C:\\Program Files (x86)\\Microsoft Visual Studio\\2019\\Community\\\\MSBuild\\Current\\Bin;C:\\windows\\Microsoft.NET\\Framework64\\v4.0.30319;C:\\Program Files (x86)\\Microsoft Visual Studio\\2019\\Community\\Common7\\IDE\\;C:\\Program Files (x86)\\Microsoft Visual Studio\\2019\\Community\\Common7\\Tools\\;C:\\ProgramData\\Oracle\\Java\\javapath;C:\\WINDOWS\\system32;C:\\WINDOWS;C:\\WINDOWS\\System32\\Wbem;C:\\WINDOWS\\System32\\WindowsPowerShell\\v1.0\\;C:\\Program Files\\Git\\cmd;C:\\Program Files\\dotnet\\;C:\\Program Files\\Microsoft DNX\\Dnvm\\;C:\\Python27;C:\\Users\\nhergert\\AppData\\Local\\Programs\\Python\\Python37-32;C:\\WINDOWS\\System32\\OpenSSH\\;C:\\Python27\\Scripts;C:\\Program Files (x86)\\GitExtensions\\;C:\\Program Files (x86)\\Windows Kits\\10\\Windows Performance Toolkit\\;C:\\Program Files\\CMake\\bin;C:\\Program Files\\LLVM\\bin;C:\\Program Files (x86)\\Intel\\Intel(R) Management Engine Components\\DAL;C:\\Program Files\\Intel\\Intel(R) Management Engine Components\\DAL;C:\\Ruby26-x64\\bin;C:\\Users\\nhergert\\AppData\\Local\\Microsoft\\WindowsApps;C:\\Program Files\\NASM;C:\\Program Files\\AutoHotkey;;C:\\Users\\nhergert\\AppData\\Local\\Programs\\Microsoft VS Code\\bin;C:\\Program Files (x86)\\Microsoft Visual Studio\\2019\\Community\\Common7\\IDE\\CommonExtensions\\Microsoft\\CMake\\CMake\\bin;C:\\Program Files (x86)\\Microsoft Visual Studio\\2019\\Community\\Common7\\IDE\\CommonExtensions\\Microsoft\\CMake\\Ninja;C:\\Program Files (x86)\\Microsoft Visual Studio\\2019\\Community\\Common7\\IDE\\VC\\Linux\\bin\\ConnectionManagerExe"],["TMP","C:\\Users\\nhergert\\AppData\\Local\\Temp"],["FRAMEWORKDIR","C:\\windows\\Microsoft.NET\\Framework64\\"],["FRAMEWORKDIR64","C:\\windows\\Microsoft.NET\\Framework64"],["FRAMEWORKVERSION","v4.0.30319"],["FRAMEWORKVERSION64","v4.0.30319"],["UCRTCONTEXTROOT",""],["UCRTVERSION","10.0.19041.0"],["UNIVERSALCRTSDKDIR","C:\\Program Files (x86)\\Windows Kits\\10\\"],["VCINSTALLDIR","C:\\Program Files (x86)\\Microsoft Visual Studio\\2019\\Community\\VC\\"],["VCTARGETSPATH",""],["WINDOWSLIBPATH","C:\\Program Files (x86)\\Windows Kits\\10\\UnionMetadata\\10.0.19041.0;C:\\Program Files (x86)\\Windows Kits\\10\\References\\10.0.19041.0"],["WINDOWSSDKDIR","C:\\Program Files (x86)\\Windows Kits\\10\\"],["WINDOWSSDKLIBVERSION","10.0.19041.0\\"],["WINDOWSSDKVERSION","10.0.19041.0\\"],["VISUALSTUDIOVERSION","16.0"]]

Developer Tools Log

[Extension Host] [CMakeTools] 2020-10-07T00:40:58.684Z [debug] [main] Detected saving of CMakeLists.txt, attempting automatic reconfigure...
console.ts:137 [Extension Host] [CMakeTools] 2020-10-07T00:40:58.685Z [info] [main] Configuring folder: foo 
console.ts:137 [Extension Host] [CMakeTools] 2020-10-07T00:40:58.685Z [debug] [main] Saving open files before configure/build
console.ts:137 [Extension Host] [CMakeTools] 2020-10-07T00:40:58.971Z [debug] [driver] Run _refreshExpansions
console.ts:137 [Extension Host] [CMakeTools] 2020-10-07T00:40:58.971Z [debug] [driver] Run _refreshExpansions cb
console.ts:137 [Extension Host] [CMakeTools] 2020-10-07T00:40:58.973Z [debug] [driver] Start configure 
console.ts:137 [Extension Host] [CMakeTools] 2020-10-07T00:40:58.973Z [debug] [driver] Runnnig pre-configure checks and steps
console.ts:137 [Extension Host] [CMakeTools] 2020-10-07T00:40:58.977Z [debug] [driver] Run _refreshExpansions
console.ts:137 [Extension Host] [CMakeTools] 2020-10-07T00:40:58.977Z [debug] [driver] Run _refreshExpansions cb
console.ts:137 [Extension Host] [CMakeTools] 2020-10-07T00:40:58.984Z [debug] [cmakefileapi-driver] Invoking CMake C:\Program Files\CMake\bin\cmake.EXE with arguments ["--no-warn-unused-cli","-DCMAKE_EXPORT_COMPILE_COMMANDS:BOOL=TRUE","-Hc:/foo","-Bc:/foo/build","-G","Visual Studio 16 2019","-T","host=x64","-A","x64"]
console.ts:137 [Extension Host] [CMakeTools] 2020-10-07T00:40:58.989Z [info] [proc] Executing command: "C:\Program Files\CMake\bin\cmake.EXE" --no-warn-unused-cli -DCMAKE_EXPORT_COMPILE_COMMANDS:BOOL=TRUE -Hc:/foo -Bc:/foo/build -G "Visual Studio 16 2019" -T host=x64 -A x64
console.ts:137 [Extension Host] [CMakeTools] 2020-10-07T00:40:59.095Z [info] [cmake] Not searching for unused variables given on the command line.
console.ts:137 [Extension Host] [CMakeTools] 2020-10-07T00:40:59.136Z [info] [cmake] -- Selecting Windows SDK version 10.0.19041.0 to target Windows 10.0.17763.
console.ts:137 [Extension Host] [CMakeTools] 2020-10-07T00:41:00.280Z [error] [cmake] BUILD_TYPE:
t.log @ console.ts:70
$logExtensionHostMessage @ extHostTunnelService.ts:43
_doInvokeHandler @ rpcProtocol.ts:372
_invokeHandler @ rpcProtocol.ts:372
_receiveRequest @ rpcProtocol.ts:253
_receiveOneMessage @ rpcProtocol.ts:185
(anonymous) @ rpcProtocol.ts:51
fire @ event.ts:584
fire @ ipc.net.ts:459
_receiveMessage @ ipc.net.ts:792
(anonymous) @ ipc.net.ts:647
fire @ event.ts:584
acceptChunk @ ipc.net.ts:216
(anonymous) @ ipc.net.ts:137
t @ ipc.net.ts:859
emit @ events.js:223
addChunk @ _stream_readable.js:309
readableAddChunk @ _stream_readable.js:290
Readable.push @ _stream_readable.js:224
onStreamRead @ internal/stream_base_commons.js:181
console.ts:137 [Extension Host] [CMakeTools] 2020-10-07T00:41:00.280Z [error] [cmake] CMAKE_BUILD_TYPE:
t.log @ console.ts:70
$logExtensionHostMessage @ extHostTunnelService.ts:43
_doInvokeHandler @ rpcProtocol.ts:372
_invokeHandler @ rpcProtocol.ts:372
_receiveRequest @ rpcProtocol.ts:253
_receiveOneMessage @ rpcProtocol.ts:185
(anonymous) @ rpcProtocol.ts:51
fire @ event.ts:584
fire @ ipc.net.ts:459
_receiveMessage @ ipc.net.ts:792
(anonymous) @ ipc.net.ts:647
fire @ event.ts:584
acceptChunk @ ipc.net.ts:216
(anonymous) @ ipc.net.ts:137
t @ ipc.net.ts:859
emit @ events.js:223
addChunk @ _stream_readable.js:309
readableAddChunk @ _stream_readable.js:290
Readable.push @ _stream_readable.js:224
onStreamRead @ internal/stream_base_commons.js:181
console.ts:137 [Extension Host] [CMakeTools] 2020-10-07T00:41:00.311Z [info] [cmake] -- Configuring done
console.ts:137 [Extension Host] [CMakeTools] 2020-10-07T00:41:00.437Z [info] [cmake] -- Generating done
console.ts:137 [Extension Host] [CMakeTools] 2020-10-07T00:41:00.519Z [info] [cmake] -- Build files have been written to: C:/foo/build
console.ts:137 [Extension Host] [CMakeTools] 2020-10-07T00:41:00.526Z [debug] [cmakefileapi-parser] Read reply folder: c:\foo\build\.cmake\api\v1\reply
console.ts:137 [Extension Host] [CMakeTools] 2020-10-07T00:41:00.527Z [debug] [cmakefileapi-parser] Found index files: ["cache-v2-95392764c56547d98563.json","codemodel-v2-3e0e115abe2f2a335738.json","index-2020-10-07T00-41-00-0516.json","target-ALL_BUILD-Debug-390a7bda798f26df05f5.json","target-ALL_BUILD-MinSizeRel-390a7bda798f26df05f5.json","target-ALL_BUILD-Release-390a7bda798f26df05f5.json","target-ALL_BUILD-RelWithDebInfo-390a7bda798f26df05f5.json","target-Continuous-Debug-b323e107c9f7121c89fa.json","target-Continuous-MinSizeRel-b323e107c9f7121c89fa.json","target-Continuous-Release-b323e107c9f7121c89fa.json","target-Continuous-RelWithDebInfo-b323e107c9f7121c89fa.json","target-Experimental-Debug-135cb15c6e1279a2bd69.json","target-Experimental-MinSizeRel-135cb15c6e1279a2bd69.json","target-Experimental-Release-135cb15c6e1279a2bd69.json","target-Experimental-RelWithDebInfo-135cb15c6e1279a2bd69.json","target-Foo-Debug-00ed2959d2839ad230b9.json","target-Foo-MinSizeRel-725ad08dd06275635722.json","target-Foo-Release-985aca1bb543e0a6de02.json","target-Foo-RelWithDebInfo-2e071a6f5268309de583.json","target-Nightly-Debug-633c94a9e9dd84ea2d3c.json","target-Nightly-MinSizeRel-633c94a9e9dd84ea2d3c.json","target-Nightly-Release-633c94a9e9dd84ea2d3c.json","target-Nightly-RelWithDebInfo-633c94a9e9dd84ea2d3c.json","target-NightlyMemoryCheck-Debug-a81246527a3ee0a36f6d.json","target-NightlyMemoryCheck-MinSizeRel-a81246527a3ee0a36f6d.json","target-NightlyMemoryCheck-Release-a81246527a3ee0a36f6d.json","target-NightlyMemoryCheck-RelWithDebInfo-a81246527a3ee0a36f6d.json","target-ZERO_CHECK-Debug-b0f86e285f3756ac7660.json","target-ZERO_CHECK-MinSizeRel-b0f86e285f3756ac7660.json","target-ZERO_CHECK-Release-b0f86e285f3756ac7660.json","target-ZERO_CHECK-RelWithDebInfo-b0f86e285f3756ac7660.json"]
console.ts:137 [Extension Host] [CMakeTools] 2020-10-07T00:41:00.532Z [warning] [cmakefileapi-parser] Code model version (2.1) of cmake-file-api is unexpected. Expecting (2.0). IntelliSense configuration may be incorrect.
t.log @ console.ts:70
$logExtensionHostMessage @ extHostTunnelService.ts:43
_doInvokeHandler @ rpcProtocol.ts:372
_invokeHandler @ rpcProtocol.ts:372
_receiveRequest @ rpcProtocol.ts:253
_receiveOneMessage @ rpcProtocol.ts:185
(anonymous) @ rpcProtocol.ts:51
fire @ event.ts:584
fire @ ipc.net.ts:459
_receiveMessage @ ipc.net.ts:792
(anonymous) @ ipc.net.ts:647
fire @ event.ts:584
acceptChunk @ ipc.net.ts:216
(anonymous) @ ipc.net.ts:137
t @ ipc.net.ts:859
emit @ events.js:223
addChunk @ _stream_readable.js:309
readableAddChunk @ _stream_readable.js:290
Readable.push @ _stream_readable.js:224
onStreamRead @ internal/stream_base_commons.js:181
console.ts:137 [Extension Host] [CMakeTools] 2020-10-07T00:41:00.538Z [warning] [cmakefileapi-parser] Code model version (2.1) of cmake-file-api is unexpected. Expecting (2.0). IntelliSense configuration may be incorrect.
t.log @ console.ts:70
$logExtensionHostMessage @ extHostTunnelService.ts:43
_doInvokeHandler @ rpcProtocol.ts:372
_invokeHandler @ rpcProtocol.ts:372
_receiveRequest @ rpcProtocol.ts:253
_receiveOneMessage @ rpcProtocol.ts:185
(anonymous) @ rpcProtocol.ts:51
fire @ event.ts:584
fire @ ipc.net.ts:459
_receiveMessage @ ipc.net.ts:792
(anonymous) @ ipc.net.ts:647
fire @ event.ts:584
acceptChunk @ ipc.net.ts:216
(anonymous) @ ipc.net.ts:137
t @ ipc.net.ts:859
emit @ events.js:223
addChunk @ _stream_readable.js:309
readableAddChunk @ _stream_readable.js:290
Readable.push @ _stream_readable.js:224
onStreamRead @ internal/stream_base_commons.js:181
console.ts:137 [Extension Host] [CMakeTools] 2020-10-07T00:41:00.704Z [debug] [cache] Reading CMake cache file c:/foo/build/CMakeCache.txt
console.ts:137 [Extension Host] [CMakeTools] 2020-10-07T00:41:00.711Z [debug] [cache] Parsing CMake cache string
console.ts:137 [Extension Host] varsForVSInstallation path:'C:\Program Files (x86)\Microsoft Visual Studio\2019\Community' version:16.7.30330.147 host arch:x64 - target arch:x64
console.ts:137 [Extension Host] [CMakeTools] 2020-10-07T00:41:06.393Z [debug] [kit] OK running C:\Program Files (x86)\Microsoft Visual Studio\2019\Community\VC\Auxiliary\Build\vcvarsall.bat x64, env vars: [["CL",""],["_CL_",""],["INCLUDE","C:\\Program Files (x86)\\Microsoft Visual Studio\\2019\\Community\\VC\\Tools\\MSVC\\14.27.29110\\ATLMFC\\include;C:\\Program Files (x86)\\Microsoft Visual Studio\\2019\\Community\\VC\\Tools\\MSVC\\14.27.29110\\include;C:\\Program Files (x86)\\Windows Kits\\NETFXSDK\\4.8\\include\\um;C:\\Program Files (x86)\\Windows Kits\\10\\include\\10.0.19041.0\\ucrt;C:\\Program Files (x86)\\Windows Kits\\10\\include\\10.0.19041.0\\shared;C:\\Program Files (x86)\\Windows Kits\\10\\include\\10.0.19041.0\\um;C:\\Program Files (x86)\\Windows Kits\\10\\include\\10.0.19041.0\\winrt;C:\\Program Files (x86)\\Windows Kits\\10\\include\\10.0.19041.0\\cppwinrt"],["LIBPATH","C:\\Program Files (x86)\\Microsoft Visual Studio\\2019\\Community\\VC\\Tools\\MSVC\\14.27.29110\\ATLMFC\\lib\\x64;C:\\Program Files (x86)\\Microsoft Visual Studio\\2019\\Community\\VC\\Tools\\MSVC\\14.27.29110\\lib\\x64;C:\\Program Files (x86)\\Microsoft Visual Studio\\2019\\Community\\VC\\Tools\\MSVC\\14.27.29110\\lib\\x86\\store\\references;C:\\Program Files (x86)\\Windows Kits\\10\\UnionMetadata\\10.0.19041.0;C:\\Program Files (x86)\\Windows Kits\\10\\References\\10.0.19041.0;C:\\windows\\Microsoft.NET\\Framework64\\v4.0.30319"],["LINK",""],["_LINK_",""],["LIB","C:\\Program Files (x86)\\Microsoft Visual Studio\\2019\\Community\\VC\\Tools\\MSVC\\14.27.29110\\ATLMFC\\lib\\x64;C:\\Program Files (x86)\\Microsoft Visual Studio\\2019\\Community\\VC\\Tools\\MSVC\\14.27.29110\\lib\\x64;C:\\Program Files (x86)\\Windows Kits\\NETFXSDK\\4.8\\lib\\um\\x64;C:\\Program Files (x86)\\Windows Kits\\10\\lib\\10.0.19041.0\\ucrt\\x64;C:\\Program Files (x86)\\Windows Kits\\10\\lib\\10.0.19041.0\\um\\x64"],["PATH","C:\\Program Files (x86)\\Microsoft Visual Studio\\2019\\Community\\Common7\\IDE\\\\Extensions\\Microsoft\\IntelliCode\\CLI;C:\\Program Files (x86)\\Microsoft Visual Studio\\2019\\Community\\VC\\Tools\\MSVC\\14.27.29110\\bin\\HostX64\\x64;C:\\Program Files (x86)\\Microsoft Visual Studio\\2019\\Community\\Common7\\IDE\\VC\\VCPackages;C:\\Program Files (x86)\\Microsoft Visual Studio\\2019\\Community\\Common7\\IDE\\CommonExtensions\\Microsoft\\TestWindow;C:\\Program Files (x86)\\Microsoft Visual Studio\\2019\\Community\\Common7\\IDE\\CommonExtensions\\Microsoft\\TeamFoundation\\Team Explorer;C:\\Program Files (x86)\\Microsoft Visual Studio\\2019\\Community\\MSBuild\\Current\\bin\\Roslyn;C:\\Program Files (x86)\\Microsoft Visual Studio\\2019\\Community\\Team Tools\\Performance Tools\\x64;C:\\Program Files (x86)\\Microsoft Visual Studio\\2019\\Community\\Team Tools\\Performance Tools;C:\\Program Files (x86)\\Microsoft Visual Studio\\Shared\\Common\\VSPerfCollectionTools\\vs2019\\\\x64;C:\\Program Files (x86)\\Microsoft Visual Studio\\Shared\\Common\\VSPerfCollectionTools\\vs2019\\;C:\\Program Files (x86)\\Microsoft SDKs\\Windows\\v10.0A\\bin\\NETFX 4.8 Tools\\x64\\;C:\\Program Files (x86)\\Windows Kits\\10\\bin\\10.0.19041.0\\x64;C:\\Program Files (x86)\\Windows Kits\\10\\bin\\x64;C:\\Program Files (x86)\\Microsoft Visual Studio\\2019\\Community\\\\MSBuild\\Current\\Bin;C:\\windows\\Microsoft.NET\\Framework64\\v4.0.30319;C:\\Program Files (x86)\\Microsoft Visual Studio\\2019\\Community\\Common7\\IDE\\;C:\\Program Files (x86)\\Microsoft Visual Studio\\2019\\Community\\Common7\\Tools\\;C:\\ProgramData\\Oracle\\Java\\javapath;C:\\WINDOWS\\system32;C:\\WINDOWS;C:\\WINDOWS\\System32\\Wbem;C:\\WINDOWS\\System32\\WindowsPowerShell\\v1.0\\;C:\\Program Files\\Git\\cmd;C:\\Program Files\\dotnet\\;C:\\Program Files\\Microsoft DNX\\Dnvm\\;C:\\Python27;C:\\Users\\nhergert\\AppData\\Local\\Programs\\Python\\Python37-32;C:\\WINDOWS\\System32\\OpenSSH\\;C:\\Python27\\Scripts;C:\\Program Files (x86)\\GitExtensions\\;C:\\Program Files (x86)\\Windows Kits\\10\\Windows Performance Toolkit\\;C:\\Program Files\\CMake\\bin;C:\\Program Files\\LLVM\\bin;C:\\Program Files (x86)\\Intel\\Intel(R) Management Engine Components\\DAL;C:\\Program Files\\Intel\\Intel(R) Management Engine Components\\DAL;C:\\Ruby26-x64\\bin;C:\\Users\\nhergert\\AppData\\Local\\Microsoft\\WindowsApps;C:\\Program Files\\NASM;C:\\Program Files\\AutoHotkey;;C:\\Users\\nhergert\\AppData\\Local\\Programs\\Microsoft VS Code\\bin;C:\\Program Files (x86)\\Microsoft Visual Studio\\2019\\Community\\Common7\\IDE\\CommonExtensions\\Microsoft\\CMake\\CMake\\bin;C:\\Program Files (x86)\\Microsoft Visual Studio\\2019\\Community\\Common7\\IDE\\CommonExtensions\\Microsoft\\CMake\\Ninja;C:\\Program Files (x86)\\Microsoft Visual Studio\\2019\\Community\\Common7\\IDE\\VC\\Linux\\bin\\ConnectionManagerExe"],["TMP","C:\\Users\\nhergert\\AppData\\Local\\Temp"],["FRAMEWORKDIR","C:\\windows\\Microsoft.NET\\Framework64\\"],["FRAMEWORKDIR64","C:\\windows\\Microsoft.NET\\Framework64"],["FRAMEWORKVERSION","v4.0.30319"],["FRAMEWORKVERSION64","v4.0.30319"],["UCRTCONTEXTROOT",""],["UCRTVERSION","10.0.19041.0"],["UNIVERSALCRTSDKDIR","C:\\Program Files (x86)\\Windows Kits\\10\\"],["VCINSTALLDIR","C:\\Program Files (x86)\\Microsoft Visual Studio\\2019\\Community\\VC\\"],["VCTARGETSPATH",""],["WINDOWSLIBPATH","C:\\Program Files (x86)\\Windows Kits\\10\\UnionMetadata\\10.0.19041.0;C:\\Program Files (x86)\\Windows Kits\\10\\References\\10.0.19041.0"],["WINDOWSSDKDIR","C:\\Program Files (x86)\\Windows Kits\\10\\"],["WINDOWSSDKLIBVERSION","10.0.19041.0\\"],["WINDOWSSDKVERSION","10.0.19041.0\\"],["VISUALSTUDIOVERSION","16.0"]]

Platform and Versions

Other Notes/Information

I am able to get something in the CMAKE_BUILD_TYPE in my actual project, but it is sticky and doesn't change when I change the build variant. Deleting cache clears it, but it has inconsistent behavior afterwards. Hopefully it will reproduce on the Quick Start cmake project.

bobbrow commented 4 years ago

The Visual Studio generator is a multi-build generator (i.e. it generates all configs at once), so CMAKE_BUILD_TYPE is not provided in that case.

However, since some folks have desired this behavior, we recently approved PR #1393 which will add a new setting to enable this. The setting is cmake.setBuildTypeOnMultiConfig and will be available in 1.5.0 later this month.