2008-03-25 18:27:18 +03:00
|
|
|
cmake_minimum_required (VERSION 2.6)
|
2012-08-13 21:47:32 +04:00
|
|
|
project(MathTest)
|
2005-10-18 00:39:58 +04:00
|
|
|
|
|
|
|
|
|
|
|
# Expression test
|
|
|
|
|
2012-08-13 21:47:32 +04:00
|
|
|
set(expressions
|
2005-10-18 00:39:58 +04:00
|
|
|
"5 * ( 3 + 4)"
|
|
|
|
"(1 | 2 | 4 | 8) & 16"
|
2005-10-18 21:22:28 +04:00
|
|
|
"1 +(3*4) + 10 >> 2"
|
|
|
|
"10000 / 20 / 4"
|
|
|
|
"10000 / (20 / 4)"
|
2005-10-18 00:39:58 +04:00
|
|
|
)
|
|
|
|
|
2012-08-13 21:47:32 +04:00
|
|
|
set(FILE_EXPRESSIONS "")
|
|
|
|
foreach(expression
|
2005-10-18 00:39:58 +04:00
|
|
|
${expressions})
|
2012-08-13 21:47:32 +04:00
|
|
|
math(EXPR expr "${expression}")
|
2016-07-28 01:43:04 +03:00
|
|
|
string(APPEND FILE_EXPRESSIONS "TEST_EXPRESSION(${expression}, ${expr})\n")
|
2012-08-13 21:50:14 +04:00
|
|
|
endforeach()
|
2005-10-18 00:39:58 +04:00
|
|
|
|
2012-08-13 21:47:32 +04:00
|
|
|
configure_file(
|
2005-10-18 00:39:58 +04:00
|
|
|
"${CMAKE_CURRENT_SOURCE_DIR}/MathTestTests.h.in"
|
|
|
|
"${CMAKE_CURRENT_BINARY_DIR}/MathTestTests.h"
|
|
|
|
@ONLY)
|
|
|
|
|
2012-08-13 21:47:32 +04:00
|
|
|
include_directories("${CMAKE_CURRENT_BINARY_DIR}")
|
|
|
|
add_executable(MathTest MathTestExec.cxx)
|
2005-10-18 00:39:58 +04:00
|
|
|
|