GENERATOR_IS_MULTI_CONFIG doesn't get set in VS Code with ninja multi-config generator

(VS Code running on Ubuntu 20.04)
With this code in CMakeLists.txt:

message(“The Generator is ${CMAKE_GENERATOR}”)

if(GENERATOR_IS_MULTI_CONFIG)
message(“The Generator is multi-config”)
else()
message(“The Generator is NOT multi-config”)
endif()

The output is:

[cmake] The Generator is Ninja Multi-Config
[cmake] The Generator is NOT multi-config

.vscode/settings.json is:

{
“cmake.generator”: “Ninja Multi-Config”
}

Am I doing something wrong?
Thanks

GENERATOR_IS_MULTI_CONFIG is a global property, not a variable. The correct way to check it is:

get_cmake_property (multi_config GENERATOR_IS_MULTI_CONFIG)

if (multi_config)
  message (“The Generator is multi-config”)
else()
  message (“The Generator is NOT multi-config”)
endif()

Thanks