summaryrefslogtreecommitdiffstats
path: root/Tests/RunCMake/FindMatlab/MatlabTest1.cmake
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/RunCMake/FindMatlab/MatlabTest1.cmake
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/RunCMake/FindMatlab/MatlabTest1.cmake')
-rw-r--r--Tests/RunCMake/FindMatlab/MatlabTest1.cmake22
1 files changed, 22 insertions, 0 deletions
diff --git a/Tests/RunCMake/FindMatlab/MatlabTest1.cmake b/Tests/RunCMake/FindMatlab/MatlabTest1.cmake
new file mode 100644
index 0000000..1cbc1c2
--- /dev/null
+++ b/Tests/RunCMake/FindMatlab/MatlabTest1.cmake
@@ -0,0 +1,22 @@
+
+cmake_minimum_required (VERSION 2.8.12)
+enable_testing()
+project(test_should_fail)
+
+find_package(Matlab REQUIRED COMPONENTS MX_LIBRARY)
+
+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
+ )
+
+# this command should raise a FATAL_ERROR, component MAIN_PROGRAM is missing
+matlab_add_unit_test(
+ NAME ${PROJECT_NAME}_matlabtest-1
+ TIMEOUT 1
+ UNITTEST_FILE ${CMAKE_CURRENT_SOURCE_DIR}/cmake_matlab_unit_tests2.m
+ ADDITIONAL_PATH $<TARGET_FILE_DIR:cmake_matlab_test_wrapper1>
+ )