summaryrefslogtreecommitdiffstats
path: root/Tests
diff options
context:
space:
mode:
authorBrad King <brad.king@kitware.com>2019-07-01 13:52:32 (GMT)
committerKitware Robot <kwrobot@kitware.com>2019-07-01 13:52:44 (GMT)
commitdd433c98e4297cc4b7bfeaa510f4c2cc84ea9da4 (patch)
tree52c5544b0ed4b2f621906257c97921849dc02726 /Tests
parent1892bf2d65062ce45092990b8226bd8cd36752fa (diff)
parent11e0009b7721262a0eb772fe45abb38ef19bf7b4 (diff)
downloadCMake-dd433c98e4297cc4b7bfeaa510f4c2cc84ea9da4.zip
CMake-dd433c98e4297cc4b7bfeaa510f4c2cc84ea9da4.tar.gz
CMake-dd433c98e4297cc4b7bfeaa510f4c2cc84ea9da4.tar.bz2
Merge topic 'FindMatlab-EXCLUDE_FROM_ALL'
11e0009b77 FindMatlab: EXCLUDE_FROM_ALL parameter to matlab_add_mex Acked-by: Kitware Robot <kwrobot@kitware.com> Merge-request: !3474
Diffstat (limited to 'Tests')
-rw-r--r--Tests/FindMatlab/basic_checks/CMakeLists.txt12
-rw-r--r--Tests/FindMatlab/matlab_wrapper_failure.cpp13
2 files changed, 25 insertions, 0 deletions
diff --git a/Tests/FindMatlab/basic_checks/CMakeLists.txt b/Tests/FindMatlab/basic_checks/CMakeLists.txt
index c5be1ea..c0c752a 100644
--- a/Tests/FindMatlab/basic_checks/CMakeLists.txt
+++ b/Tests/FindMatlab/basic_checks/CMakeLists.txt
@@ -71,3 +71,15 @@ if(RUN_UNIT_TESTS)
)
set_tests_properties(${PROJECT_NAME}_matlabtest-4 PROPERTIES WILL_FAIL TRUE)
endif()
+
+
+# checking correct flags passed
+# EXCLUDE_FROM_ALL appears after a multiargs (like SRC)
+matlab_add_mex(
+ # target name
+ NAME cmake_matlab_test_exclude_from_all
+ # output name
+ OUTPUT_NAME cmake_matlab_mex_dummy
+ SRC ${CMAKE_CURRENT_SOURCE_DIR}/../matlab_wrapper_failure.cpp
+ EXCLUDE_FROM_ALL
+ )
diff --git a/Tests/FindMatlab/matlab_wrapper_failure.cpp b/Tests/FindMatlab/matlab_wrapper_failure.cpp
new file mode 100644
index 0000000..3fe437b
--- /dev/null
+++ b/Tests/FindMatlab/matlab_wrapper_failure.cpp
@@ -0,0 +1,13 @@
+// This should not link, as the mex function is missing.
+// This is mostly for checking we are passing the right arguments to the
+// add_library
+
+#include <algorithm>
+
+#include "mex.h"
+
+void mexFunctionXX(const int nlhs, mxArray* plhs[], const int nrhs,
+ const mxArray* prhs[])
+{
+ mexErrMsgTxt("Should not be running");
+}