CMake not honoring CMAKE_BUILD_TYPE definition (Debug only)
Description: When running CMake with a new build type using the "-DCMAKE_BUILD_TYPE" flag, the build type is not being updated between builds. Even though I am specifying "Release", CMake is still using the previously configured "Debug" build type. I have tried deleting the "build" directory and creating a new one, but this does not solve the problem.
Reproduction Steps:
Create a new CMake project with a simple CMakeLists.txt file. Configure the project using the "Debug" build type: "cmake -DCMAKE_BUILD_TYPE=Debug .." Build the project using "make" or another build system. Configure the project again with the "Release" build type: "cmake -DCMAKE_BUILD_TYPE=Release .." Build the project again using the same build system. Expected Result: The project should be built with the "Release" build type, as specified in the CMake command.
Actual Result: The project is built with the previously configured "Debug" build type, even though "Release" was specified in the most recent CMake command.
Environment Details:
Operating System: Windows 11 CMake Version: 3.24.202208181-MSVC_2 Build System: Make Error Messages: Manually-specified variables were not used by the project:
CMAKE_BUILD_TYPE
I hope this example helps! Let me know if you have any further questions or if there's anything else I can do to assist you.