[Cmake] Adding suffixes to debug/release builds

NTR niels_tr@hotmail.com
Wed, 29 Jan 2003 17:50:48 +0100


Hi,

this is a question that has been asked before, but I couldn't find the
answer.

---
it is good practice with libraries built with MSVC to give different builds
of the same library different filename suffixes. This eliminates the
possibility that the linker incorrectly finds and uses a wrong version of
the library. For example, the release build of the (well-known) MFC library
normally is named MFC42.DLL, but the debug build spells MFC42D.DLL.
Furthermore, the Unicode version of MFC has the name MFC42U.DLL, and the
debug build of the unicode version is named MFC42UD.DLL.

Is it possible to do this with CMake automatically? If not, would it be a
big hack to include this? (So far, I'm not familiar with the CMake source
tree.)

For some projects, other suffixes could be necessary (just imagine
graphlib_mmx.dll, graphlib_3dnow.dll, etc.)...
---

I guess this could be partially solved by changing the dsp templates.
However, it would be nice if a cross-platform solution existed so libraries
would have consistent naming.

Regards,
Niels

PS: The result could be something like for "foo" library
foo.lib
food.lib
foo.dll
food.dll
etc.