summaryrefslogtreecommitdiffstats
path: root/Tests/FindMatlab/basic_checks
diff options
context:
space:
mode:
authorRaffi Enficiaud <raffi.enficiaud@tuebingen.mpg.de>2015-02-12 16:13:31 (GMT)
committerBrad King <brad.king@kitware.com>2015-03-17 13:47:04 (GMT)
commit49c8dcf7bb8ae9e7584286e552769a61bf23e61b (patch)
tree5f87e1b1974d15a6b23babdc730b321dde1c7f44 /Tests/FindMatlab/basic_checks
parent6390d5f5cb107dcc4a0bc6124ab5f17370dcadcd (diff)
downloadCMake-49c8dcf7bb8ae9e7584286e552769a61bf23e61b.zip
CMake-49c8dcf7bb8ae9e7584286e552769a61bf23e61b.tar.gz
CMake-49c8dcf7bb8ae9e7584286e552769a61bf23e61b.tar.bz2
FindMatlab: Rewrite module and provide a usage API
Implement a brand new FindMatlab module: - Add support for versions and components. - Find Matlab and its version in a more precise and multiplatform way. - Add API to create a new mex extension with documentation. - Add API to add matlab unit tests (with or without the unit test framework). - Find as much as possible based on a single Matlab_ROOT_DIR cache entry and allow the user to change it to re-find everything.
Diffstat (limited to 'Tests/FindMatlab/basic_checks')
-rw-r--r--Tests/FindMatlab/basic_checks/CMakeLists.txt57
1 files changed, 57 insertions, 0 deletions
diff --git a/Tests/FindMatlab/basic_checks/CMakeLists.txt b/Tests/FindMatlab/basic_checks/CMakeLists.txt
new file mode 100644
index 0000000..acf71ea
--- /dev/null
+++ b/Tests/FindMatlab/basic_checks/CMakeLists.txt
@@ -0,0 +1,57 @@
+
+cmake_minimum_required (VERSION 2.8.12)
+enable_testing()
+project(basic_checks)
+
+set(MATLAB_FIND_DEBUG TRUE)
+
+# the success of the following command is dependent on the current configuration:
+# - on 32bits builds (cmake is building with 32 bits), it looks for 32 bits Matlab
+# - on 64bits builds (cmake is building with 64 bits), it looks for 64 bits Matlab
+find_package(Matlab REQUIRED COMPONENTS MX_LIBRARY MAIN_PROGRAM)
+
+
+
+matlab_add_mex(
+ # target name
+ NAME cmake_matlab_test_wrapper1
+ # output name
+ OUTPUT_NAME cmake_matlab_mex1
+ SRC ${CMAKE_CURRENT_SOURCE_DIR}/../matlab_wrapper1.cpp
+ DOCUMENTATION ${CMAKE_CURRENT_SOURCE_DIR}/../help_text1.m.txt
+ )
+
+
+matlab_add_unit_test(
+ NAME ${PROJECT_NAME}_matlabtest-1
+ TIMEOUT 30
+ UNITTEST_FILE ${CMAKE_CURRENT_SOURCE_DIR}/../cmake_matlab_unit_tests1.m
+ ADDITIONAL_PATH $<TARGET_FILE_DIR:cmake_matlab_test_wrapper1>
+ )
+
+matlab_add_unit_test(
+ NAME ${PROJECT_NAME}_matlabtest-2
+ TIMEOUT 15
+ UNITTEST_FILE ${CMAKE_CURRENT_SOURCE_DIR}/../cmake_matlab_unit_tests_timeout.m
+ ADDITIONAL_PATH $<TARGET_FILE_DIR:cmake_matlab_test_wrapper1>
+ )
+set_tests_properties(${PROJECT_NAME}_matlabtest-2 PROPERTIES WILL_FAIL TRUE)
+
+
+# testing the test without the unittest framework of Matlab
+matlab_add_unit_test(
+ NAME ${PROJECT_NAME}_matlabtest-3
+ TIMEOUT 30
+ NO_UNITTEST_FRAMEWORK
+ UNITTEST_FILE ${CMAKE_CURRENT_SOURCE_DIR}/../cmake_matlab_unit_tests2.m
+ ADDITIONAL_PATH $<TARGET_FILE_DIR:cmake_matlab_test_wrapper1>
+ )
+
+matlab_add_unit_test(
+ NAME ${PROJECT_NAME}_matlabtest-4
+ TIMEOUT 30
+ NO_UNITTEST_FRAMEWORK
+ UNITTEST_FILE ${CMAKE_CURRENT_SOURCE_DIR}/../cmake_matlab_unit_tests3.m
+ ADDITIONAL_PATH $<TARGET_FILE_DIR:cmake_matlab_test_wrapper1>
+ )
+set_tests_properties(${PROJECT_NAME}_matlabtest-4 PROPERTIES WILL_FAIL TRUE)