diff options
Diffstat (limited to 'Tests/RunCMake/FindMatlab/MatlabTest1.cmake')
-rw-r--r-- | Tests/RunCMake/FindMatlab/MatlabTest1.cmake | 25 |
1 files changed, 25 insertions, 0 deletions
diff --git a/Tests/RunCMake/FindMatlab/MatlabTest1.cmake b/Tests/RunCMake/FindMatlab/MatlabTest1.cmake new file mode 100644 index 0000000..b4cc741 --- /dev/null +++ b/Tests/RunCMake/FindMatlab/MatlabTest1.cmake @@ -0,0 +1,25 @@ + +cmake_minimum_required (VERSION 2.8.12) +enable_testing() +project(test_should_fail) + +if(NOT "${matlab_root}" STREQUAL "") + set(Matlab_ROOT_DIR ${matlab_root}) +endif() +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> + ) |