CLion 2016.3 Help

Changing Configuration Types

When creating a run/debug configuration for your project in Run/Debug Configuration dialog box, you can choose one of the four default configuration types, provisioned by CMake:

  • Debug;
  • Release;
  • RelWithDebInfo;
  • MinSizeRel.

You can extend the list of available configuration types with your custom ones by setting them explicitly in CMakeLists.txt file.

To adjust the list of configuration types for a certain project, do the following:

  • in CMakeLists.txt file, specify CMAKE_CONFIGURATION_TYPES variable as in example below:
    cmake_minimum_required(VERSION 3.6) project(exampleProject) # variable CMAKE_CONGIGURATION_TYPES shall be defined prior to other definitions: set(CMAKE_CONFIGURATION_TYPES "CustomType1;CustomType2" CACHE STRING "" FORCE) # setting two custom # configuration types set(CMAKE_CXX_STANDARD 11) set(SOURCE_FILES main.cpp) add_executable(exampleProject ${SOURCE_FILES})

You can check the results in CMake Cache text file by pressing the /help/img/idea/2016.3/icon_config.png button of CMake tool window.

CMake generates the build configurations that are currently set in CMake settings dialog. You can change the build configuration type to be generated depending on the purpose of the build. For instance, you can select the Debug configuration type if you are planning to debug your project and then change it to Release when debugging is finished.

See Also

Last modified: 29 March 2017