2012-01-03 14:48:12 +01:00
|
|
|
# ===================================================================================
|
|
|
|
# The OpenCV CMake configuration file
|
|
|
|
#
|
|
|
|
# ** File generated automatically, do not modify **
|
|
|
|
#
|
|
|
|
# Usage from an external project:
|
|
|
|
# In your CMakeLists.txt, add these lines:
|
|
|
|
#
|
2012-02-03 12:26:49 +01:00
|
|
|
# FIND_PACKAGE(OpenCV REQUIRED)
|
2012-01-03 14:48:12 +01:00
|
|
|
# TARGET_LINK_LIBRARIES(MY_TARGET_NAME ${OpenCV_LIBS})
|
|
|
|
#
|
2012-02-03 12:26:49 +01:00
|
|
|
# Or you can search for specific OpenCV modules:
|
|
|
|
#
|
|
|
|
# FIND_PACKAGE(OpenCV REQUIRED core highgui)
|
|
|
|
#
|
|
|
|
# If the module found then OPENCV_<MODULE>_FOUND is set.
|
|
|
|
#
|
2012-01-03 14:48:12 +01:00
|
|
|
# This file will define the following variables:
|
2012-02-03 12:26:49 +01:00
|
|
|
# -
|
|
|
|
# - OpenCV_LIBS : The list of libraries to links against.
|
|
|
|
# - OpenCV_LIB_DIR : The directory where lib files are. Calling LINK_DIRECTORIES
|
|
|
|
# with this path is NOT needed.
|
|
|
|
# - OpenCV_INCLUDE_DIRS : The OpenCV include directories.
|
|
|
|
# - OpenCV_COMPUTE_CAPABILITIES : The version of compute capability
|
|
|
|
# - OpenCV_ANDROID_NATIVE_API_LEVEL : Minimum required level of Android API
|
|
|
|
# - OpenCV_VERSION : The version of this OpenCV build. Example: "@OPENCV_VERSION@"
|
|
|
|
# - OpenCV_VERSION_MAJOR : Major version part of OpenCV_VERSION. Example: "@OPENCV_VERSION_MAJOR@"
|
|
|
|
# - OpenCV_VERSION_MINOR : Minor version part of OpenCV_VERSION. Example: "@OPENCV_VERSION_MINOR@"
|
|
|
|
# - OpenCV_VERSION_PATCH : Patch version part of OpenCV_VERSION. Example: "@OPENCV_VERSION_PATCH@"
|
2012-01-03 14:48:12 +01:00
|
|
|
#
|
|
|
|
# Advanced variables:
|
|
|
|
# - OpenCV_SHARED
|
|
|
|
# - OpenCV_CONFIG_PATH
|
|
|
|
# - OpenCV_INSTALL_PATH
|
|
|
|
# - OpenCV_LIB_COMPONENTS
|
|
|
|
# - OpenCV_USE_MANGLED_PATHS
|
|
|
|
# - OpenCV_HAVE_ANDROID_CAMERA
|
|
|
|
# - OpenCV_SOURCE_PATH
|
|
|
|
#
|
|
|
|
# =================================================================================================
|
|
|
|
|
2012-02-03 12:26:49 +01:00
|
|
|
# Version Compute Capability from which OpenCV has been compiled is remembered
|
|
|
|
set(OpenCV_COMPUTE_CAPABILITIES @OpenCV_CUDA_CC_CONFIGMAKE@)
|
|
|
|
|
|
|
|
# Android API level from which OpenCV has been compiled is remembered
|
|
|
|
set(OpenCV_ANDROID_NATIVE_API_LEVEL @OpenCV_ANDROID_NATIVE_API_LEVEL_CONFIGMAKE@)
|
2012-01-03 14:48:12 +01: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-03 12:26:49 +01:00
|
|
|
set(OpenCV_USE_MANGLED_PATHS @OpenCV_USE_MANGLED_PATHS@)
|
2012-01-03 14:48:12 +01:00
|
|
|
|
|
|
|
# Extract the directory where *this* file has been installed (determined at cmake run-time)
|
|
|
|
get_filename_component(OpenCV_CONFIG_PATH "${CMAKE_CURRENT_LIST_FILE}" PATH)
|
|
|
|
|
|
|
|
# Get the absolute path with no ../.. relative marks, to eliminate implicit linker warnings
|
|
|
|
get_filename_component(OpenCV_INSTALL_PATH "${OpenCV_CONFIG_PATH}/../.." REALPATH)
|
|
|
|
|
2012-02-03 12:26:49 +01:00
|
|
|
# Presence of Android native camera wrappers
|
|
|
|
set(OpenCV_HAVE_ANDROID_CAMERA @HAVE_opencv_androidcamera@)
|
2012-01-03 14:48:12 +01:00
|
|
|
|
|
|
|
# ======================================================
|
|
|
|
# Include directories to add to the user project:
|
|
|
|
# ======================================================
|
|
|
|
|
|
|
|
# Provide the include directories to the caller
|
2012-02-03 12:26:49 +01:00
|
|
|
set(OpenCV_INCLUDE_DIRS @CMAKE_INCLUDE_DIRS_CONFIGCMAKE@)
|
|
|
|
include_directories(${OpenCV_INCLUDE_DIRS})
|
2012-01-03 14:48:12 +01:00
|
|
|
|
|
|
|
# ======================================================
|
|
|
|
# Link directories to add to the user project:
|
|
|
|
# ======================================================
|
|
|
|
|
2012-02-03 12:26:49 +01:00
|
|
|
# Provide the libs directories to the caller
|
2012-02-06 12:30:59 +01:00
|
|
|
set(OpenCV_LIB_DIR_OPT @CMAKE_LIB_DIRS_CONFIGCMAKE@)
|
|
|
|
set(OpenCV_LIB_DIR_DBG @CMAKE_LIB_DIRS_CONFIGCMAKE@)
|
|
|
|
set(OpenCV_3RDPARTY_LIB_DIR_OPT @CMAKE_3RDPARTY_LIB_DIRS_CONFIGCMAKE@)
|
|
|
|
set(OpenCV_3RDPARTY_LIB_DIR_DBG @CMAKE_3RDPARTY_LIB_DIRS_CONFIGCMAKE@)
|
2012-02-03 12:26:49 +01:00
|
|
|
|
|
|
|
# ======================================================
|
|
|
|
# Version variables:
|
|
|
|
# ======================================================
|
|
|
|
SET(OpenCV_VERSION @OPENCV_VERSION@)
|
|
|
|
SET(OpenCV_VERSION_MAJOR @OPENCV_VERSION_MAJOR@)
|
|
|
|
SET(OpenCV_VERSION_MINOR @OPENCV_VERSION_MINOR@)
|
|
|
|
SET(OpenCV_VERSION_PATCH @OPENCV_VERSION_PATCH@)
|
2012-01-03 14:48:12 +01:00
|
|
|
|
|
|
|
# ====================================================================
|
|
|
|
# Link libraries: e.g. libopencv_core.so, opencv_imgproc220d.lib, etc...
|
|
|
|
# ====================================================================
|
|
|
|
|
2012-02-03 12:26:49 +01:00
|
|
|
SET(OpenCV_LIB_COMPONENTS @OPENCV_MODULES_CONFIGMAKE@)
|
|
|
|
|
|
|
|
@OPENCV_DEPENDENCIES_MAP_OPT@
|
|
|
|
|
|
|
|
@OPENCV_DEPENDENCIES_MAP_DBG@
|
|
|
|
|
2012-02-06 12:30:59 +01:00
|
|
|
# ==============================================================
|
|
|
|
# Extra include directories, needed by OpenCV 2 new structure
|
|
|
|
# ==============================================================
|
|
|
|
SET(OpenCV2_INCLUDE_DIRS @CMAKE_OPENCV2_INCLUDE_DIRS_CONFIGCMAKE@)
|
|
|
|
if(OpenCV2_INCLUDE_DIRS)
|
|
|
|
include_directories(${OpenCV2_INCLUDE_DIRS})
|
|
|
|
list(APPEND OpenCV_INCLUDE_DIRS ${OpenCV2_INCLUDE_DIRS})
|
2012-02-08 06:45:58 +01:00
|
|
|
set(OpenCV_AddDebugRelease)
|
2012-02-06 12:30:59 +01:00
|
|
|
if(MSVC)
|
2012-02-08 06:45:58 +01:00
|
|
|
set(OpenCV_AddDebugRelease 1)
|
|
|
|
elseif(CMAKE_GENERATOR MATCHES Xcode)
|
|
|
|
set(OpenCV_AddDebugRelease 1)
|
|
|
|
endif()
|
|
|
|
|
|
|
|
if(OpenCV_AddDebugRelease)
|
2012-02-06 12:30:59 +01: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 12:26:49 +01:00
|
|
|
# ==============================================================
|
|
|
|
# Check OpenCV availability
|
|
|
|
# ==============================================================
|
|
|
|
if(ANDROID AND OpenCV_ANDROID_NATIVE_API_LEVEL LESS ANDROID_NATIVE_API_LEVEL)
|
|
|
|
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 14:48:12 +01:00
|
|
|
endif()
|
2012-02-03 12:26:49 +01:00
|
|
|
|
|
|
|
# ==============================================================
|
|
|
|
# Form list of modules (components) to find
|
|
|
|
# ==============================================================
|
|
|
|
if(NOT OpenCV_FIND_COMPONENTS)
|
2012-02-06 12:30:59 +01:00
|
|
|
set(OpenCV_FIND_COMPONENTS ${OpenCV_LIB_COMPONENTS})
|
2012-01-03 14:48:12 +01:00
|
|
|
endif()
|
|
|
|
|
2012-02-06 12:30:59 +01:00
|
|
|
# expand short module names and see if requested components exist
|
2012-02-03 12:26:49 +01: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 12:30:59 +01:00
|
|
|
#requested component is not found...
|
2012-02-03 12:26:49 +01: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 12:30:59 +01:00
|
|
|
#indicate that module is NOT found
|
2012-02-03 12:26:49 +01:00
|
|
|
string(TOUPPER "${__cvcomponent}" __cvcomponent)
|
|
|
|
set(${__cvcomponent}_FOUND "${__cvcomponent}_FOUND-NOTFOUND")
|
|
|
|
else()
|
|
|
|
list(APPEND OpenCV_FIND_COMPONENTS_ ${__cvcomponent})
|
2012-02-06 12:30:59 +01:00
|
|
|
#indicate that module is found
|
|
|
|
string(TOUPPER "${__cvcomponent}" __cvcomponent)
|
|
|
|
set(${__cvcomponent}_FOUND 1)
|
2012-02-03 12:26:49 +01:00
|
|
|
endif()
|
|
|
|
endforeach()
|
|
|
|
set(OpenCV_FIND_COMPONENTS ${OpenCV_FIND_COMPONENTS_})
|
|
|
|
|
|
|
|
# ==============================================================
|
|
|
|
# Resolve dependencies
|
|
|
|
# ==============================================================
|
2012-01-03 14:48:12 +01:00
|
|
|
if(OpenCV_USE_MANGLED_PATHS)
|
2012-02-06 12:30:59 +01:00
|
|
|
set(OpenCV_LIB_SUFFIX ".${OpenCV_VERSION}")
|
2012-02-03 12:26:49 +01:00
|
|
|
else()
|
2012-02-06 12:30:59 +01:00
|
|
|
set(OpenCV_LIB_SUFFIX "")
|
2012-01-03 14:48:12 +01:00
|
|
|
endif()
|
|
|
|
|
2012-02-03 12:26:49 +01:00
|
|
|
foreach(__opttype OPT DBG)
|
|
|
|
SET(OpenCV_LIBS_${__opttype} "")
|
|
|
|
SET(OpenCV_EXTRA_LIBS_${__opttype} "")
|
|
|
|
foreach(__cvlib ${OpenCV_FIND_COMPONENTS})
|
|
|
|
foreach(__cvdep ${OpenCV_${__cvlib}_DEPS_${__opttype}})
|
|
|
|
if(__cvdep MATCHES "^opencv_")
|
2012-02-06 12:30:59 +01:00
|
|
|
list(APPEND OpenCV_LIBS_${__opttype} "${OpenCV_LIB_DIR_${__opttype}}/${OpenCV_${__cvdep}_LIBNAME_${__opttype}}${OpenCV_LIB_SUFFIX}")
|
2012-02-03 12:26:49 +01:00
|
|
|
#indicate that this module is also found
|
|
|
|
string(TOUPPER "${__cvdep}" __cvdep)
|
|
|
|
set(${__cvdep}_FOUND 1)
|
2012-01-03 14:48:12 +01:00
|
|
|
else()
|
2012-02-06 12:30:59 +01:00
|
|
|
list(APPEND OpenCV_LIBS_${__opttype} "${OpenCV_3RDPARTY_LIB_DIR_${__opttype}}/${OpenCV_${__cvdep}_LIBNAME_${__opttype}}")
|
2012-01-03 14:48:12 +01:00
|
|
|
endif()
|
2012-02-03 12:26:49 +01:00
|
|
|
endforeach()
|
2012-02-06 12:30:59 +01:00
|
|
|
list(APPEND OpenCV_LIBS_${__opttype} "${OpenCV_LIB_DIR_${__opttype}}/${OpenCV_${__cvlib}_LIBNAME_${__opttype}}${OpenCV_LIB_SUFFIX}")
|
2012-02-03 12:26:49 +01:00
|
|
|
list(APPEND OpenCV_EXTRA_LIBS_${__opttype} ${OpenCV_${__cvlib}_EXTRA_DEPS_${__opttype}})
|
2012-01-03 14:48:12 +01:00
|
|
|
endforeach()
|
2012-02-03 12:26:49 +01:00
|
|
|
|
|
|
|
if(${CMAKE_MAJOR_VERSION}.${CMAKE_MINOR_VERSION} VERSION_GREATER 2.4)
|
|
|
|
if(OpenCV_LIBS_${__opttype})
|
|
|
|
list(REMOVE_DUPLICATES OpenCV_LIBS_${__opttype})
|
|
|
|
endif()
|
|
|
|
if(OpenCV_EXTRA_LIBS_${__opttype})
|
|
|
|
list(REMOVE_DUPLICATES OpenCV_EXTRA_LIBS_${__opttype})
|
|
|
|
endif()
|
|
|
|
else()
|
|
|
|
#TODO: duplicates are annoying but they should not be the problem
|
|
|
|
endif()
|
|
|
|
endforeach()
|
|
|
|
|
|
|
|
if(OpenCV_LIBS_DBG)
|
|
|
|
list(REVERSE OpenCV_LIBS_DBG)
|
|
|
|
endif()
|
|
|
|
|
|
|
|
if(OpenCV_LIBS_OPT)
|
|
|
|
list(REVERSE OpenCV_LIBS_OPT)
|
|
|
|
endif()
|
|
|
|
|
|
|
|
# CMake>=2.6 supports the notation "debug XXd optimized XX"
|
|
|
|
if(${CMAKE_MAJOR_VERSION}.${CMAKE_MINOR_VERSION} VERSION_GREATER 2.4)
|
|
|
|
# Modern CMake:
|
|
|
|
SET(OpenCV_LIBS "")
|
|
|
|
foreach(__cvlib ${OpenCV_LIBS_DBG} ${OpenCV_EXTRA_LIBS_DBG})
|
|
|
|
list(APPEND OpenCV_LIBS debug "${__cvlib}")
|
|
|
|
endforeach()
|
|
|
|
foreach(__cvlib ${OpenCV_LIBS_OPT} ${OpenCV_EXTRA_LIBS_OPT})
|
|
|
|
list(APPEND OpenCV_LIBS optimized "${__cvlib}")
|
2012-01-03 14:48:12 +01:00
|
|
|
endforeach()
|
2012-02-03 12:26:49 +01:00
|
|
|
else()
|
|
|
|
# Old CMake:
|
|
|
|
if(CMAKE_BUILD_TYPE MATCHES "Debug")
|
|
|
|
SET(OpenCV_LIBS ${OpenCV_LIBS_DBG} ${OpenCV_EXTRA_LIBS_DBG})
|
|
|
|
else()
|
|
|
|
SET(OpenCV_LIBS ${OpenCV_LIBS_OPT} ${OpenCV_EXTRA_LIBS_OPT})
|
|
|
|
endif()
|
2012-01-03 14:48:12 +01:00
|
|
|
endif()
|
|
|
|
|
2012-02-03 12:26:49 +01:00
|
|
|
# ==============================================================
|
2012-01-03 14:48:12 +01:00
|
|
|
# Android camera helper macro
|
2012-02-03 12:26:49 +01:00
|
|
|
# ==============================================================
|
|
|
|
if(OpenCV_HAVE_ANDROID_CAMERA)
|
|
|
|
macro(COPY_NATIVE_CAMERA_LIBS target)
|
2012-01-03 14:48:12 +01:00
|
|
|
get_target_property(target_location ${target} LOCATION)
|
|
|
|
get_filename_component(target_location "${target_location}" PATH)
|
|
|
|
file(GLOB camera_wrappers "${OpenCV_LIB_DIR}/libnative_camera_r*.so")
|
|
|
|
foreach(wrapper ${camera_wrappers})
|
2012-02-03 12:26:49 +01:00
|
|
|
add_custom_command(
|
2012-01-03 14:48:12 +01:00
|
|
|
TARGET ${target}
|
|
|
|
POST_BUILD
|
|
|
|
COMMAND ${CMAKE_COMMAND} -E copy "${wrapper}" "${target_location}"
|
|
|
|
)
|
|
|
|
endforeach()
|
|
|
|
endmacro()
|
2012-02-03 12:26:49 +01:00
|
|
|
endif()
|
2012-01-03 14:48:12 +01:00
|
|
|
|
2012-02-03 12:26:49 +01:00
|
|
|
# ==============================================================
|
|
|
|
# Compatibility stuff
|
|
|
|
# ==============================================================
|
|
|
|
set(OpenCV_LIBRARIES ${OpenCV_LIBS})
|