ozgur ozgur - 1 year ago 285
C++ Question

Adding _CRT_SECURE_NO_WARNINGS definition using cmake

Is it possible to add

preprocessor definition using cmake?


These are what I've tried so far. None of these attempts were successful.

Answer Source

Use this:


See here for the official documentation.
The general form is:

add_definitions(-DFOO -DBAR ...)

Note that, if it's intended for a single target, you should rather use target_compile_definitions.

Recommended from our users: Dynamic Network Monitoring from WhatsUp Gold from IPSwitch. Free Download