[cmake-developers] [CMake 0015380]: Optional arguments for macros are ignored by if()

Mantis Bug Tracker mantis at public.kitware.com
Wed Jan 28 10:27:53 EST 2015


The following issue has been SUBMITTED. 
====================================================================== 
http://www.cmake.org/Bug/view.php?id=15380 
====================================================================== 
Reported By:                Alina
Assigned To:                
====================================================================== 
Project:                    CMake
Issue ID:                   15380
Category:                   CMake
Reproducibility:            sometimes
Severity:                   minor
Priority:                   normal
Status:                     new
====================================================================== 
Date Submitted:             2015-01-28 10:27 EST
Last Modified:              2015-01-28 10:27 EST
====================================================================== 
Summary:                    Optional arguments for macros are ignored by if()
Description: 
The issue was reproduced also on CMake 3.0.2 on OS X Yosemite.

Documentation points to the following :
"In the first case you can use if(${ARGV1}), in the second case, you can use
foreach(loop_var ${ARGN}) but this will skip empty arguments. If you need to
include them, you can use:"
http://www.cmake.org/cmake/help/v3.0/command/macro.html

But if on any ARGVXXX is always false.

An simple example is attached.
====================================================================== 

Issue History 
Date Modified    Username       Field                    Change               
====================================================================== 
2015-01-28 10:27 Alina          New Issue                                    
2015-01-28 10:27 Alina          File Added: CMakeLists.txt                    
======================================================================



More information about the cmake-developers mailing list