Cmake generator builds DEBUG version with CMAKE_BUILD_TYPE=Release
-
I am trying to build a project in DEBUG & RELEASE versions. I have set my build settings for cmake generator as follows:
I have custom INSTALL commands in my CMakeLists.txt file for both Release and Debug versions to pull relevant
.dll
files. When i generate and build DEBUG type it builds fine. Default path such aspath\DEPLOY\bin\Debug
is created andprojectd.exe
inside theDebug
folder.When i generate for Release mode, it creates a
Debug
folder exactly likepath\DEPLOY\bin\Debug
and on building i see, it pulls all thedebug versions of .dll
and creates aprojectd.exe
inside theDebug
folder.To cross check, i built my project with
Cmake-GUI
and build withVS 2015
everything works fine both in Debug and Release versions. So, nothing wrong with myCMakeLists.txt
.In my build output i could see this:
even when my
CMAKE_BUILD_TYPE=Release
It somehow still thinks configuration is set to
Debug
.PS: I recently updated my Qt Creator from 4.2 => 4.12.4 but i still need to use Qt SDK 5.7.1 (not allowed to change this) on Win 10.
-
This is a problem of msbuild - you have to pass the build configuration to msbuild via '/property:Configuration=Release'
-
@Christian-Ehrlicher and how do i do that? Can i set it in QtCreator? Or do i need to add it in some build step?