[CMake] Visual Studio: release builds with "Generate Debug Info" enabled

Tyler Roscoe tyler at cryptio.net
Tue Jun 2 15:54:25 EDT 2009


We build the Release versions of our libraries with Debug info enabled.

In Visual Studio, you enable this by setting
Properties->Linker->Debugging->Generate Debug Info to Yes.

All this really does is add /DEBUG to the link flags for the library.

So I added "/DEBUG" to the LINK_FLAGS_RELEASE property for that library.
This does the right thing, and objdump verifies that the libraries are
generated correctly.

The trouble is that setting this flag doesn't update the dropdown box in
Properties->Linker->Debugging. Some diffing shows that selecting Yes in
the dropdown sets a flag in the .vcproj,
GenerateDebugInformation="true".

Is there a way to set this flag from CMake? A developer could get
confused and think debug info is not being generated even though it
really is.

Maybe the VS Generator could change the GenerateDebugInformation flag if
/DEBUG is present in the link flags?

Thanks,
tyler


More information about the CMake mailing list