[CMake] CMAKE_DEBUG_POSTFIX not working on linux

Brad King brad.king at kitware.com
Wed Oct 20 17:14:37 EDT 2004


Philippe Fortier wrote:

> Hi everyone,
> 
> I have a library project created by cmake in which I use
> CMAKE_DEBUG_POSTFIX = "_d" to set the value of the library in debug. On
> Windows, with MSVC 7, it works fine, but the same project on linux, it
> does not generate the lib name with the extension. It's really annoying
> because other CMake projects links with this lib with the
> debug/optimized flag in it.... So all other projects does not find my
> library when linking in debug.

The UNIX Makefile generator does not yet implement the debug postfix 
setting simply because no one has contributed it and we have not yet had 
a need for it.  Since this generator supports only one configuration per 
build tree anyway, you should be able to specify different paths for the 
debug/optimized flag:

TARGET_LINK_LIBRARIES(... debug ${FOO_DEBUG_LIBRARY}
                           optimized ${FOO_RELEASE_LIBRARY})

Then just make sure the two variables are set to point to separate build 
trees of the original library in your outside project.

You may also report this limitation to the bug tracker:

http://www.cmake.org/Bug

-Brad



More information about the CMake mailing list