Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Get Qt Extensions
  • Unsolved
Collapse
Brand Logo
  1. Home
  2. Qt Development
  3. General and Desktop
  4. Cmake generator builds DEBUG version with CMAKE_BUILD_TYPE=Release
Forum Updated to NodeBB v4.3 + New Features

Cmake generator builds DEBUG version with CMAKE_BUILD_TYPE=Release

Scheduled Pinned Locked Moved Solved General and Desktop
4 Posts 2 Posters 1.5k Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • MarKSM Offline
    MarKSM Offline
    MarKS
    wrote on last edited by
    #1

    I am trying to build a project in DEBUG & RELEASE versions. I have set my build settings for cmake generator as follows:

    Annotation 2020-08-25 101817.png

    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 as path\DEPLOY\bin\Debug is created and projectd.exe inside the Debug folder.

    When i generate for Release mode, it creates a Debug folder exactly like path\DEPLOY\bin\Debug and on building i see, it pulls all the debug versions of .dll and creates a projectd.exe inside the Debug folder.

    To cross check, i built my project with Cmake-GUI and build with VS 2015 everything works fine both in Debug and Release versions. So, nothing wrong with my CMakeLists.txt.

    In my build output i could see this:

    Annotation 2020-08-25 101817.png

    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.

    1 Reply Last reply
    0
    • Christian EhrlicherC Offline
      Christian EhrlicherC Offline
      Christian Ehrlicher
      Lifetime Qt Champion
      wrote on last edited by
      #2

      This is a problem of msbuild - you have to pass the build configuration to msbuild via '/property:Configuration=Release'

      Qt Online Installer direct download: https://download.qt.io/official_releases/online_installers/
      Visit the Qt Academy at https://academy.qt.io/catalog

      MarKSM 1 Reply Last reply
      3
      • Christian EhrlicherC Christian Ehrlicher

        This is a problem of msbuild - you have to pass the build configuration to msbuild via '/property:Configuration=Release'

        MarKSM Offline
        MarKSM Offline
        MarKS
        wrote on last edited by
        #3

        @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?

        1 Reply Last reply
        0
        • MarKSM Offline
          MarKSM Offline
          MarKS
          wrote on last edited by
          #4

          Understood. I added /property:Configuration=Release in the Tool arguments of release build. Build arguments should look like this cmake.exe --build . --target install -- /property:Configuration=Release.

          1 Reply Last reply
          2

          • Login

          • Login or register to search.
          • First post
            Last post
          0
          • Categories
          • Recent
          • Tags
          • Popular
          • Users
          • Groups
          • Search
          • Get Qt Extensions
          • Unsolved