41

I updated to clion 2016.3 recently and noticed that I cannot choose between different configuration types anymore. With 2016.2 I had the choice between "Debug", "Release", "MinSizeRel" and "RelWithDebInfo", but now the only available option is "Debug".

Am I doing something wrong? Do I have to edit CMakeLists.txt in order to get different configuration types back?

Felix
  • 6,131
  • 4
  • 24
  • 44

4 Answers4

57

CMake workflow changed in 2016.3. Read the linked blog post for details, but in a nutshell CLion no longer builds all 4 CMake configurations to save time and memory. You can configure the CMake configuration type in Settings | Build, Execution, Deployment | CMake.

However, understanding that some of the users really used this kind of switch quite often and don't want to change CMake settings (and thus wait for CMake reload) each time, we are going to introduce a reworked ability to add extra CMake configurations. This will be on air together with 2016.3.* update (but not 2016.3.1).

nastasiak2512
  • 1,857
  • 14
  • 14
  • The feature to add additionally CMake configurations will be part of the next release (2016.3.2). See this blog post for details: https://blog.jetbrains.com/clion/2016/12/clion-2016-3-2-eap/ – Felix Dec 15 '16 at 11:48
  • 2
    please update this comment with the up to date information. – xaxxon Apr 09 '17 at 04:56
  • The current behavior seems to require us to create the configuration manually, but I am not sure how to do this correctly and I couldn't find an easy way. https://www.jetbrains.com/help/clion/creating-and-editing-run-debug-configurations.html – gordonk Aug 22 '19 at 08:43
34

For newer versions: Go to File --> Settings --> Build, Execution, Deployment --> CMake. Now click the "+" symbol, this should automatically add a Release profile (and, if you press "+" again, a Release with Debug Information profile).

After this, you can switch between Release and Debug in the Configurations section in the top-right of the window.

Clion Configuration Switch

Code Abominator
  • 1,571
  • 18
  • 23
Laudian
  • 441
  • 4
  • 6
  • 2
    I don't see any button that would allow me to switch between Release and Debug in the top-right of the window. – CygnusX1 Aug 19 '20 at 06:58
  • @CygnusX1 I've added an image of what the menu looks like. – Laudian Aug 20 '20 at 07:18
  • Thank you, now I know what you mean and where the entries should appear. In my case there is only one, but apparently the cmake configuration fails for the other and that is the reason. – CygnusX1 Aug 20 '20 at 15:58
8

As of CLion 2017.2 you can edit idea/workspace.xml to restore the old workflow.

Add the Release configuration (<configuration CONFIG_NAME="Release" />) in the configurations block so it looks like this:

<component name="CMakeSettings">
  <configurations>
    <configuration CONFIG_NAME="Debug" />
    <configuration CONFIG_NAME="Release" />
  </configurations>
</component>

Now you can switch again.

KeksArmee
  • 1,349
  • 14
  • 21
  • Is this still the only way to achieve this? Is there no simpler way via the UI? What also bothers me is that I have to do this on a per project basis... – gordonk Aug 22 '19 at 08:46
-2

Give you a solution in cmake-gui: Please check the "CMAKE_CONFIGURATION_TYPES" option enter image description here

If not find the option,select the "Advanced" option. enter image description here

MD XF
  • 7,860
  • 7
  • 40
  • 71
Logan
  • 60
  • 2