This is an automated email from the git hooks/post-receive script. It was
generated because a ref change was pushed to the repository containing
the project "CMake".

The branch, master has been updated
       via  dd433c98e4297cc4b7bfeaa510f4c2cc84ea9da4 (commit)
       via  11e0009b7721262a0eb772fe45abb38ef19bf7b4 (commit)
      from  1892bf2d65062ce45092990b8226bd8cd36752fa (commit)

Those revisions listed above that are new to this repository have
not appeared on any other notification email; so we list those
revisions in full, below.

- Log -----------------------------------------------------------------
https://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=dd433c98e4297cc4b7bfeaa510f4c2cc84ea9da4
commit dd433c98e4297cc4b7bfeaa510f4c2cc84ea9da4
Merge: 1892bf2 11e0009
Author:     Brad King <brad.k...@kitware.com>
AuthorDate: Mon Jul 1 13:52:32 2019 +0000
Commit:     Kitware Robot <kwro...@kitware.com>
CommitDate: Mon Jul 1 09:52:44 2019 -0400

    Merge topic 'FindMatlab-EXCLUDE_FROM_ALL'
    
    11e0009b77 FindMatlab: EXCLUDE_FROM_ALL parameter to matlab_add_mex
    
    Acked-by: Kitware Robot <kwro...@kitware.com>
    Merge-request: !3474


https://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=11e0009b7721262a0eb772fe45abb38ef19bf7b4
commit 11e0009b7721262a0eb772fe45abb38ef19bf7b4
Author:     Raffi Enficiaud <raffi.enfici...@mines-paris.org>
AuthorDate: Mon Jun 24 20:48:11 2019 +0200
Commit:     Raffi Enficiaud <raffi.enfici...@mines-paris.org>
CommitDate: Wed Jun 26 19:53:02 2019 +0200

    FindMatlab: EXCLUDE_FROM_ALL parameter to matlab_add_mex
    
    Enabling a mex target to be excluded from the `all` target.

diff --git a/Modules/FindMatlab.cmake b/Modules/FindMatlab.cmake
index 5138f2a..03f1500 100644
--- a/Modules/FindMatlab.cmake
+++ b/Modules/FindMatlab.cmake
@@ -889,6 +889,7 @@ endfunction()
          [DOCUMENTATION file.txt]
          [LINK_TO target1 target2 ...]
          [R2017b | R2018a]
+         [EXCLUDE_FROM_ALL]
          [...]
      )
 
@@ -918,6 +919,10 @@ endfunction()
   ``MODULE`` or ``SHARED`` may be given to specify the type of library to be
     created. ``EXECUTABLE`` may be given to create an executable instead of
     a library. If no type is given explicitly, the type is ``SHARED``.
+  ``EXCLUDE_FROM_ALL``
+    This option has the same meaning as for :prop_tgt:`EXCLUDE_FROM_ALL` and
+    is forwarded to :command:`add_library` or :command:`add_executable`
+    commands.
 
   The documentation file is not processed and should be in the following
   format:
@@ -944,7 +949,7 @@ function(matlab_add_mex)
 
   endif()
 
-  set(options EXECUTABLE MODULE SHARED R2017b R2018a)
+  set(options EXECUTABLE MODULE SHARED R2017b R2018a EXCLUDE_FROM_ALL)
   set(oneValueArgs NAME DOCUMENTATION OUTPUT_NAME)
   set(multiValueArgs LINK_TO SRC)
 
@@ -974,8 +979,14 @@ function(matlab_add_mex)
     endif()
   endif()
 
+  set(_option_EXCLUDE_FROM_ALL)
+  if(${prefix}_EXCLUDE_FROM_ALL)
+    set(_option_EXCLUDE_FROM_ALL "EXCLUDE_FROM_ALL")
+  endif()
+
   if(${prefix}_EXECUTABLE)
     add_executable(${${prefix}_NAME}
+      ${_option_EXCLUDE_FROM_ALL}
       ${${prefix}_SRC}
       ${MEX_VERSION_FILE}
       ${${prefix}_DOCUMENTATION}
@@ -989,6 +1000,7 @@ function(matlab_add_mex)
 
     add_library(${${prefix}_NAME}
       ${type}
+      ${_option_EXCLUDE_FROM_ALL}
       ${${prefix}_SRC}
       ${MEX_VERSION_FILE}
       ${${prefix}_DOCUMENTATION}
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");
+}

-----------------------------------------------------------------------

Summary of changes:
 Modules/FindMatlab.cmake                     | 14 +++++++++++++-
 Tests/FindMatlab/basic_checks/CMakeLists.txt | 12 ++++++++++++
 Tests/FindMatlab/matlab_wrapper_failure.cpp  | 13 +++++++++++++
 3 files changed, 38 insertions(+), 1 deletion(-)
 create mode 100644 Tests/FindMatlab/matlab_wrapper_failure.cpp


hooks/post-receive
-- 
CMake
_______________________________________________
Cmake-commits mailing list
Cmake-commits@cmake.org
https://cmake.org/mailman/listinfo/cmake-commits

Reply via email to