2012-01-03 21:48:12 +08:00
# ===================================================================================
# The OpenCV CMake configuration file
#
# ** File generated automatically, do not modify **
#
# Usage from an external project:
# In your CMakeLists.txt, add these lines:
#
2013-11-19 22:58:33 +08:00
# find_package(OpenCV REQUIRED)
2013-11-19 23:00:56 +08:00
# include_directories(${OpenCV_INCLUDE_DIRS})
2013-11-19 22:58:33 +08:00
# target_link_libraries(MY_TARGET_NAME ${OpenCV_LIBS})
2012-01-03 21:48:12 +08:00
#
2012-02-03 19:26:49 +08:00
# Or you can search for specific OpenCV modules:
#
2014-07-10 22:27:32 +08:00
# find_package(OpenCV REQUIRED core videoio)
2012-02-03 19:26:49 +08:00
#
2012-02-20 05:30:13 +08:00
# If the module is found then OPENCV_<MODULE>_FOUND is set to TRUE.
2012-02-03 19:26:49 +08:00
#
2012-01-03 21:48:12 +08:00
# This file will define the following variables:
2013-08-07 16:53:48 +08:00
# - OpenCV_LIBS : The list of all imported targets for OpenCV modules.
2012-02-03 19:26:49 +08:00
# - OpenCV_INCLUDE_DIRS : The OpenCV include directories.
2014-03-05 13:57:16 +08:00
# - OpenCV_COMPUTE_CAPABILITIES : The version of compute capability.
# - OpenCV_ANDROID_NATIVE_API_LEVEL : Minimum required level of Android API.
2013-09-12 20:37:30 +08:00
# - OpenCV_VERSION : The version of this OpenCV build: "@OPENCV_VERSION_PLAIN@"
2013-01-18 18:57:55 +08:00
# - OpenCV_VERSION_MAJOR : Major version part of OpenCV_VERSION: "@OPENCV_VERSION_MAJOR@"
# - OpenCV_VERSION_MINOR : Minor version part of OpenCV_VERSION: "@OPENCV_VERSION_MINOR@"
# - OpenCV_VERSION_PATCH : Patch version part of OpenCV_VERSION: "@OPENCV_VERSION_PATCH@"
2013-09-12 20:37:30 +08:00
# - OpenCV_VERSION_STATUS : Development status of this build: "@OPENCV_VERSION_STATUS@"
2012-01-03 21:48:12 +08:00
#
# Advanced variables:
2014-03-05 13:57:16 +08:00
# - OpenCV_SHARED : Use OpenCV as shared library
# - OpenCV_CONFIG_PATH : Path to this OpenCVConfig.cmake
# - OpenCV_INSTALL_PATH : OpenCV location (not set on Windows)
# - OpenCV_LIB_COMPONENTS : Present OpenCV modules list
# - OpenCV_USE_MANGLED_PATHS : Mangled OpenCV path flag
# - OpenCV_MODULES_SUFFIX : The suffix for OpenCVModules-XXX.cmake file
2012-01-03 21:48:12 +08:00
#
2013-11-15 23:41:53 +08:00
# Deprecated variables:
# - OpenCV_VERSION_TWEAK : Always "0"
#
2012-02-20 05:30:13 +08:00
# ===================================================================================
2012-01-03 21:48:12 +08:00
2015-02-22 17:40:27 +08:00
# Search packages for host system instead of packages for target system.
# in case of cross compilation thess macro should be defined by toolchain file
if ( NOT COMMAND find_host_package )
macro ( find_host_package )
find_package ( ${ ARGN } )
endmacro ( )
endif ( )
if ( NOT COMMAND find_host_program )
macro ( find_host_program )
find_program ( ${ ARGN } )
endmacro ( )
endif ( )
2014-03-05 13:57:16 +08:00
if ( NOT DEFINED OpenCV_MODULES_SUFFIX )
if ( ANDROID )
string ( REPLACE - _ OpenCV_MODULES_SUFFIX "_${ANDROID_NDK_ABI_NAME}" )
else ( )
set ( OpenCV_MODULES_SUFFIX "" )
endif ( )
2013-10-25 00:01:29 +08:00
endif ( )
2013-08-07 16:53:48 +08:00
2014-10-28 16:46:18 +08:00
if ( "@USE_IPPICV@" STREQUAL "TRUE" ) # value is defined by package builder (use STREQUAL to comply new CMake policy CMP0012)
2014-05-06 23:14:20 +08:00
if ( NOT TARGET ippicv )
if ( EXISTS "${CMAKE_CURRENT_LIST_DIR}/@INSTALL_PATH_RELATIVE_IPPICV@" )
add_library ( ippicv STATIC IMPORTED )
set_target_properties ( ippicv PROPERTIES
I M P O R T E D _ L I N K _ I N T E R F A C E _ L I B R A R I E S " "
I M P O R T E D _ L O C A T I O N " $ { C M A K E _ C U R R E N T _ L I S T _ D I R } / @ I N S T A L L _ P A T H _ R E L A T I V E _ I P P I C V @ "
)
endif ( )
endif ( )
endif ( )
2013-11-14 18:45:42 +08:00
if ( NOT TARGET opencv_core )
2015-02-20 07:55:26 +08:00
# Extract directory name from full path of the file currently being processed.
# Note that CMake 2.8.3 introduced CMAKE_CURRENT_LIST_DIR. We reimplement it
# for older versions of CMake to support these as well.
if ( CMAKE_VERSION VERSION_LESS "2.8.3" )
get_filename_component ( CMAKE_CURRENT_LIST_DIR "${CMAKE_CURRENT_LIST_FILE}" PATH )
endif ( )
2014-03-05 13:57:16 +08:00
include ( ${ CMAKE_CURRENT_LIST_DIR } /OpenCVModules ${ OpenCV_MODULES_SUFFIX } .cmake )
2013-11-14 18:45:42 +08:00
endif ( )
2013-08-07 16:53:48 +08:00
# TODO All things below should be reviewed. What is about of moving this code into related modules (special vars/hooks/files)
2012-02-03 19:26:49 +08:00
# Version Compute Capability from which OpenCV has been compiled is remembered
2012-02-20 05:30:13 +08:00
set ( OpenCV_COMPUTE_CAPABILITIES @OpenCV_CUDA_CC_CONFIGCMAKE@ )
2012-02-03 19:26:49 +08:00
2012-10-08 03:42:46 +08:00
set ( OpenCV_CUDA_VERSION @OpenCV_CUDA_VERSION@ )
2013-01-23 19:32:49 +08:00
set ( OpenCV_USE_CUBLAS @HAVE_CUBLAS@ )
set ( OpenCV_USE_CUFFT @HAVE_CUFFT@ )
set ( OpenCV_USE_NVCUVID @HAVE_NVCUVID@ )
2012-10-08 03:42:46 +08:00
2012-02-03 19:26:49 +08:00
# Android API level from which OpenCV has been compiled is remembered
2014-05-08 19:55:30 +08:00
if ( ANDROID )
set ( OpenCV_ANDROID_NATIVE_API_LEVEL @OpenCV_ANDROID_NATIVE_API_LEVEL_CONFIGCMAKE@ )
2014-05-13 15:37:21 +08:00
else ( )
2014-05-08 19:55:30 +08:00
set ( OpenCV_ANDROID_NATIVE_API_LEVEL 0 )
endif ( )
2012-01-03 21:48:12 +08:00
# Some additional settings are required if OpenCV is built as static libs
set ( OpenCV_SHARED @BUILD_SHARED_LIBS@ )
# Enables mangled install paths, that help with side by side installs
2012-02-20 05:30:13 +08:00
set ( OpenCV_USE_MANGLED_PATHS @OpenCV_USE_MANGLED_PATHS_CONFIGCMAKE@ )
2012-01-03 21:48:12 +08:00
# Extract the directory where *this* file has been installed (determined at cmake run-time)
2012-04-30 22:33:52 +08:00
get_filename_component ( OpenCV_CONFIG_PATH "${CMAKE_CURRENT_LIST_FILE}" PATH CACHE )
2014-05-08 19:55:30 +08:00
if ( NOT WIN32 OR ANDROID )
if ( ANDROID )
2012-06-27 21:52:29 +08:00
set ( OpenCV_INSTALL_PATH "${OpenCV_CONFIG_PATH}/../../.." )
else ( )
set ( OpenCV_INSTALL_PATH "${OpenCV_CONFIG_PATH}/../.." )
endif ( )
2012-04-30 22:33:52 +08:00
# Get the absolute path with no ../.. relative marks, to eliminate implicit linker warnings
if ( ${ CMAKE_MAJOR_VERSION } . ${ CMAKE_MINOR_VERSION } VERSION_LESS 2.8 )
2012-06-27 21:52:29 +08:00
get_filename_component ( OpenCV_INSTALL_PATH "${OpenCV_INSTALL_PATH}" ABSOLUTE )
2012-04-30 22:33:52 +08:00
else ( )
2012-06-27 21:52:29 +08:00
get_filename_component ( OpenCV_INSTALL_PATH "${OpenCV_INSTALL_PATH}" REALPATH )
2012-04-30 22:33:52 +08:00
endif ( )
2012-03-28 18:38:50 +08:00
endif ( )
2012-01-03 21:48:12 +08:00
# ======================================================
# Include directories to add to the user project:
# ======================================================
# Provide the include directories to the caller
2012-02-20 05:30:13 +08:00
set ( OpenCV_INCLUDE_DIRS @OpenCV_INCLUDE_DIRS_CONFIGCMAKE@ )
2012-01-03 21:48:12 +08:00
# ======================================================
# Link directories to add to the user project:
# ======================================================
2012-02-03 19:26:49 +08:00
# Provide the libs directories to the caller
2012-04-30 22:33:52 +08:00
set ( OpenCV_LIB_DIR_OPT @OpenCV_LIB_DIRS_CONFIGCMAKE@ CACHE PATH "Path where release OpenCV libraries are located" )
set ( OpenCV_LIB_DIR_DBG @OpenCV_LIB_DIRS_CONFIGCMAKE@ CACHE PATH "Path where debug OpenCV libraries are located" )
2014-11-17 17:43:06 +08:00
set ( OpenCV_3RDPARTY_LIB_DIR_OPT @OpenCV_3RDPARTY_LIB_DIRS_CONFIGCMAKE@ CACHE PATH "Path where release 3rdparty OpenCV dependencies are located" )
set ( OpenCV_3RDPARTY_LIB_DIR_DBG @OpenCV_3RDPARTY_LIB_DIRS_CONFIGCMAKE@ CACHE PATH "Path where debug 3rdparty OpenCV dependencies are located" )
2012-04-30 22:33:52 +08:00
mark_as_advanced ( FORCE OpenCV_LIB_DIR_OPT OpenCV_LIB_DIR_DBG OpenCV_3RDPARTY_LIB_DIR_OPT OpenCV_3RDPARTY_LIB_DIR_DBG OpenCV_CONFIG_PATH )
2012-02-03 19:26:49 +08:00
# ======================================================
# Version variables:
# ======================================================
2013-09-12 20:37:30 +08:00
SET ( OpenCV_VERSION @OPENCV_VERSION_PLAIN@ )
2012-02-03 19:26:49 +08:00
SET ( OpenCV_VERSION_MAJOR @OPENCV_VERSION_MAJOR@ )
SET ( OpenCV_VERSION_MINOR @OPENCV_VERSION_MINOR@ )
SET ( OpenCV_VERSION_PATCH @OPENCV_VERSION_PATCH@ )
2013-11-15 23:41:53 +08:00
SET ( OpenCV_VERSION_TWEAK 0 )
2013-09-12 20:37:30 +08:00
SET ( OpenCV_VERSION_STATUS "@OPENCV_VERSION_STATUS@" )
2012-01-03 21:48:12 +08:00
# ====================================================================
2013-08-07 16:53:48 +08:00
# Link libraries: e.g. opencv_core;opencv_imgproc; etc...
2012-01-03 21:48:12 +08:00
# ====================================================================
2012-02-20 05:30:13 +08:00
SET ( OpenCV_LIB_COMPONENTS @OPENCV_MODULES_CONFIGCMAKE@ )
2014-08-01 22:11:20 +08:00
SET ( OpenCV_WORLD_COMPONENTS @OPENCV_WORLD_MODULES@ )
2012-02-03 19:26:49 +08:00
2012-02-06 19:30:59 +08:00
# ==============================================================
# Extra include directories, needed by OpenCV 2 new structure
# ==============================================================
2012-02-20 05:30:13 +08:00
SET ( OpenCV2_INCLUDE_DIRS @OpenCV2_INCLUDE_DIRS_CONFIGCMAKE@ )
2012-02-06 19:30:59 +08:00
if ( OpenCV2_INCLUDE_DIRS )
list ( APPEND OpenCV_INCLUDE_DIRS ${ OpenCV2_INCLUDE_DIRS } )
2012-02-20 05:30:13 +08:00
set ( OpenCV_ADD_DEBUG_RELEASE @OpenCV_ADD_DEBUG_RELEASE_CONFIGCMAKE@ )
if ( OpenCV_ADD_DEBUG_RELEASE )
2012-02-06 19:30:59 +08:00
set ( OpenCV_LIB_DIR_OPT "${OpenCV_LIB_DIR_OPT}/Release" )
set ( OpenCV_LIB_DIR_DBG "${OpenCV_LIB_DIR_DBG}/Debug" )
set ( OpenCV_3RDPARTY_LIB_DIR_OPT "${OpenCV_3RDPARTY_LIB_DIR_OPT}/Release" )
set ( OpenCV_3RDPARTY_LIB_DIR_DBG "${OpenCV_3RDPARTY_LIB_DIR_DBG}/Debug" )
endif ( )
endif ( )
2012-02-03 19:26:49 +08:00
# ==============================================================
# Check OpenCV availability
# ==============================================================
2012-02-09 23:02:21 +08:00
if ( ANDROID AND OpenCV_ANDROID_NATIVE_API_LEVEL GREATER ANDROID_NATIVE_API_LEVEL )
2012-02-03 19:26:49 +08:00
message ( FATAL_ERROR "Minimum required by OpenCV API level is android-${OpenCV_ANDROID_NATIVE_API_LEVEL}" )
#always FATAL_ERROR because we can't say to the caller that OpenCV is not found
#http://www.mail-archive.com/cmake@cmake.org/msg37831.html
if ( OpenCV_FIND_REQUIRED )
message ( FATAL_ERROR "Minimum required by OpenCV API level is android-${OpenCV_ANDROID_NATIVE_API_LEVEL}" )
elseif ( NOT OpenCV_FIND_QUIETLY )
message ( WARNING "Minimum required by OpenCV API level is android-${OpenCV_ANDROID_NATIVE_API_LEVEL}" )
endif ( )
set ( OpenCV_FOUND "OpenCV_FOUND-NOTFOUND" )
return ( ) #Android toolchain requires CMake > 2.6
2012-01-03 21:48:12 +08:00
endif ( )
2012-02-03 19:26:49 +08:00
# ==============================================================
# Form list of modules (components) to find
# ==============================================================
if ( NOT OpenCV_FIND_COMPONENTS )
2012-02-06 19:30:59 +08:00
set ( OpenCV_FIND_COMPONENTS ${ OpenCV_LIB_COMPONENTS } )
2013-02-27 16:41:33 +08:00
list ( REMOVE_ITEM OpenCV_FIND_COMPONENTS opencv_java )
2012-02-20 05:56:21 +08:00
if ( GTest_FOUND OR GTEST_FOUND )
list ( REMOVE_ITEM OpenCV_FIND_COMPONENTS opencv_ts )
endif ( )
2012-01-03 21:48:12 +08:00
endif ( )
2012-02-06 19:30:59 +08:00
# expand short module names and see if requested components exist
2012-02-03 19:26:49 +08:00
set ( OpenCV_FIND_COMPONENTS_ "" )
foreach ( __cvcomponent ${ OpenCV_FIND_COMPONENTS } )
if ( NOT __cvcomponent MATCHES "^opencv_" )
set ( __cvcomponent opencv_ ${ __cvcomponent } )
endif ( )
list ( FIND OpenCV_LIB_COMPONENTS ${ __cvcomponent } __cvcomponentIdx )
if ( __cvcomponentIdx LESS 0 )
2012-02-06 19:30:59 +08:00
#requested component is not found...
2012-02-03 19:26:49 +08:00
if ( OpenCV_FIND_REQUIRED )
message ( FATAL_ERROR "${__cvcomponent} is required but was not found" )
elseif ( NOT OpenCV_FIND_QUIETLY )
message ( WARNING "${__cvcomponent} is required but was not found" )
endif ( )
2012-02-06 19:30:59 +08:00
#indicate that module is NOT found
2014-08-01 22:11:20 +08:00
string ( TOUPPER "${__cvcomponent}" __cvcomponentUP )
set ( ${ __cvcomponentUP } _FOUND "${__cvcomponentUP}_FOUND-NOTFOUND" )
2012-02-03 19:26:49 +08:00
else ( )
list ( APPEND OpenCV_FIND_COMPONENTS_ ${ __cvcomponent } )
2013-11-19 22:36:58 +08:00
# Not using list(APPEND) here, because OpenCV_LIBS may not exist yet.
# Also not clearing OpenCV_LIBS anywhere, so that multiple calls
# to find_package(OpenCV) with different component lists add up.
set ( OpenCV_LIBS ${ OpenCV_LIBS } "${__cvcomponent}" )
2012-02-06 19:30:59 +08:00
#indicate that module is found
2014-08-01 22:11:20 +08:00
string ( TOUPPER "${__cvcomponent}" __cvcomponentUP )
set ( ${ __cvcomponentUP } _FOUND 1 )
endif ( )
if ( OpenCV_SHARED AND ";${OpenCV_WORLD_COMPONENTS};" MATCHES ";${__cvcomponent};" AND NOT TARGET ${ __cvcomponent } )
get_target_property ( __implib_dbg opencv_world IMPORTED_IMPLIB_DEBUG )
get_target_property ( __implib_release opencv_world IMPORTED_IMPLIB_RELEASE )
get_target_property ( __location_dbg opencv_world IMPORTED_LOCATION_DEBUG )
get_target_property ( __location_release opencv_world IMPORTED_LOCATION_RELEASE )
add_library ( ${ __cvcomponent } SHARED IMPORTED )
if ( __location_dbg )
set_property ( TARGET ${ __cvcomponent } APPEND PROPERTY IMPORTED_CONFIGURATIONS DEBUG )
set_target_properties ( ${ __cvcomponent } PROPERTIES
I M P O R T E D _ I M P L I B _ D E B U G " $ { _ _ i m p l i b _ d b g } "
I M P O R T E D _ L I N K _ I N T E R F A C E _ L I B R A R I E S _ D E B U G " "
I M P O R T E D _ L O C A T I O N _ D E B U G " $ { _ _ l o c a t i o n _ d b g } "
)
endif ( )
if ( __location_release )
set_property ( TARGET ${ __cvcomponent } APPEND PROPERTY IMPORTED_CONFIGURATIONS RELEASE )
set_target_properties ( ${ __cvcomponent } PROPERTIES
I M P O R T E D _ I M P L I B _ R E L E A S E " $ { _ _ i m p l i b _ r e l e a s e } "
I M P O R T E D _ L I N K _ I N T E R F A C E _ L I B R A R I E S _ R E L E A S E " "
I M P O R T E D _ L O C A T I O N _ R E L E A S E " $ { _ _ l o c a t i o n _ r e l e a s e } "
)
endif ( )
2012-02-03 19:26:49 +08:00
endif ( )
endforeach ( )
set ( OpenCV_FIND_COMPONENTS ${ OpenCV_FIND_COMPONENTS_ } )
# ==============================================================
# Resolve dependencies
# ==============================================================
2012-01-03 21:48:12 +08:00
if ( OpenCV_USE_MANGLED_PATHS )
2013-01-18 18:57:55 +08:00
set ( OpenCV_LIB_SUFFIX ".${OpenCV_VERSION_MAJOR}.${OpenCV_VERSION_MINOR}.${OpenCV_VERSION_PATCH}" )
2012-02-03 19:26:49 +08:00
else ( )
2012-02-06 19:30:59 +08:00
set ( OpenCV_LIB_SUFFIX "" )
2012-01-03 21:48:12 +08:00
endif ( )
2012-02-03 19:26:49 +08:00
foreach ( __opttype OPT DBG )
2013-08-07 16:53:48 +08:00
SET ( OpenCV_LIBS_ ${ __opttype } "${OpenCV_LIBS}" )
2012-02-03 19:26:49 +08:00
SET ( OpenCV_EXTRA_LIBS_ ${ __opttype } "" )
2013-02-14 19:06:52 +08:00
2013-01-23 19:32:49 +08:00
# CUDA
2014-03-27 03:26:21 +08:00
if ( OpenCV_CUDA_VERSION )
2012-10-08 03:42:46 +08:00
if ( NOT CUDA_FOUND )
2015-02-22 17:40:27 +08:00
find_host_package ( CUDA ${ OpenCV_CUDA_VERSION } EXACT REQUIRED )
2012-10-08 03:42:46 +08:00
else ( )
if ( NOT CUDA_VERSION_STRING VERSION_EQUAL OpenCV_CUDA_VERSION )
2013-02-14 19:06:52 +08:00
message ( FATAL_ERROR "OpenCV static library was compiled with CUDA ${OpenCV_CUDA_VERSION} support. Please, use the same version or rebuild OpenCV with CUDA ${CUDA_VERSION_STRING}" )
2012-10-08 03:42:46 +08:00
endif ( )
endif ( )
2014-03-27 03:26:21 +08:00
set ( OpenCV_CUDA_LIBS_ABSPATH ${ CUDA_LIBRARIES } )
2013-10-04 19:14:21 +08:00
if ( ${ CUDA_VERSION } VERSION_LESS "5.5" )
2014-03-27 03:26:21 +08:00
list ( APPEND OpenCV_CUDA_LIBS_ABSPATH ${ CUDA_npp_LIBRARY } )
2013-10-04 19:14:21 +08:00
else ( )
find_cuda_helper_libs ( nppc )
find_cuda_helper_libs ( nppi )
find_cuda_helper_libs ( npps )
2014-03-27 03:26:21 +08:00
list ( APPEND OpenCV_CUDA_LIBS_ABSPATH ${ CUDA_nppc_LIBRARY } ${ CUDA_nppi_LIBRARY } ${ CUDA_npps_LIBRARY } )
2013-10-04 19:14:21 +08:00
endif ( )
2012-10-08 03:42:46 +08:00
if ( OpenCV_USE_CUBLAS )
2014-03-27 03:26:21 +08:00
list ( APPEND OpenCV_CUDA_LIBS_ABSPATH ${ CUDA_CUBLAS_LIBRARIES } )
2012-10-08 03:42:46 +08:00
endif ( )
if ( OpenCV_USE_CUFFT )
2014-03-27 03:26:21 +08:00
list ( APPEND OpenCV_CUDA_LIBS_ABSPATH ${ CUDA_CUFFT_LIBRARIES } )
2012-10-08 03:42:46 +08:00
endif ( )
2013-01-23 19:32:49 +08:00
if ( OpenCV_USE_NVCUVID )
2014-03-27 03:26:21 +08:00
list ( APPEND OpenCV_CUDA_LIBS_ABSPATH ${ CUDA_nvcuvid_LIBRARIES } )
2013-01-23 19:32:49 +08:00
endif ( )
if ( WIN32 )
2014-03-27 03:26:21 +08:00
list ( APPEND OpenCV_CUDA_LIBS_ABSPATH ${ CUDA_nvcuvenc_LIBRARIES } )
2013-01-23 19:32:49 +08:00
endif ( )
2014-03-27 03:26:21 +08:00
set ( OpenCV_CUDA_LIBS_RELPATH "" )
foreach ( l ${ OpenCV_CUDA_LIBS_ABSPATH } )
get_filename_component ( _tmp ${ l } PATH )
2014-11-12 01:12:28 +08:00
if ( NOT ${ _tmp } MATCHES "-Wl.*" )
list ( APPEND OpenCV_CUDA_LIBS_RELPATH ${ _tmp } )
endif ( )
2014-03-27 03:26:21 +08:00
endforeach ( )
list ( REMOVE_DUPLICATES OpenCV_CUDA_LIBS_RELPATH )
link_directories ( ${ OpenCV_CUDA_LIBS_RELPATH } )
2012-10-08 03:42:46 +08:00
endif ( )
2012-02-03 19:26:49 +08:00
endforeach ( )
# ==============================================================
# Compatibility stuff
# ==============================================================
2012-02-10 04:22:36 +08:00
if ( CMAKE_BUILD_TYPE MATCHES "Debug" )
SET ( OpenCV_LIB_DIR ${ OpenCV_LIB_DIR_DBG } ${ OpenCV_3RDPARTY_LIB_DIR_DBG } )
else ( )
SET ( OpenCV_LIB_DIR ${ OpenCV_LIB_DIR_OPT } ${ OpenCV_3RDPARTY_LIB_DIR_OPT } )
endif ( )
2012-02-03 19:26:49 +08:00
set ( OpenCV_LIBRARIES ${ OpenCV_LIBS } )
2013-02-27 18:39:28 +08:00
if ( CMAKE_CROSSCOMPILING AND OpenCV_SHARED AND ( CMAKE_SYSTEM_NAME MATCHES "Linux" ) )
foreach ( dir ${ OpenCV_LIB_DIR } )
set ( CMAKE_EXE_LINKER_FLAGS "${CMAKE_EXE_LINKER_FLAGS} -Wl,-rpath-link,${dir}" )
set ( CMAKE_SHARED_LINKER_FLAGS "${CMAKE_SHARED_LINKER_FLAGS} -Wl,-rpath-link,${dir}" )
set ( CMAKE_MODULE_LINKER_FLAGS "${CMAKE_MODULE_LINKER_FLAGS} -Wl,-rpath-link,${dir}" )
endforeach ( )
endif ( )
2013-10-09 22:29:03 +08:00
#
# Some macroses for samples
#
macro ( ocv_check_dependencies )
set ( OCV_DEPENDENCIES_FOUND TRUE )
foreach ( d ${ ARGN } )
if ( NOT TARGET ${ d } )
2014-08-01 22:11:20 +08:00
message ( WARNING "OpenCV: Can't resolve dependency: ${d}" )
2013-10-09 22:29:03 +08:00
set ( OCV_DEPENDENCIES_FOUND FALSE )
break ( )
endif ( )
endforeach ( )
endmacro ( )
# adds include directories in such way that directories from the OpenCV source tree go first
function ( ocv_include_directories )
set ( __add_before "" )
2013-10-16 03:05:40 +08:00
file ( TO_CMAKE_PATH "${OpenCV_DIR}" __baseDir )
2013-10-09 22:29:03 +08:00
foreach ( dir ${ ARGN } )
get_filename_component ( __abs_dir "${dir}" ABSOLUTE )
2013-10-16 03:05:40 +08:00
if ( "${__abs_dir}" MATCHES "^${__baseDir}" )
2013-10-09 22:29:03 +08:00
list ( APPEND __add_before "${dir}" )
else ( )
include_directories ( AFTER SYSTEM "${dir}" )
endif ( )
endforeach ( )
include_directories ( BEFORE ${ __add_before } )
endfunction ( )
macro ( ocv_include_modules )
include_directories ( BEFORE "${OpenCV_INCLUDE_DIRS}" )
endmacro ( )
2015-04-10 16:37:16 +08:00
macro ( ocv_include_modules_recurse )
include_directories ( BEFORE "${OpenCV_INCLUDE_DIRS}" )
endmacro ( )
2014-08-01 22:11:20 +08:00
macro ( ocv_target_link_libraries )
target_link_libraries ( ${ ARGN } )
endmacro ( )
2013-10-09 22:29:03 +08:00
# remove all matching elements from the list
macro ( ocv_list_filterout lst regex )
foreach ( item ${ ${lst } } )
if ( item MATCHES "${regex}" )
list ( REMOVE_ITEM ${ lst } "${item}" )
endif ( )
endforeach ( )
endmacro ( )