CMAKE_BUILD_TYPE value empty on configure and install using VS Code
See original GitHub issueI am using VS Code
on windows 10
since last year, and it is working perfectly with vscode-cmake-tools
.
Cmake command:
message("Build type of project is : " ${CMAKE_BUILD_TYPE})
The expectation is when I configure
cmake project it should show the selected configuration.
When Debug build is selected from status bar of VS code.
Expected result would be:
Build type of project is : Debug
But unfortunately, it is not showing build type
Build type of project is :
Same case happened when I Cmake: Release
project.
It is not able to detect the selected build type.
Can anyone please suggest what to do in this case to get selected values in cmake_build_type
?
Issue Analytics
- State:
- Created 3 years ago
- Comments:9 (5 by maintainers)
Top Results From Across the Web
CMAKE_BUILD_TYPE is not being used in CMakeLists.txt
Meaning that that value will be updated permanently from that point to the end of the configuration run. One great way to track...
Read more >CMAKE_BUILD_TYPE — CMake 3.25.1 Documentation
The default value is often an empty string, but this is usually not desirable and one of the other standard build types is...
Read more >CMAKE_BUILD_TYPE variable not set - Visual Studio Feedback
I noticed this problem because I need CMAKE_BUILD_TYPE variable in my CmakeLists.txt and I found out that it is actually empty in Visual...
Read more >vscode-cmake-tools/support - Gitter
"Unable to determine what CMake generator to use. Please install or configure a preferred generator, or update settings.json or your Kit configuration." I...
Read more >CMake and the Default Build Type - Kitware Inc.
It will now default to using a debug build if the source directory is a git clone, or a release build if not....
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
I see a mispelling in your preferredGenerators setting from your response. Can you confirm which generator is actually being selected? CMAKE_BUILD_TYPE is not set when Visual Studio is the generator because it generates a project with all build types. Ninja will set the CMAKE_BUILD_TYPE because it only generates one build type per variant.
Glad to hear it’s working now!