[CMake] How to change (and account for) default Visual Studio compiler flags

Innokentiy Alaytsev alaitsev at gmail.com
Thu Jun 28 06:44:58 EDT 2018


Jason Heeris wrote
> On Thu., 28 Jun. 2018, 6:07 pm Innokentiy Alaytsev, <

> alaitsev@

> >
> wrote:
>> These flags are visible in cmake-gui
>> if you set (I don't know/remember the right word) the Advanced combo box
>> (setting Grouped will dramatically improve readability).
> 
> So after sending my last email I actually tried that; not only all of the
> flag sets visible in the GUI's advanced mode but all of the _INIT ones I
> could deduce the existence of. The compiler flags are *still* there. Where
> are they coming from?

Are you setting CMAKE_<...> variables before creating you targets of after
that?

Also, try to output the values for the CMAKE_<...> flags and of the
COMPILE_OPTIONS property of each target (i.e. "message ("CMAKE_<...>
${CMAKE_<...>}")") to see where the flags appear first. You may try to
perform experiments, e.g. create a target without setting any CMAKE_<...>
variables and output its properties, set CMAKE_<...> variables and then
create a target and output its properties, etc. This way you will understand
the consequences of different actions.



--
Sent from: http://cmake.3232098.n2.nabble.com/


More information about the CMake mailing list