2010-05-12 01:44:00 +08:00
|
|
|
# ===================================================================================
|
|
|
|
# The OpenCV CMake configuration file
|
|
|
|
#
|
|
|
|
# ** File generated automatically, do not modify **
|
|
|
|
#
|
2010-08-25 20:49:17 +08:00
|
|
|
# Usage from an external project:
|
2010-05-12 01:44:00 +08:00
|
|
|
# In your CMakeLists.txt, add these lines:
|
|
|
|
#
|
|
|
|
# FIND_PACKAGE(OpenCV REQUIRED )
|
2010-08-25 20:49:17 +08:00
|
|
|
# TARGET_LINK_LIBRARIES(MY_TARGET_NAME ${OpenCV_LIBS})
|
2010-05-12 01:44:00 +08:00
|
|
|
#
|
|
|
|
# This file will define the following variables:
|
2010-08-25 20:49:17 +08: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_VERSION : The version of this OpenCV build. Example: "1.2.0"
|
|
|
|
# - OpenCV_VERSION_MAJOR : Major version part of OpenCV_VERSION. Example: "1"
|
|
|
|
# - OpenCV_VERSION_MINOR : Minor version part of OpenCV_VERSION. Example: "2"
|
|
|
|
# - OpenCV_VERSION_PATCH : Patch version part of OpenCV_VERSION. Example: "0"
|
2010-05-12 01:44:00 +08:00
|
|
|
#
|
2010-08-25 20:49:17 +08:00
|
|
|
# =================================================================================================
|
2010-05-12 01:44:00 +08:00
|
|
|
|
2010-08-25 20:49:17 +08:00
|
|
|
# ======================================================
|
|
|
|
# Version Compute Capability from which library OpenCV
|
|
|
|
# has been compiled is remembered
|
|
|
|
# ======================================================
|
|
|
|
SET(OpenCV_COMPUTE_CAPABILITIES @OpenCV_CUDA_CC@)
|
2010-05-12 01:44:00 +08:00
|
|
|
|
|
|
|
# Extract the directory where *this* file has been installed (determined at cmake run-time)
|
|
|
|
# This variable may or may not be used below, depending on the parsing of OpenCVConfig.cmake
|
|
|
|
get_filename_component(THIS_OPENCV_CONFIG_PATH "${CMAKE_CURRENT_LIST_FILE}" PATH)
|
|
|
|
|
|
|
|
# ======================================================
|
|
|
|
# Include directories to add to the user project:
|
|
|
|
# ======================================================
|
2010-11-30 06:18:28 +08:00
|
|
|
|
2010-05-12 01:44:00 +08:00
|
|
|
# Provide the include directories to the caller
|
|
|
|
SET(OpenCV_INCLUDE_DIRS @CMAKE_INCLUDE_DIRS_CONFIGCMAKE@)
|
|
|
|
|
2010-11-30 06:18:28 +08:00
|
|
|
INCLUDE_DIRECTORIES(${OpenCV_INCLUDE_DIRS})
|
|
|
|
|
2010-05-12 01:44:00 +08:00
|
|
|
# ======================================================
|
|
|
|
# Link directories to add to the user project:
|
|
|
|
# ======================================================
|
2010-11-30 06:18:28 +08:00
|
|
|
|
2010-05-12 01:44:00 +08:00
|
|
|
# Provide the libs directory anyway, it may be needed in some cases.
|
2010-11-30 06:18:28 +08:00
|
|
|
SET(OpenCV_LIB_DIR @CMAKE_LIB_DIRS_CONFIGCMAKE@)
|
|
|
|
|
|
|
|
LINK_DIRECTORIES(${OpenCV_LIB_DIR})
|
2010-05-12 01:44:00 +08:00
|
|
|
|
|
|
|
# ====================================================================
|
|
|
|
# Link libraries: e.g. opencv_core220.so, opencv_imgproc220d.lib, etc...
|
2011-04-26 05:50:25 +08:00
|
|
|
# ====================================================================
|
2011-04-06 22:31:03 +08:00
|
|
|
if(NOT ANDROID)
|
2011-04-26 05:50:25 +08:00
|
|
|
set(OPENCV_LIB_COMPONENTS opencv_core opencv_imgproc opencv_features2d opencv_gpu opencv_calib3d opencv_objdetect opencv_video opencv_highgui opencv_ml opencv_legacy opencv_contrib opencv_flann)
|
|
|
|
else()
|
|
|
|
#libraries order is very important because linker from Android NDK is one-pass linker
|
2011-05-03 16:13:50 +08:00
|
|
|
set(OPENCV_LIB_COMPONENTS opencv_contrib opencv_calib3d opencv_objdetect opencv_features2d opencv_imgproc opencv_video opencv_highgui opencv_ml opencv_legacy opencv_flann opencv_core )
|
2011-04-26 05:50:25 +08:00
|
|
|
endif()
|
2011-04-06 22:31:03 +08:00
|
|
|
|
2010-05-12 01:44:00 +08:00
|
|
|
SET(OpenCV_LIBS "")
|
|
|
|
foreach(__CVLIB ${OPENCV_LIB_COMPONENTS})
|
2011-04-26 05:50:25 +08:00
|
|
|
# CMake>=2.6 supports the notation "debug XXd optimized XX"
|
|
|
|
if (CMAKE_MAJOR_VERSION GREATER 2 OR CMAKE_MINOR_VERSION GREATER 4)
|
|
|
|
# Modern CMake:
|
|
|
|
SET(OpenCV_LIBS ${OpenCV_LIBS} debug ${__CVLIB}@OPENCV_DLLVERSION@@OPENCV_DEBUG_POSTFIX@ optimized ${__CVLIB}@OPENCV_DLLVERSION@)
|
|
|
|
else(CMAKE_MAJOR_VERSION GREATER 2 OR CMAKE_MINOR_VERSION GREATER 4)
|
|
|
|
# Old CMake:
|
|
|
|
SET(OpenCV_LIBS ${OpenCV_LIBS} ${__CVLIB}@OPENCV_DLLVERSION@)
|
|
|
|
endif(CMAKE_MAJOR_VERSION GREATER 2 OR CMAKE_MINOR_VERSION GREATER 4)
|
2010-05-12 01:44:00 +08:00
|
|
|
endforeach(__CVLIB)
|
|
|
|
|
2010-05-14 17:35:39 +08:00
|
|
|
# ==============================================================
|
|
|
|
# Extra include directories, needed by OpenCV 2 new structure
|
|
|
|
# ==============================================================
|
|
|
|
if(NOT @CMAKE_BASE_INCLUDE_DIRS_CONFIGCMAKE@ STREQUAL "")
|
2011-04-26 05:50:25 +08:00
|
|
|
SET(BASEDIR @CMAKE_BASE_INCLUDE_DIRS_CONFIGCMAKE@)
|
|
|
|
foreach(__CVLIB ${OPENCV_LIB_COMPONENTS})
|
|
|
|
# We only need the "core",... part here: "opencv_core" -> "core"
|
|
|
|
STRING(REGEX REPLACE "opencv_(.*)" "\\1" MODNAME ${__CVLIB})
|
|
|
|
INCLUDE_DIRECTORIES("${BASEDIR}/modules/${MODNAME}/include")
|
|
|
|
endforeach(__CVLIB)
|
2010-05-14 17:35:39 +08:00
|
|
|
endif(NOT @CMAKE_BASE_INCLUDE_DIRS_CONFIGCMAKE@ STREQUAL "")
|
|
|
|
|
2010-08-25 20:49:17 +08:00
|
|
|
# For OpenCV built as static libs, we need the user to link against
|
2010-05-12 01:44:00 +08:00
|
|
|
# many more dependencies:
|
2011-05-31 21:17:59 +08:00
|
|
|
IF (NOT @BUILD_SHARED_LIBS@)
|
2011-04-26 05:50:25 +08:00
|
|
|
# Under static libs, the user of OpenCV needs access to the 3rdparty libs as well:
|
2010-12-05 09:19:36 +08:00
|
|
|
LINK_DIRECTORIES(@CMAKE_LIB_DIRS_CONFIGCMAKE@/../3rdparty/lib)
|
|
|
|
if(WIN32)
|
2010-12-05 07:02:36 +08:00
|
|
|
LINK_DIRECTORIES(@CMAKE_BASE_INCLUDE_DIRS_CONFIGCMAKE@/3rdparty/lib)
|
2011-04-06 22:31:03 +08:00
|
|
|
elseif(ANDROID)
|
|
|
|
LINK_DIRECTORIES(@CMAKE_BINARY_DIR@/3rdparty/lib)
|
|
|
|
LINK_DIRECTORIES(@CMAKE_LIB_DIRS_CONFIGCMAKE@/3rdparty/lib)
|
2010-12-05 10:10:59 +08:00
|
|
|
else()
|
|
|
|
LINK_DIRECTORIES(@CMAKE_LIB_DIRS_CONFIGCMAKE@/../share/opencv/3rdparty/lib)
|
2010-12-05 09:19:36 +08:00
|
|
|
endif()
|
|
|
|
|
2011-04-26 05:50:25 +08:00
|
|
|
set(OpenCV_LIBS @OPENCV_LINKER_LIBS@ @IPP_LIBS@ @HIGHGUI_LIBRARIES@ ${OpenCV_LIBS})
|
2010-12-05 09:19:36 +08:00
|
|
|
|
2011-04-26 05:50:25 +08:00
|
|
|
set(OPENCV_EXTRA_COMPONENTS @JPEG_LIBRARIES@ @PNG_LIBRARIES@ @TIFF_LIBRARIES@ @JASPER_LIBRARIES@ zlib)
|
2010-12-05 09:19:36 +08:00
|
|
|
|
|
|
|
if (CMAKE_MAJOR_VERSION GREATER 2 OR CMAKE_MINOR_VERSION GREATER 4)
|
|
|
|
foreach(__EXTRA_LIB ${OPENCV_EXTRA_COMPONENTS})
|
2011-04-26 05:50:25 +08:00
|
|
|
set(OpenCV_LIBS ${OpenCV_LIBS}
|
2010-12-05 09:19:36 +08:00
|
|
|
debug ${__EXTRA_LIB}@OPENCV_DEBUG_POSTFIX@
|
|
|
|
optimized ${__EXTRA_LIB})
|
|
|
|
endforeach(__EXTRA_LIB)
|
|
|
|
else(CMAKE_MAJOR_VERSION GREATER 2 OR CMAKE_MINOR_VERSION GREATER 4)
|
|
|
|
set(OpenCV_LIBS ${OpenCV_LIBS} ${OPENCV_EXTRA_COMPONENTS})
|
|
|
|
endif(CMAKE_MAJOR_VERSION GREATER 2 OR CMAKE_MINOR_VERSION GREATER 4)
|
|
|
|
|
2011-05-31 21:17:59 +08:00
|
|
|
ENDIF(NOT @BUILD_SHARED_LIBS@)
|
2010-05-12 01:44:00 +08:00
|
|
|
|
|
|
|
|
|
|
|
# ======================================================
|
2010-08-25 20:49:17 +08:00
|
|
|
# Version variables:
|
2010-05-12 01:44:00 +08: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@)
|