<div><br></div>What is the preferred way to set global compiler flags? <div><br></div><div>I'd usually set this in CMAKE_CXX_FLAGS, but I'm building a cmake project that is not mine, so I don't have access to their CMakeLists.txt files. My first thought was to configure it in an initial cache file, but that disrupts the sequence of events that leads to platforms putting flags in CMAKE_CXX_FLAGS (in this case /DWIN32 in Windows-cl.cmake).</div>
<div><br></div><div>The one workaround I have at the moment is to define CMAKE_USER_MAKE_RULES_OVERRIDE and define CMAKE_CXX_FLAGS_INIT in there. It's an awkward place to have to set something as common as some global compiler flags though.</div>
<div><br></div><div>Regards,</div><div>Daniel.</div>