diff options
author | Raffi Enficiaud <raffi.enficiaud@mines-paris.org> | 2017-04-29 18:31:58 (GMT) |
---|---|---|
committer | Brad King <brad.king@kitware.com> | 2018-04-23 14:30:49 (GMT) |
commit | 59fb9e89b2bd09a2edd5bbaecb01f43d6f3a2a7e (patch) | |
tree | 05897534fca0be23f67df31938a4c237a51f4c98 /Tests/FindMatlab/failure_reports | |
parent | ccd17a557cbf8ada18207a72eea78d2adcc9d752 (diff) | |
download | CMake-59fb9e89b2bd09a2edd5bbaecb01f43d6f3a2a7e.zip CMake-59fb9e89b2bd09a2edd5bbaecb01f43d6f3a2a7e.tar.gz CMake-59fb9e89b2bd09a2edd5bbaecb01f43d6f3a2a7e.tar.bz2 |
FindMatlab: Matlab Runtime Compiler support
* Determining automatically the MCR version on OSX and Windows
* Distinguishing between MCR and Matlab
* Specific tests for the MCR
* mexext on windows does not work properly: the mexext is hardcoded
* Doc updates for the MCR
Fixes: #16487
Diffstat (limited to 'Tests/FindMatlab/failure_reports')
-rw-r--r-- | Tests/FindMatlab/failure_reports/CMakeLists.txt | 55 |
1 files changed, 36 insertions, 19 deletions
diff --git a/Tests/FindMatlab/failure_reports/CMakeLists.txt b/Tests/FindMatlab/failure_reports/CMakeLists.txt index 1cf9613..e597a4a 100644 --- a/Tests/FindMatlab/failure_reports/CMakeLists.txt +++ b/Tests/FindMatlab/failure_reports/CMakeLists.txt @@ -7,7 +7,22 @@ project(failure_reports) set(MATLAB_FIND_DEBUG TRUE) -find_package(Matlab REQUIRED COMPONENTS MX_LIBRARY MAIN_PROGRAM) +if(IS_MCR) + set(components MX_LIBRARY) + set(RUN_UNIT_TESTS FALSE) +else() + set(RUN_UNIT_TESTS TRUE) + set(components MX_LIBRARY MAIN_PROGRAM) +endif() + +if(NOT "${MCR_ROOT}" STREQUAL "") + set(Matlab_ROOT_DIR "${MCR_ROOT}") + if(NOT EXISTS "${MCR_ROOT}") + message(FATAL_ERROR "MCR does not exist ${MCR_ROOT}") + endif() +endif() + +find_package(Matlab REQUIRED COMPONENTS ${components}) # main extensions for testing, same as other tests matlab_add_mex( @@ -19,21 +34,23 @@ matlab_add_mex( DOCUMENTATION ${CMAKE_CURRENT_SOURCE_DIR}/../help_text1.m.txt ) -# the unit test file does not exist: the failure should be properly reported -matlab_add_unit_test( - NAME ${PROJECT_NAME}_matlabtest-1 - TIMEOUT 300 - UNITTEST_FILE ${CMAKE_CURRENT_SOURCE_DIR}/../nonexistantfile.m - ADDITIONAL_PATH $<TARGET_FILE_DIR:cmake_matlab_test_wrapper1> - ) -set_tests_properties(${PROJECT_NAME}_matlabtest-1 PROPERTIES WILL_FAIL TRUE) - -# without the unit test framework -matlab_add_unit_test( - NAME ${PROJECT_NAME}_matlabtest-2 - TIMEOUT 300 - NO_UNITTEST_FRAMEWORK - UNITTEST_FILE ${CMAKE_CURRENT_SOURCE_DIR}/../nonexistantfile2.m - ADDITIONAL_PATH $<TARGET_FILE_DIR:cmake_matlab_test_wrapper1> - ) -set_tests_properties(${PROJECT_NAME}_matlabtest-2 PROPERTIES WILL_FAIL TRUE) +if(RUN_UNIT_TESTS) + # the unit test file does not exist: the failure should be properly reported + matlab_add_unit_test( + NAME ${PROJECT_NAME}_matlabtest-1 + TIMEOUT 300 + UNITTEST_FILE ${CMAKE_CURRENT_SOURCE_DIR}/../nonexistantfile.m + ADDITIONAL_PATH $<TARGET_FILE_DIR:cmake_matlab_test_wrapper1> + ) + set_tests_properties(${PROJECT_NAME}_matlabtest-1 PROPERTIES WILL_FAIL TRUE) + + # without the unit test framework + matlab_add_unit_test( + NAME ${PROJECT_NAME}_matlabtest-2 + TIMEOUT 300 + NO_UNITTEST_FRAMEWORK + UNITTEST_FILE ${CMAKE_CURRENT_SOURCE_DIR}/../nonexistantfile2.m + ADDITIONAL_PATH $<TARGET_FILE_DIR:cmake_matlab_test_wrapper1> + ) + set_tests_properties(${PROJECT_NAME}_matlabtest-2 PROPERTIES WILL_FAIL TRUE) +endif() |