CMake Error Generator Visual Studio 16 2019 does not support variabl CMAKE_DEFAULT_BUILD_TYPE but it has been specified

Hello,

When i in Cmake GUI pushing the Generate i have the error
CMake Error Generator Visual Studio 16 2019 does not support variabl CMAKE_DEFAULT_BUILD_TYPE but it has been specified.

How to solve this problem?

Hello, Fallowed instruction in [Windows — 3D Slicer documentation]

After Configure - When i Push the Button in CMAKE GUI - > Generate i got the ERROR mesage

CMake Error:
Generator

Visual Studio 16 2019

does not support variable

CMAKE_DEFAULT_BUILD_TYPE

but it has been specified.

What i must to doo to avoid the this error? How to solve the this problem?

Program Versions:
CMAKE 3.20.5
QT 5.15.2 D:/QT/5.15.2/msvc2019_64/lib/cmake/Qt5

The solution is not to specify this variable. Visual Studio is a multi-configuration generator. You can have all your configurations in one build tree.

Due to complexity of Slicer’s build system, we recommend to create a separate build tree for each configuration (we do not test if building with different configurations in the same build tree works or not, so probably it does not work). This means that after you build Slicer in Debug mode, you need to create a new build tree if you want to build in release mode as well.