Custom Build Type

Is there a idiomatic way to provide a custom build type? For example, if I want to have Release flags plus march=native and mtune=native how should I go about doing this? Certainly, I could add them to CMAKE_CXX_FLAGS when I invoke cmake but the devs on my team would like to have them baked in to a BUILD_TYPE e.g. -D CMAKE_BUILD_TYPE=Optimized or something like that…

One of the free sample chapters of my book shows how to do this. You can find it here:

The free sample includes the whole Build Types chapter, which includes a section on custom build types. That section includes an example which does exactly what you’re asking about.

1 Like

Thanks - buying it now!