2010-05-11 19:44:00 +02:00
|
|
|
# ===================================================================================
|
|
|
|
# The OpenCV CMake configuration file
|
|
|
|
#
|
|
|
|
# ** File generated automatically, do not modify **
|
|
|
|
#
|
2010-08-25 14:49:17 +02:00
|
|
|
# Usage from an external project:
|
2010-05-11 19:44:00 +02:00
|
|
|
# In your CMakeLists.txt, add these lines:
|
|
|
|
#
|
|
|
|
# FIND_PACKAGE(OpenCV REQUIRED )
|
2010-08-25 14:49:17 +02:00
|
|
|
# TARGET_LINK_LIBRARIES(MY_TARGET_NAME ${OpenCV_LIBS})
|
2010-05-11 19:44:00 +02:00
|
|
|
#
|
|
|
|
# This file will define the following variables:
|
2010-08-25 14:49:17 +02: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
|
2011-06-29 08:27:08 +02:00
|
|
|
# - 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@"
|
2010-05-11 19:44:00 +02:00
|
|
|
#
|
2011-06-27 15:59:03 +02:00
|
|
|
# Advanced variables:
|
|
|
|
# - OpenCV_SHARED
|
|
|
|
# - OpenCV_CONFIG_PATH
|
|
|
|
# - OpenCV_INSTALL_PATH
|
|
|
|
# - OpenCV_LIB_COMPONENTS
|
|
|
|
# - OpenCV_EXTRA_COMPONENTS
|
2011-06-29 08:27:08 +02:00
|
|
|
# - OpenCV_USE_MANGLED_PATHS
|
2011-07-04 13:41:39 +02:00
|
|
|
# - OpenCV_HAVE_ANDROID_CAMERA
|
2011-09-14 11:11:14 +02:00
|
|
|
# - OpenCV_SOURCE_PATH
|
2011-06-27 15:59:03 +02:00
|
|
|
#
|
2010-08-25 14:49:17 +02:00
|
|
|
# =================================================================================================
|
2010-05-11 19:44:00 +02:00
|
|
|
|
2010-08-25 14:49:17 +02:00
|
|
|
# ======================================================
|
|
|
|
# Version Compute Capability from which library OpenCV
|
|
|
|
# has been compiled is remembered
|
|
|
|
# ======================================================
|
|
|
|
SET(OpenCV_COMPUTE_CAPABILITIES @OpenCV_CUDA_CC@)
|
2010-05-11 19:44:00 +02:00
|
|
|
|
2011-06-27 15:59:03 +02:00
|
|
|
# Some additional settings are required if OpenCV is built as static libs
|
|
|
|
set(OpenCV_SHARED @BUILD_SHARED_LIBS@)
|
|
|
|
|
2011-06-29 08:27:08 +02:00
|
|
|
# Enables mangled install paths, that help with side by side installs
|
|
|
|
set(OpenCV_USE_MANGLED_PATHS @OPENCV_MANGLED_INSTALL_PATHS@)
|
|
|
|
|
2010-05-11 19:44:00 +02:00
|
|
|
# Extract the directory where *this* file has been installed (determined at cmake run-time)
|
2011-06-27 15:59:03 +02:00
|
|
|
get_filename_component(OpenCV_CONFIG_PATH "${CMAKE_CURRENT_LIST_FILE}" PATH)
|
|
|
|
|
2011-07-04 13:41:39 +02:00
|
|
|
# Get the absolute path with no ../.. relative marks, to eliminate implicit linker warnings
|
2011-06-27 15:59:03 +02:00
|
|
|
get_filename_component(OpenCV_INSTALL_PATH "${OpenCV_CONFIG_PATH}/../.." REALPATH)
|
2010-05-11 19:44:00 +02:00
|
|
|
|
2011-07-04 13:41:39 +02:00
|
|
|
# Presence of Android native camera support
|
|
|
|
set (OpenCV_HAVE_ANDROID_CAMERA @WITH_ANDROID_CAMERA@)
|
|
|
|
|
2010-05-11 19:44:00 +02:00
|
|
|
# ======================================================
|
|
|
|
# Include directories to add to the user project:
|
|
|
|
# ======================================================
|
2011-06-27 15:59:03 +02:00
|
|
|
|
2010-05-11 19:44:00 +02:00
|
|
|
# Provide the include directories to the caller
|
2011-06-27 15:59:03 +02:00
|
|
|
SET(OpenCV_INCLUDE_DIRS @CMAKE_INCLUDE_DIRS_CONFIGCMAKE@)
|
2010-11-29 23:18:28 +01:00
|
|
|
INCLUDE_DIRECTORIES(${OpenCV_INCLUDE_DIRS})
|
|
|
|
|
2010-05-11 19:44:00 +02:00
|
|
|
# ======================================================
|
|
|
|
# Link directories to add to the user project:
|
|
|
|
# ======================================================
|
2010-11-29 23:18:28 +01:00
|
|
|
|
2011-06-27 15:59:03 +02:00
|
|
|
# Provide the libs directory anyway, it may be needed in some cases.
|
|
|
|
SET(OpenCV_LIB_DIR @CMAKE_LIB_DIRS_CONFIGCMAKE@)
|
2010-11-29 23:18:28 +01:00
|
|
|
LINK_DIRECTORIES(${OpenCV_LIB_DIR})
|
2010-05-11 19:44:00 +02:00
|
|
|
|
|
|
|
# ====================================================================
|
2011-06-28 18:02:09 +02:00
|
|
|
# Link libraries: e.g. libopencv_core.so, opencv_imgproc220d.lib, etc...
|
2011-04-25 23:50:25 +02:00
|
|
|
# ====================================================================
|
2011-09-09 12:00:10 +02:00
|
|
|
|
|
|
|
# OpenCV internal dependencies:
|
|
|
|
# opencv_androidcamera -> {}
|
|
|
|
# opencv_core -> {}
|
|
|
|
# opencv_flann -> {opencv_core}
|
|
|
|
# opencv_imgproc -> {opencv_core}
|
|
|
|
# opencv_ml -> {opencv_core}
|
|
|
|
# opencv_highgui -> {opencv_core, opencv_imgproc, opencv_androidcamera}
|
|
|
|
# opencv_video -> {opencv_core, opencv_imgproc}
|
|
|
|
# opencv_features2d -> {opencv_core, opencv_imgproc, opencv_flann, opencv_highgui}
|
|
|
|
# opencv_calib3d -> {opencv_core, opencv_imgproc, opencv_flann, opencv_features2d}
|
|
|
|
# opencv_objdetect -> {opencv_core, opencv_imgproc, opencv_flann, opencv_highgui, opencv_features2d, opencv_calib3d}
|
|
|
|
# opencv_gpu -> {opencv_core, opencv_imgproc, opencv_flann, opencv_features2d, opencv_calib3d, opencv_objdetect}
|
|
|
|
# opencv_stitching -> {opencv_core, opencv_imgproc, opencv_flann, opencv_features2d, opencv_calib3d, opencv_objdetect, opencv_gpu}
|
|
|
|
# opencv_legacy -> {opencv_core, opencv_imgproc, opencv_flann, opencv_highgui, opencv_features2d, opencv_calib3d, opencv_video}
|
|
|
|
# opencv_contrib -> {opencv_core, opencv_imgproc, opencv_flann, opencv_highgui, opencv_features2d, opencv_calib3d, opencv_objdetect, opencv_video, opencv_ml}
|
|
|
|
|
|
|
|
SET(OpenCV_LIB_COMPONENTS opencv_contrib opencv_legacy opencv_stitching opencv_gpu opencv_objdetect opencv_calib3d opencv_features2d opencv_video opencv_highgui opencv_ml opencv_imgproc opencv_flann opencv_core opencv_androidcamera)
|
|
|
|
|
|
|
|
# remove modules unavailable on current platform:
|
|
|
|
if(ANDROID)
|
|
|
|
LIST(REMOVE_ITEM OpenCV_LIB_COMPONENTS opencv_gpu)
|
2011-11-30 14:58:42 +01:00
|
|
|
SET(OpenCV_LIB_ANDROID @OpenCV_LIB_ANDROID@)
|
|
|
|
IF(OpenCV_LIB_ANDROID)
|
|
|
|
SET(OpenCV_LIB_COMPONENTS ${OpenCV_LIB_COMPONENTS} ${OpenCV_LIB_ANDROID})
|
|
|
|
SET(CMAKE_EXE_LINKER_FLAGS "${CMAKE_EXE_LINKER_FLAGS} -Wl,--allow-shlib-undefined")
|
|
|
|
SET(CMAKE_SHARED_LINKER_FLAGS "${CMAKE_SHARED_LINKER_FLAGS} -Wl,--allow-shlib-undefined")
|
|
|
|
ENDIF()
|
2011-09-09 12:00:10 +02:00
|
|
|
endif()
|
|
|
|
if(NOT ANDROID OR OpenCV_SHARED OR NOT OpenCV_HAVE_ANDROID_CAMERA)
|
|
|
|
LIST(REMOVE_ITEM OpenCV_LIB_COMPONENTS opencv_androidcamera)
|
2011-04-25 23:50:25 +02:00
|
|
|
endif()
|
2011-04-06 16:31:03 +02:00
|
|
|
|
2011-06-29 08:27:08 +02:00
|
|
|
if(OpenCV_USE_MANGLED_PATHS)
|
2011-06-28 18:02:09 +02:00
|
|
|
#be explicit about the library names.
|
|
|
|
set(OpenCV_LIB_COMPONENTS_ )
|
|
|
|
foreach( CVLib ${OpenCV_LIB_COMPONENTS})
|
|
|
|
list(APPEND OpenCV_LIB_COMPONENTS_ ${OpenCV_LIB_DIR}/lib${CVLib}.so.@OPENCV_VERSION@ )
|
|
|
|
endforeach()
|
|
|
|
set(OpenCV_LIB_COMPONENTS ${OpenCV_LIB_COMPONENTS_})
|
|
|
|
endif()
|
|
|
|
|
2010-05-11 19:44:00 +02:00
|
|
|
SET(OpenCV_LIBS "")
|
2011-06-28 18:02:09 +02:00
|
|
|
if(WIN32)
|
|
|
|
foreach(__CVLIB ${OpenCV_LIB_COMPONENTS})
|
|
|
|
# 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 ${OpenCV_LIBS} debug ${__CVLIB}@OPENCV_DLLVERSION@@OPENCV_DEBUG_POSTFIX@ optimized ${__CVLIB}@OPENCV_DLLVERSION@)
|
|
|
|
else()
|
|
|
|
# Old CMake:
|
|
|
|
SET(OpenCV_LIBS ${OpenCV_LIBS} ${__CVLIB}@OPENCV_DLLVERSION@)
|
|
|
|
endif()
|
|
|
|
endforeach()
|
|
|
|
else()
|
|
|
|
foreach(__CVLIB ${OpenCV_LIB_COMPONENTS})
|
|
|
|
SET(OpenCV_LIBS ${OpenCV_LIBS} ${__CVLIB})
|
|
|
|
endforeach()
|
|
|
|
endif()
|
2010-05-11 19:44:00 +02:00
|
|
|
|
2010-05-14 11:35:39 +02:00
|
|
|
# ==============================================================
|
|
|
|
# Extra include directories, needed by OpenCV 2 new structure
|
|
|
|
# ==============================================================
|
2011-09-14 11:11:14 +02:00
|
|
|
SET(OpenCV_SOURCE_PATH "@CMAKE_OPENCV2_INCLUDE_DIRS_CONFIGCMAKE@")
|
|
|
|
if(NOT "${OpenCV_SOURCE_PATH}" STREQUAL "")
|
2011-06-27 15:59:03 +02:00
|
|
|
foreach(__CVLIB ${OpenCV_LIB_COMPONENTS})
|
2011-04-25 23:50:25 +02:00
|
|
|
# We only need the "core",... part here: "opencv_core" -> "core"
|
2011-06-27 15:59:03 +02:00
|
|
|
STRING(REGEX REPLACE "opencv_(.*)" "\\1" __MODNAME ${__CVLIB})
|
2011-09-14 11:11:14 +02:00
|
|
|
INCLUDE_DIRECTORIES("${OpenCV_SOURCE_PATH}/modules/${__MODNAME}/include")
|
2011-11-16 15:40:13 +01:00
|
|
|
LIST(APPEND OpenCV_INCLUDE_DIRS "${OpenCV_SOURCE_PATH}/modules/${__MODNAME}/include")
|
2011-06-27 15:59:03 +02:00
|
|
|
endforeach()
|
|
|
|
endif()
|
2010-05-14 11:35:39 +02:00
|
|
|
|
2010-08-25 14:49:17 +02:00
|
|
|
# For OpenCV built as static libs, we need the user to link against
|
2010-05-11 19:44:00 +02:00
|
|
|
# many more dependencies:
|
2011-06-21 13:10:45 +02:00
|
|
|
IF (NOT OpenCV_SHARED)
|
2011-04-25 23:50:25 +02:00
|
|
|
# Under static libs, the user of OpenCV needs access to the 3rdparty libs as well:
|
2011-06-27 15:59:03 +02:00
|
|
|
LINK_DIRECTORIES(@CMAKE_3RDPARTY_LIB_DIRS_CONFIGCMAKE@)
|
2010-12-05 02:19:36 +01:00
|
|
|
|
2011-04-25 23:50:25 +02:00
|
|
|
set(OpenCV_LIBS @OPENCV_LINKER_LIBS@ @IPP_LIBS@ @HIGHGUI_LIBRARIES@ ${OpenCV_LIBS})
|
2011-06-27 15:59:03 +02:00
|
|
|
set(OpenCV_EXTRA_COMPONENTS @JPEG_LIBRARIES@ @PNG_LIBRARIES@ @TIFF_LIBRARIES@ @JASPER_LIBRARIES@ @ZLIB_LIBRARY@)
|
2010-12-05 02:19:36 +01:00
|
|
|
|
2011-06-29 08:27:08 +02:00
|
|
|
if (WIN32 AND ${CMAKE_MAJOR_VERSION}.${CMAKE_MINOR_VERSION} VERSION_GREATER 2.4)
|
2011-06-27 15:59:03 +02:00
|
|
|
# Modern CMake:
|
|
|
|
foreach(__EXTRA_LIB ${OpenCV_EXTRA_COMPONENTS})
|
2011-04-25 23:50:25 +02:00
|
|
|
set(OpenCV_LIBS ${OpenCV_LIBS}
|
2010-12-05 02:19:36 +01:00
|
|
|
debug ${__EXTRA_LIB}@OPENCV_DEBUG_POSTFIX@
|
|
|
|
optimized ${__EXTRA_LIB})
|
2011-06-27 15:59:03 +02:00
|
|
|
endforeach()
|
|
|
|
else()
|
|
|
|
# Old CMake:
|
|
|
|
set(OpenCV_LIBS ${OpenCV_LIBS} ${OpenCV_EXTRA_COMPONENTS})
|
|
|
|
endif()
|
2011-08-10 14:08:58 +02:00
|
|
|
|
|
|
|
if (APPLE)
|
|
|
|
set(OpenCV_LIBS ${OpenCV_LIBS} "-lbz2" "-framework Cocoa" "-framework QuartzCore" "-framework QTKit")
|
|
|
|
endif()
|
2011-06-21 13:10:45 +02:00
|
|
|
ENDIF()
|
2010-05-11 19:44:00 +02:00
|
|
|
|
2011-06-16 20:00:41 +02:00
|
|
|
# ======================================================
|
|
|
|
# Android camera helper macro
|
|
|
|
# ======================================================
|
2011-07-04 13:41:39 +02:00
|
|
|
IF (OpenCV_HAVE_ANDROID_CAMERA)
|
2011-06-16 20:00:41 +02:00
|
|
|
macro( COPY_NATIVE_CAMERA_LIBS target )
|
2011-07-04 13:41:39 +02: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})
|
|
|
|
ADD_CUSTOM_COMMAND(
|
|
|
|
TARGET ${target}
|
|
|
|
POST_BUILD
|
|
|
|
COMMAND ${CMAKE_COMMAND} -E copy "${wrapper}" "${target_location}"
|
|
|
|
)
|
|
|
|
endforeach()
|
2011-06-16 20:00:41 +02:00
|
|
|
endmacro()
|
2011-07-05 08:42:56 +02:00
|
|
|
ENDIF()
|
2010-05-11 19:44:00 +02:00
|
|
|
|
|
|
|
# ======================================================
|
2010-08-25 14:49:17 +02:00
|
|
|
# Version variables:
|
2010-05-11 19:44:00 +02:00
|
|
|
# ======================================================
|
|
|
|
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@)
|