aboutsummaryrefslogtreecommitdiffhomepage
diff options
context:
space:
mode:
authorGravatar Gael Guennebaud <g.gael@free.fr>2009-02-04 17:11:04 +0000
committerGravatar Gael Guennebaud <g.gael@free.fr>2009-02-04 17:11:04 +0000
commit5e6707d7f7e7fcfca33d6e01440cacfe3e78cc83 (patch)
treee0204edfe31a117046542c3f8dd36e72b97b1668
parent5d69c5102b3026630cf8d2b614be1cf16872439e (diff)
forgot to add EigenTesting.cmake file
-rw-r--r--cmake/EigenTesting.cmake79
-rw-r--r--unsupported/README.txt10
2 files changed, 84 insertions, 5 deletions
diff --git a/cmake/EigenTesting.cmake b/cmake/EigenTesting.cmake
new file mode 100644
index 000000000..9799a08a7
--- /dev/null
+++ b/cmake/EigenTesting.cmake
@@ -0,0 +1,79 @@
+
+
+option(EIGEN_NO_ASSERTION_CHECKING "Disable checking of assertions" OFF)
+
+# similar to set_target_properties but append the property instead of overwriting it
+macro(ei_add_target_property target prop value)
+
+ get_target_property(previous ${target} ${prop})
+ set_target_properties(${target} PROPERTIES ${prop} "${previous} ${value}")
+
+endmacro(ei_add_target_property)
+
+# Macro to add a test
+#
+# the unique parameter testname must correspond to a file
+# <testname>.cpp which follows this pattern:
+#
+# #include "main.h"
+# void test_<testname>() { ... }
+#
+# this macro add an executable test_<testname> as well as a ctest test
+# named <testname>
+#
+# On platforms with bash simply run:
+# "ctest -V" or "ctest -V -R <testname>"
+# On other platform use ctest as usual
+#
+macro(ei_add_test testname)
+
+ set(targetname test_${testname})
+
+ set(filename ${testname}.cpp)
+ add_executable(${targetname} ${filename})
+
+ if(NOT EIGEN_NO_ASSERTION_CHECKING)
+
+ if(MSVC)
+ set_target_properties(${targetname} PROPERTIES COMPILE_FLAGS "/EHsc")
+ else(MSVC)
+ set_target_properties(${targetname} PROPERTIES COMPILE_FLAGS "-fexceptions")
+ endif(MSVC)
+
+ option(EIGEN_DEBUG_ASSERTS "Enable debuging of assertions" OFF)
+ if(EIGEN_DEBUG_ASSERTS)
+ set_target_properties(${targetname} PROPERTIES COMPILE_DEFINITIONS "-DEIGEN_DEBUG_ASSERTS=1")
+ endif(EIGEN_DEBUG_ASSERTS)
+
+ else(NOT EIGEN_NO_ASSERTION_CHECKING)
+
+ set_target_properties(${targetname} PROPERTIES COMPILE_DEFINITIONS "-DEIGEN_NO_ASSERTION_CHECKING=1")
+
+ endif(NOT EIGEN_NO_ASSERTION_CHECKING)
+
+ if(${ARGC} GREATER 1)
+ ei_add_target_property(${targetname} COMPILE_FLAGS "${ARGV1}")
+ endif(${ARGC} GREATER 1)
+
+ ei_add_target_property(${targetname} COMPILE_FLAGS "-DEIGEN_TEST_FUNC=${testname}")
+
+ if(TEST_LIB)
+ target_link_libraries(${targetname} Eigen2)
+ endif(TEST_LIB)
+
+ target_link_libraries(${targetname} ${EXTERNAL_LIBS})
+ if(${ARGC} GREATER 2)
+ string(STRIP "${ARGV2}" ARGV2_stripped)
+ string(LENGTH "${ARGV2_stripped}" ARGV2_stripped_length)
+ if(${ARGV2_stripped_length} GREATER 0)
+ target_link_libraries(${targetname} ${ARGV2})
+ endif(${ARGV2_stripped_length} GREATER 0)
+ endif(${ARGC} GREATER 2)
+
+ if(WIN32)
+ add_test(${testname} "${targetname}")
+ else(WIN32)
+ add_test(${testname} "${CMAKE_CURRENT_SOURCE_DIR}/runtest.sh" "${testname}")
+ endif(WIN32)
+
+endmacro(ei_add_test)
diff --git a/unsupported/README.txt b/unsupported/README.txt
index f265f3849..ed1341426 100644
--- a/unsupported/README.txt
+++ b/unsupported/README.txt
@@ -1,6 +1,6 @@
-This directory contains several contributions from various users. They are
-provided "as is", without any support. Nevertheless, they are subject to be
-included in Eigen in the future.
+This directory contains contributions from various users.
+They are provided "as is", without any support. Nevertheless,
+most of them are subject to be included in Eigen in the future.
In order to use an unsupported module you have to do either:
@@ -26,7 +26,7 @@ In doubt feel free to contact us. For instance, if your addons is very too speci
but it shows an interesting way of using Eigen, then it could be a nice demo.
-This diectory is organized as follow:
+This directory is organized as follow:
unsupported/Eigen/ModuleHeader1
unsupported/Eigen/ModuleHeader2
@@ -46,5 +46,5 @@ unsupported/doc/...
unsupported/test/.cpp <- unit test files
The documentation is generated at the same time than the main Eigen documentation.
-The .html files are generate in: build_dir/doc/html/unsupported/
+The .html files are generated in: build_dir/doc/html/unsupported/