From 9393a0c5bb942215f15ccb0c940c23b284f19b15 Mon Sep 17 00:00:00 2001 From: Alexander Alekhin Date: Thu, 14 Apr 2016 17:20:57 +0300 Subject: [PATCH] cmake: don't use -isystem for opencv_contrib paths --- cmake/OpenCVUtils.cmake | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/cmake/OpenCVUtils.cmake b/cmake/OpenCVUtils.cmake index 765ee7109..735b94f52 100644 --- a/cmake/OpenCVUtils.cmake +++ b/cmake/OpenCVUtils.cmake @@ -86,7 +86,9 @@ function(ocv_include_directories) set(__add_before "") foreach(dir ${ARGN}) get_filename_component(__abs_dir "${dir}" ABSOLUTE) - if("${__abs_dir}" MATCHES "^${OpenCV_SOURCE_DIR}" OR "${__abs_dir}" MATCHES "^${OpenCV_BINARY_DIR}") + if("${__abs_dir}" MATCHES "^${OpenCV_SOURCE_DIR}" + OR "${__abs_dir}" MATCHES "^${OpenCV_BINARY_DIR}" + OR (OPENCV_EXTRA_MODULES_PATH AND "${__abs_dir}" MATCHES "^${OPENCV_EXTRA_MODULES_PATH}")) list(APPEND __add_before "${dir}") else() include_directories(AFTER SYSTEM "${dir}") @@ -101,7 +103,9 @@ function(ocv_target_include_directories target) set(__params "") foreach(dir ${ARGN}) get_filename_component(__abs_dir "${dir}" ABSOLUTE) - if("${__abs_dir}" MATCHES "^${OpenCV_SOURCE_DIR}" OR "${__abs_dir}" MATCHES "^${OpenCV_BINARY_DIR}") + if("${__abs_dir}" MATCHES "^${OpenCV_SOURCE_DIR}" + OR "${__abs_dir}" MATCHES "^${OpenCV_BINARY_DIR}" + OR (OPENCV_EXTRA_MODULES_PATH AND "${__abs_dir}" MATCHES "^${OPENCV_EXTRA_MODULES_PATH}")) list(APPEND __params "${__abs_dir}") else() list(APPEND __params "${dir}")