Skip to content
Projects
Groups
Snippets
Help
Loading...
Sign in / Register
Toggle navigation
O
opencv
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Packages
Packages
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
submodule
opencv
Commits
91e10a31
Commit
91e10a31
authored
Jan 04, 2018
by
Alexander Alekhin
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
cmake: ocv_target_include_directories() handle SYSTEM directories
parent
08086178
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
48 additions
and
12 deletions
+48
-12
OpenCVUtils.cmake
cmake/OpenCVUtils.cmake
+48
-12
No files found.
cmake/OpenCVUtils.cmake
View file @
91e10a31
...
...
@@ -171,28 +171,54 @@ function(ocv_target_include_directories target)
";
${
ARGN
}
;"
MATCHES
"/usr/include;"
)
return
()
# workaround for GCC 6.x bug
endif
()
set
(
__params
""
)
set
(
__system_params
""
)
set
(
__var_name __params
)
foreach
(
dir
${
ARGN
}
)
get_filename_component
(
__abs_dir
"
${
dir
}
"
ABSOLUTE
)
ocv_is_opencv_directory
(
__is_opencv_dir
"
${
dir
}
"
)
if
(
__is_opencv_dir
)
list
(
APPEND __params
"
${
__abs_dir
}
"
)
if
(
"
${
dir
}
"
STREQUAL
"SYSTEM"
)
set
(
__var_name __system_params
)
else
()
list
(
APPEND __params
"
${
dir
}
"
)
get_filename_component
(
__abs_dir
"
${
dir
}
"
ABSOLUTE
)
ocv_is_opencv_directory
(
__is_opencv_dir
"
${
dir
}
"
)
if
(
__is_opencv_dir
)
list
(
APPEND
${
__var_name
}
"
${
__abs_dir
}
"
)
else
()
list
(
APPEND
${
__var_name
}
"
${
dir
}
"
)
endif
()
endif
()
endforeach
()
if
(
HAVE_CUDA OR CMAKE_VERSION VERSION_LESS 2.8.11
)
include_directories
(
${
__params
}
)
include_directories
(
SYSTEM
${
__system_params
}
)
else
()
if
(
TARGET
${
target
}
)
target_include_directories
(
${
target
}
PRIVATE
${
__params
}
)
if
(
OPENCV_DEPENDANT_TARGETS_
${
target
}
)
foreach
(
t
${
OPENCV_DEPENDANT_TARGETS_
${
target
}}
)
target_include_directories
(
${
t
}
PRIVATE
${
__params
}
)
endforeach
()
if
(
__params
)
target_include_directories
(
${
target
}
PRIVATE
${
__params
}
)
if
(
OPENCV_DEPENDANT_TARGETS_
${
target
}
)
foreach
(
t
${
OPENCV_DEPENDANT_TARGETS_
${
target
}}
)
target_include_directories
(
${
t
}
PRIVATE
${
__params
}
)
endforeach
()
endif
()
endif
()
if
(
__system_params
)
target_include_directories
(
${
target
}
SYSTEM PRIVATE
${
__system_params
}
)
if
(
OPENCV_DEPENDANT_TARGETS_
${
target
}
)
foreach
(
t
${
OPENCV_DEPENDANT_TARGETS_
${
target
}}
)
target_include_directories
(
${
t
}
SYSTEM PRIVATE
${
__system_params
}
)
endforeach
()
endif
()
endif
()
else
()
set
(
__new_inc
"
${
OCV_TARGET_INCLUDE_DIRS_
${
target
}}
;
${
__params
}
"
)
set
(
OCV_TARGET_INCLUDE_DIRS_
${
target
}
"
${
__new_inc
}
"
CACHE INTERNAL
""
)
if
(
__params
)
set
(
__new_inc
${
OCV_TARGET_INCLUDE_DIRS_
${
target
}}
)
list
(
APPEND __new_inc
${
__params
}
)
set
(
OCV_TARGET_INCLUDE_DIRS_
${
target
}
"
${
__new_inc
}
"
CACHE INTERNAL
""
)
endif
()
if
(
__system_params
)
set
(
__new_inc
${
OCV_TARGET_INCLUDE_SYSTEM_DIRS_
${
target
}}
)
list
(
APPEND __new_inc
${
__system_params
}
)
set
(
OCV_TARGET_INCLUDE_SYSTEM_DIRS_
${
target
}
"
${
__new_inc
}
"
CACHE INTERNAL
""
)
endif
()
endif
()
endif
()
endfunction
()
...
...
@@ -1078,6 +1104,16 @@ function(_ocv_append_target_includes target)
endif
()
unset
(
OCV_TARGET_INCLUDE_DIRS_
${
target
}
CACHE
)
endif
()
if
(
DEFINED OCV_TARGET_INCLUDE_SYSTEM_DIRS_
${
target
}
)
target_include_directories
(
${
target
}
SYSTEM PRIVATE
${
OCV_TARGET_INCLUDE_SYSTEM_DIRS_
${
target
}}
)
if
(
OPENCV_DEPENDANT_TARGETS_
${
target
}
)
foreach
(
t
${
OPENCV_DEPENDANT_TARGETS_
${
target
}}
)
target_include_directories
(
${
t
}
SYSTEM PRIVATE
${
OCV_TARGET_INCLUDE_SYSTEM_DIRS_
${
target
}}
)
endforeach
()
endif
()
unset
(
OCV_TARGET_INCLUDE_SYSTEM_DIRS_
${
target
}
CACHE
)
endif
()
endfunction
()
function
(
ocv_add_executable target
)
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment