[Cmake] Setting different compiler flags for Debug vs Release builds

Kevin Wright Kevin . Wright at ansys . com
Tue, 14 Oct 2003 17:32:34 -0400


> How do you set different compiler flags for Debug vs Release builds?=20
>=20
> For example, I need to set the "/MTd" (use multithreaded=20
> static debug C
> runtime library switch) for a debug build and "/MT" compiler=20
> flag for a
> release build.
>=20
> I've read through the documentation and examples, but CMAKE_CXX_FLAGS
> doesn't seem to support this and I can't find any other magic=20
> variables.=20

I don't know what version this started, but on 1.8 there are variables =
for
CMAKE_CXX_FLAGS_DEBUG CMAKE_CXX_FLAGS_RELEASE.  Are you using a =
different version?

Kevin.