<div dir="ltr">What is considered best practice for (re)defining build-type compiler<div>options for a project, especially one that may find itself as a subproject</div><div>of something larger?</div><div><br></div><div>To be concrete, say for Debug I want the project to use a set of warn/check</div><div>options.  Should I set (or add to) CMAKE_C_FLAGS_DEBUG, and if so</div><div>should I use the CACHE FORCE options to get it into the cache? (I don't</div><div>have a good feel for the implications.)  Or is it better to append to</div><div>CMAKE_C_FLAGS?  I observe that the value of the latter precedes the</div><div>value of the build-type variables on the compile line, and so it can't override</div><div>those defaults.  Or is some other way best?</div><div><br></div><div>Also, say there was a compiler flag that was absolutely required.  Where</div><div>to add it so that it didn't get overridden by anything coming in through</div><div>either CMAKE_C_FLAGS or the build-type specific variables?</div><div><br></div><div>Thanks</div></div>