View Issue Details Jump to Notes ] Print ]
IDProjectCategoryView StatusDate SubmittedLast Update
0013393CMakeCMakepublic2012-07-11 10:292013-01-09 10:56
ReporterStephen Kelly 
Assigned ToBrad King 
PrioritynormalSeverityminorReproducibilityalways
StatusclosedResolutionfixed 
PlatformOSOS Version
Product Version 
Target VersionCMake 2.8.9Fixed in VersionCMake 2.8.9 
Summary0013393: if() behavior is different with macro parameters
DescriptionThe if(<variable>) signature always evaluates to false if <variable> is a macro parameter:

https://codereview.qt-project.org/#change,30630 [^]

This is not currently documented.

function() parameters already behave consistently with variables set with set().

This should be either documented or changed to match the behavior with regular variables.
TagsNo tags attached.
Attached Files

 Relationships

  Notes
(0030038)
Brad King (manager)
2012-07-11 10:35

The documentation of the macro() command:

 http://www.cmake.org/cmake/help/v2.8.8/cmake.html#command:macro [^]

explains how literal "${arg}" replacement is done before evaluation. It also explicitly states

 "parameters to a macro and values such as ARGN are not variables"
(0030039)
Stephen Kelly (developer)
2012-07-11 10:36

Ok. If that's not going to be changed, it might be worth also adding a note to the documentation of if(), which is where I looked for it.
(0030040)
Brad King (manager)
2012-07-11 10:46

Simple enough:

 http://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=674c56c3 [^]
(0032038)
Robert Maynard (manager)
2013-01-09 10:56

Closing resolved issues that have not been updated in more than 4 months.

 Issue History
Date Modified Username Field Change
2012-07-11 10:29 Stephen Kelly New Issue
2012-07-11 10:35 Brad King Note Added: 0030038
2012-07-11 10:36 Stephen Kelly Note Added: 0030039
2012-07-11 10:46 Brad King Note Added: 0030040
2012-07-11 10:46 Brad King Assigned To => Brad King
2012-07-11 10:46 Brad King Status new => resolved
2012-07-11 10:46 Brad King Resolution open => fixed
2012-07-11 10:46 Brad King Target Version => CMake 2.8.9
2012-07-11 10:46 Brad King Description Updated
2012-08-09 19:45 David Cole Fixed in Version => CMake 2.8.9
2013-01-09 10:56 Robert Maynard Note Added: 0032038
2013-01-09 10:56 Robert Maynard Status resolved => closed


Copyright © 2000 - 2018 MantisBT Team