[CMake] any arithmetic expansion?

Tristan Carel tristan.carel at gmail.com
Fri Oct 27 04:35:50 EDT 2006


Hi,

Does CMake performs arithmetic expansion?
Do we have to use an external tool? (like bc, or expr)

I don't find anything about it on the bug tracker.

I would be fantastic to be able to write something like this:
SET(Foo 2)
SET(Bar $EVAL{0x101000 + ${Foo}})

To avoid complexity growth of the parser but still be
platform-independant, maybe you could add a command available with
CMake -E.
==> CMAKE -E EVAL "0x101000 + ${Foo}"

The worst case would be a module FindBc.cmake which provides a macro Bc_EVAL

my 2 cents.
-- 
Tristan Carel
http://tristan-carel.com
It's sometimes harsh to remember how to fall asleep.


More information about the CMake mailing list