From 6683c20f22d38c654c5339f6b520bb1bd9b391e1 Mon Sep 17 00:00:00 2001 From: Jorrit Olthuis Date: Tue, 20 Dec 2022 18:56:34 +0100 Subject: FindMatlab: Add SYSTEM include flag for matlab_add_mex Add the `SYSTEM` flag for include directories provided by MATLAB, as the the pragmas used are not compatible with GCC and generate a warning. Fixes: #24166 --- Modules/FindMatlab.cmake | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Modules/FindMatlab.cmake b/Modules/FindMatlab.cmake index 07a9adf..fe8f198 100644 --- a/Modules/FindMatlab.cmake +++ b/Modules/FindMatlab.cmake @@ -1187,7 +1187,7 @@ function(matlab_add_mex) ${${prefix}_UNPARSED_ARGUMENTS}) endif() - target_include_directories(${${prefix}_NAME} PRIVATE ${Matlab_INCLUDE_DIRS}) + target_include_directories(${${prefix}_NAME} SYSTEM PRIVATE ${Matlab_INCLUDE_DIRS}) if(NOT ${prefix}_NO_IMPLICIT_LINK_TO_MATLAB_LIBRARIES) if(Matlab_HAS_CPP_API) -- cgit v0.12