CMake/Tests/MathTest/CMakeLists.txt

30 lines
620 B
CMake
Raw Normal View History

2008-03-25 18:27:18 +03:00
cmake_minimum_required (VERSION 2.6)
project(MathTest)
2005-10-18 00:39:58 +04:00
# Expression test
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
)
set(FILE_EXPRESSIONS "")
foreach(expression
2005-10-18 00:39:58 +04:00
${expressions})
math(EXPR expr "${expression}")
set(FILE_EXPRESSIONS "${FILE_EXPRESSIONS}TEST_EXPRESSION(${expression}, ${expr})\n")
endforeach()
2005-10-18 00:39:58 +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)
include_directories("${CMAKE_CURRENT_BINARY_DIR}")
add_executable(MathTest MathTestExec.cxx)
2005-10-18 00:39:58 +04:00