[CMake] Is add_definitions() still recommended?

Robert Dailey rcdailey.lists at gmail.com
Fri Jul 24 10:56:55 EDT 2015


Starting with CMake 3.1, and going forward, is add_definitions() still
recommended if you have preprocessor definitions you want included in
all projects? The evolution of CMake appears to discourage setting
global state in favor of relying more on target properties (for
includes, definitions, and more).

This usually requires me to create a wrapper function I use in all
CMake scripts to generate targets, so it will handle setup common to
all projects. Sometimes it's just easier to set global state.

What's the desired design and structure intended going forward?


More information about the CMake mailing list