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)
2015-06-17 19:44:11 +08:00
# include_directories(${OpenCV_INCLUDE_DIRS}) # Not needed for CMake >= 2.8.11
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
#
2016-11-20 21:36:34 +08:00
# You can also mark OpenCV components as optional:
# find_package(OpenCV REQUIRED core OPTIONAL_COMPONENTS viz)
#
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
2016-01-11 22:54:14 +08:00
# - OpenCV_INSTALL_PATH : OpenCV location
2014-03-05 13:57:16 +08:00
# - OpenCV_LIB_COMPONENTS : Present OpenCV modules list
# - OpenCV_USE_MANGLED_PATHS : Mangled OpenCV path flag
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
2016-01-11 22:54:14 +08:00
# ======================================================
# Version variables:
# ======================================================
SET ( OpenCV_VERSION @OPENCV_VERSION_PLAIN@ )
SET ( OpenCV_VERSION_MAJOR @OPENCV_VERSION_MAJOR@ )
SET ( OpenCV_VERSION_MINOR @OPENCV_VERSION_MINOR@ )
SET ( OpenCV_VERSION_PATCH @OPENCV_VERSION_PATCH@ )
SET ( OpenCV_VERSION_TWEAK 0 )
SET ( OpenCV_VERSION_STATUS "@OPENCV_VERSION_STATUS@" )
2016-11-20 21:36:34 +08:00
include ( FindPackageHandleStandardArgs )
if ( NOT CMAKE_VERSION VERSION_LESS 2.8.8
A N D O p e n C V _ F I N D _ C O M P O N E N T S # prevent excessive output
)
# HANDLE_COMPONENTS was introduced in CMake 2.8.8
list ( APPEND _OpenCV_FPHSA_ARGS HANDLE_COMPONENTS )
# The missing components will be handled by the FindPackageHandleStandardArgs
# module.
set ( _OpenCV_HANDLE_COMPONENTS_MANUALLY FALSE )
else ( )
# The missing components will be handled by this config.
set ( _OpenCV_HANDLE_COMPONENTS_MANUALLY TRUE )
endif ( )
2016-01-11 22:54:14 +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 ( )
# Extract the directory where *this* file has been installed (determined at cmake run-time)
# Get the absolute path with no ../.. relative marks, to eliminate implicit linker warnings
set ( OpenCV_CONFIG_PATH "${CMAKE_CURRENT_LIST_DIR}" )
get_filename_component ( OpenCV_INSTALL_PATH "${OpenCV_CONFIG_PATH}/@OpenCV_INSTALL_PATH_RELATIVE_CONFIGCMAKE@" REALPATH )
2015-02-22 17:40:27 +08:00
# Search packages for host system instead of packages for target system.
2018-02-07 19:59:15 +08:00
# in case of cross compilation this macro should be defined by toolchain file
2015-02-22 17:40:27 +08:00
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 ( )
2012-02-03 19:26:49 +08:00
2016-01-11 22:54:14 +08:00
@ C U D A _ C O N F I G C M A K E @
@ A N D R O I D _ C O N F I G C M A K E @
2012-10-08 03:42:46 +08:00
2016-01-11 22:54:14 +08:00
@ I P P I C V _ C O N F I G C M A K E @
2017-04-25 21:48:50 +08:00
@ I P P I W _ C O N F I G C M A K E @
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
2016-01-11 22:54:14 +08:00
set ( OpenCV_LIB_COMPONENTS @OPENCV_MODULES_CONFIGCMAKE@ )
2012-02-20 05:30:13 +08:00
set ( OpenCV_INCLUDE_DIRS @OpenCV_INCLUDE_DIRS_CONFIGCMAKE@ )
2012-01-03 21:48:12 +08:00
2016-01-11 22:54:14 +08:00
if ( NOT TARGET opencv_core )
include ( ${ CMAKE_CURRENT_LIST_DIR } /OpenCVModules ${ OpenCV_MODULES_SUFFIX } .cmake )
2012-02-06 19:30:59 +08:00
endif ( )
2015-06-17 19:44:11 +08:00
if ( NOT CMAKE_VERSION VERSION_LESS "2.8.11" )
# Target property INTERFACE_INCLUDE_DIRECTORIES available since 2.8.11:
# * http://www.cmake.org/cmake/help/v2.8.11/cmake.html#prop_tgt:INTERFACE_INCLUDE_DIRECTORIES
foreach ( __component ${ OpenCV_LIB_COMPONENTS } )
if ( TARGET ${ __component } )
set_target_properties (
$ { _ _ c o m p o n e n t }
P R O P E R T I E S
I N T E R F A C E _ I N C L U D E _ D I R E C T O R I E S " $ { O p e n C V _ I N C L U D E _ D I R S } "
)
endif ( )
endforeach ( )
endif ( )
2017-12-13 19:14:28 +08:00
if ( NOT DEFINED OPENCV_MAP_IMPORTED_CONFIG )
if ( CMAKE_GENERATOR MATCHES "Visual Studio" OR MSVC )
# OpenCV supports Debug and Release builds only.
# But MSVS has 'RelWithDebInfo' 'MinSizeRel' configurations for applications.
# By default CMake maps these configuration on the first available (Debug) which is wrong.
# Non-Debug build of Application can't be used with OpenCV Debug build (ABI mismatch problem)
# Add mapping of RelWithDebInfo and MinSizeRel to Release here
set ( OPENCV_MAP_IMPORTED_CONFIG "RELWITHDEBINFO=!Release;MINSIZEREL=!Release" )
endif ( )
endif ( )
set ( __remap_warnings "" )
macro ( ocv_map_imported_config target )
if ( DEFINED OPENCV_MAP_IMPORTED_CONFIG ) # list, "RELWITHDEBINFO=Release;MINSIZEREL=Release"
get_target_property ( __available_configurations ${ target } IMPORTED_CONFIGURATIONS )
foreach ( remap ${ OPENCV_MAP_IMPORTED_CONFIG } )
if ( remap MATCHES "^(.+)=(!?)([^!]+)$" )
set ( __remap_config "${CMAKE_MATCH_1}" )
set ( __final_config "${CMAKE_MATCH_3}" )
set ( __force_flag "${CMAKE_MATCH_2}" )
string ( TOUPPER "${__final_config}" __final_config_upper )
string ( TOUPPER "${__remap_config}" __remap_config_upper )
if ( ";${__available_configurations};" MATCHES ";${__remap_config_upper};" AND NOT "${__force_flag}" STREQUAL "!" )
# configuration already exists, skip remap
set ( __remap_warnings "${__remap_warnings}... Configuration already exists ${__remap_config} (skip mapping ${__remap_config} => ${__final_config}) (available configurations: ${__available_configurations})\n" )
continue ( )
endif ( )
if ( __available_configurations AND NOT ";${__available_configurations};" MATCHES ";${__final_config_upper};" )
# skip, configuration is not available
if ( NOT "${__force_flag}" STREQUAL "!" )
set ( __remap_warnings "${__remap_warnings}... Configuration is not available '${__final_config}' for ${target}, build may fail (available configurations: ${__available_configurations})\n" )
endif ( )
endif ( )
set_target_properties ( ${ target } PROPERTIES
M A P _ I M P O R T E D _ C O N F I G _ $ { _ _ r e m a p _ c o n f i g } " $ { _ _ f i n a l _ c o n f i g } "
)
else ( )
message ( WARNING "Invalid entry of OPENCV_MAP_IMPORTED_CONFIG: '${remap}' (${OPENCV_MAP_IMPORTED_CONFIG})" )
endif ( )
endforeach ( )
endif ( )
endmacro ( )
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 ( )
2016-01-11 22:54:14 +08:00
set ( OpenCV_WORLD_COMPONENTS @OPENCV_WORLD_MODULES@ )
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
foreach ( __cvcomponent ${ OpenCV_FIND_COMPONENTS } )
2016-11-20 21:36:34 +08:00
# Store the name of the original component so we can set the
# OpenCV_<component>_FOUND variable which can be checked by the user.
set ( __original_cvcomponent ${ __cvcomponent } )
2012-02-03 19:26:49 +08:00
if ( NOT __cvcomponent MATCHES "^opencv_" )
set ( __cvcomponent opencv_ ${ __cvcomponent } )
endif ( )
list ( FIND OpenCV_LIB_COMPONENTS ${ __cvcomponent } __cvcomponentIdx )
if ( __cvcomponentIdx LESS 0 )
2016-11-20 21:36:34 +08:00
if ( _OpenCV_HANDLE_COMPONENTS_MANUALLY )
# Either the component is required or the user did not set any components at
# all. In the latter case, the OpenCV_FIND_REQUIRED_<component> variable
# will not be defined since it is not set by this config. So let's assume
# the implicitly set components are always required.
if ( NOT DEFINED OpenCV_FIND_REQUIRED_ ${ __original_cvcomponent } OR
O p e n C V _ F I N D _ R E Q U I R E D _ $ { _ _ o r i g i n a l _ c v c o m p o n e n t } )
message ( FATAL_ERROR "${__cvcomponent} is required but was not found" )
elseif ( NOT OpenCV_FIND_QUIETLY )
# The component was marked as optional using OPTIONAL_COMPONENTS
message ( WARNING "Optional component ${__cvcomponent} was not found" )
endif ( )
endif ( _OpenCV_HANDLE_COMPONENTS_MANUALLY )
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" )
2016-11-20 21:36:34 +08:00
set ( OpenCV_ ${ __original_cvcomponent } _FOUND FALSE )
2012-02-03 19:26:49 +08:00
else ( )
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 )
2016-11-20 21:36:34 +08:00
set ( OpenCV_ ${ __original_cvcomponent } _FOUND TRUE )
2014-08-01 22:11:20 +08:00
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 )
2018-02-02 23:14:25 +08:00
get_target_property ( __include_dir opencv_world INTERFACE_INCLUDE_DIRECTORIES )
2014-08-01 22:11:20 +08:00
add_library ( ${ __cvcomponent } SHARED IMPORTED )
2018-02-02 23:14:25 +08:00
set_target_properties ( ${ __cvcomponent } PROPERTIES INTERFACE_INCLUDE_DIRECTORIES "${__include_dir}" )
2014-08-01 22:11:20 +08:00
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 ( )
2017-09-18 23:47:49 +08:00
if ( TARGET ${ __cvcomponent } )
2017-12-13 19:14:28 +08:00
ocv_map_imported_config ( ${ __cvcomponent } )
2017-09-18 23:47:49 +08:00
endif ( )
2012-02-03 19:26:49 +08:00
endforeach ( )
2017-12-13 19:14:28 +08:00
if ( __remap_warnings AND NOT OpenCV_FIND_QUIETLY )
message ( "OpenCV: configurations remap warnings:\n${__remap_warnings}OpenCV: Check variable OPENCV_MAP_IMPORTED_CONFIG=${OPENCV_MAP_IMPORTED_CONFIG}" )
endif ( )
2012-02-03 19:26:49 +08:00
# ==============================================================
# Compatibility stuff
# ==============================================================
set ( OpenCV_LIBRARIES ${ OpenCV_LIBS } )
2013-02-27 18:39:28 +08:00
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 "" )
2016-01-11 22:54:14 +08:00
file ( TO_CMAKE_PATH "${OpenCV_INSTALL_PATH}" __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 ( )
2016-11-20 21:36:34 +08:00
# We do not actually need REQUIRED_VARS to be checked for. Just use the
# installation directory for the status.
find_package_handle_standard_args ( OpenCV REQUIRED_VARS OpenCV_INSTALL_PATH
V E R S I O N _ V A R O p e n C V _ V E R S I O N $ { _ O p e n C V _ F P H S A _ A R G S } )