Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Clion 2016.3: switch to "Release" configuration

Tags:

c++

cmake

clion

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?

like image 627
Felix Avatar asked Dec 13 '16 08:12

Felix


3 Answers

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).

like image 83
nastasiak2512 Avatar answered Oct 04 '22 03:10

nastasiak2512


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

like image 37
Laudian Avatar answered Oct 04 '22 02:10

Laudian


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.

like image 22
KeksArmee Avatar answered Oct 04 '22 04:10

KeksArmee