summaryrefslogtreecommitdiff
path: root/Tests/MathTest/CMakeLists.txt
blob: d1e5b1acd873870647e257ea5c0475ecf30dcde0 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
cmake_minimum_required (VERSION 2.6)
PROJECT(MathTest)


# Expression test

SET(expressions
  "5 * ( 3 + 4)"
  "(1 | 2 | 4 | 8) & 16"
  "1 +(3*4) + 10 >> 2"
  "10000 / 20 / 4"
  "10000 / (20 / 4)"
  )

SET(FILE_EXPRESSIONS "")
FOREACH(expression
    ${expressions})
  MATH(EXPR expr "${expression}")
  SET(FILE_EXPRESSIONS "${FILE_EXPRESSIONS}TEST_EXPRESSION(${expression}, ${expr})\n")
ENDFOREACH(expression)

CONFIGURE_FILE(
  "${CMAKE_CURRENT_SOURCE_DIR}/MathTestTests.h.in"
  "${CMAKE_CURRENT_BINARY_DIR}/MathTestTests.h"
  @ONLY)

INCLUDE_DIRECTORIES("${CMAKE_CURRENT_BINARY_DIR}")
ADD_EXECUTABLE(MathTest MathTestExec.cxx)