MantisBT - CMake
View Issue Details
0012226CMakeCMakepublic2011-05-25 17:582016-06-10 14:31
Mikhail Titov 
Kitware Robot 
normalminoralways
closedmoved 
WindowsWindows XP SP3
CMake 2.8.4 
 
0012226: Case inconsistency between CMAKE_BUILD_TYPE and CMAKE_DEBUG_POSTFIX and alike. Inability to retrieve active postfix.
While default build type is Debug, postfix should be specified using DEBUG configuration name. There is no effect if CMAKE_Debug_POSTFIX is used with default configuration settings.

This results in the necessity to specify explicitly build type as DEBUG for ${CMAKE_${CMAKE_BUILD_TYPE}_POSTFIX} to work. This kind of constructions is necessary to retrieve active postfix that can be used with gendef tool to generate symbol table in custom command.
if (MSVC80)
set (CMAKE_DEBUG_POSTFIX "-vc80-d")
set (CMAKE_RELEASE_POSTFIX "-vc80")
set(EXTRA "MSVC_Net2005")
elseif (MSVC90)
set (CMAKE_DEBUG_POSTFIX "-vc90-d")
set (CMAKE_RELEASE_POSTFIX "-vc90")
set(EXTRA "MSVC_Net2008")
elseif (MSVC10)
set (CMAKE_DEBUG_POSTFIX "-vc100-d")
set (CMAKE_RELEASE_POSTFIX "-vc100")
set(EXTRA "MSVC_Net2010")
endif (MSVC80)

set(POSTFIX ${CMAKE_${CMAKE_BUILD_TYPE}_POSTFIX})
message("Postfix is ${POSTFIX}")

Will result in an empty POSTFIX, though correct postfix is applied. If we replace DEBUG to Debug everywhere, no postfix will be applied for default build.
By default build I mean something like cmake ..
No tags attached.
Issue History
2011-05-25 17:58Mikhail TitovNew Issue
2011-05-26 01:12Michael WildNote Added: 0026611
2011-05-26 13:54Mikhail TitovNote Added: 0026625
2012-08-11 11:09David ColeStatusnew => backlog
2012-08-11 11:09David ColeNote Added: 0030259
2016-06-10 14:28Kitware RobotNote Added: 0041842
2016-06-10 14:28Kitware RobotStatusbacklog => resolved
2016-06-10 14:28Kitware RobotResolutionopen => moved
2016-06-10 14:28Kitware RobotAssigned To => Kitware Robot
2016-06-10 14:31Kitware RobotStatusresolved => closed

Notes
(0026611)
Michael Wild   
2011-05-26 01:12   
In your build systems it usually is a bad idea to use the variable CMAKE_BUILD_TYPE, because for multi-config IDE's (such as Xcode or Visual Studio) it is undefined. Also, something simple as

string(TOUPPER ${CMAKE_BUILD_TYPE} UPPER_BUILD_TYPE)

will give you an upper-cased string.
(0026625)
Mikhail Titov   
2011-05-26 13:54   
Thanks for that tip!
Indeed I'm just using nmake/jom since I'm adopting 3rd party libraries to CMake. But what would be a general solution that will work with IDEs as well? I need full target name to supply to gendef tool.
(0030259)
David Cole   
2012-08-11 11:09   
Sending old, never assigned issues to the backlog.

(The age of the bug, plus the fact that it's never been assigned to anyone means that nobody is actively working on it...)

If an issue you care about is sent to the backlog when you feel it should have been addressed in a different manner, please bring it up on the CMake mailing list for discussion. Sign up for the mailing list here, if you're not already on it: http://www.cmake.org/mailman/listinfo/cmake [^]

It's easy to re-activate a bug here if you can find a CMake developer who has the bandwidth to take it on, and ferry a fix through to our 'next' branch for dashboard testing.
(0041842)
Kitware Robot   
2016-06-10 14:28   
Resolving issue as `moved`.

This issue tracker is no longer used. Further discussion of this issue may take place in the current CMake Issues page linked in the banner at the top of this page.