[cmake-developers] [CMake 0015181]: math can't handle negative numbers.

Mantis Bug Tracker mantis at public.kitware.com
Tue Sep 30 13:18:37 EDT 2014


The following issue has been SUBMITTED. 
====================================================================== 
http://public.kitware.com/Bug/view.php?id=15181 
====================================================================== 
Reported By:                tron_thomas
Assigned To:                
====================================================================== 
Project:                    CMake
Issue ID:                   15181
Category:                   CMake
Reproducibility:            always
Severity:                   minor
Priority:                   normal
Status:                     new
====================================================================== 
Date Submitted:             2014-09-30 13:18 EDT
Last Modified:              2014-09-30 13:18 EDT
====================================================================== 
Summary:                    math can't handle negative numbers.
Description: 
The math command cannot do addition with negative numbers

Steps to Reproduce: 
Run CMake against the following CMakeLists.txt file:

cmake_minimum_required (VERSION 2.8)

project (MathFailure)

set (value -1)
math (EXPR value "${value} + 1")

Expected:
value should be incremented to zero

Actual:
CMake Error at CMakeLists.txt:6 (math):
  math cannot parse the expression: "-1 + 1": syntax error, unexpected
  exp_MINUS, expecting exp_OPENPARENT or exp_NUMBER (1)


====================================================================== 

Issue History 
Date Modified    Username       Field                    Change               
====================================================================== 
2014-09-30 13:18 tron_thomas    New Issue                                    
======================================================================



More information about the cmake-developers mailing list