cmake scripts are updated to prefer includes from the OpenCV source tree

This commit is contained in:
Andrey Kamaev
2012-03-03 15:49:23 +00:00
parent aeaae8b057
commit 18dbe6b3e5
29 changed files with 170 additions and 177 deletions

View File

@@ -11,6 +11,20 @@ if(NOT COMMAND find_host_program)
endmacro()
endif()
#added include directories in such way that directories from the OpenCV source tree go first
macro(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}")
list(APPEND __add_before "${dir}")
else()
include_directories(AFTER "${dir}")
endif()
endforeach()
include_directories(BEFORE ${__add_before})
endmacro()
# Provides an option that the user can optionally select.
# Can accept condition to control when option is available for user.