5

CMake has several build types like Release, Debug, Release with debug info and Minimum size release. I was wondering if another build types can be added like Profile by users and if it is a well-known practice done by other programmers.

Vertexwahn
  • 7,709
  • 6
  • 64
  • 90
mustafagonul
  • 1,139
  • 1
  • 15
  • 32

1 Answers1

2

You definitely can add your own build types. Here is the example of how to do it. Essentially, you just need to add all the variables like CMAKE_CXX_FLAGS_XXX with the suffix corresponding to your build type and of course update the CMAKE_BUILD_TYPE variable to account for the new type. Not sure how well-know this practice is(personally I never did it) but it certainly looks viable.

ixSci
  • 13,100
  • 5
  • 45
  • 79
  • You may also want to look at [this answer](http://stackoverflow.com/a/24470998/1938798) for how to actually define and use different build types. – Craig Scott Mar 03 '16 at 23:16