2012-06-28 23:41:27 +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:
|
|
|
|
#
|
|
|
|
# FIND_PACKAGE(OpenCV REQUIRED)
|
|
|
|
# TARGET_LINK_LIBRARIES(MY_TARGET_NAME ${OpenCV_LIBS})
|
|
|
|
#
|
|
|
|
# Or you can search for specific OpenCV modules:
|
|
|
|
#
|
2014-07-10 22:27:32 +08:00
|
|
|
# FIND_PACKAGE(OpenCV REQUIRED core imgcodecs)
|
2012-06-28 23:41:27 +08:00
|
|
|
#
|
|
|
|
# If the module is found then OPENCV_<MODULE>_FOUND is set to TRUE.
|
|
|
|
#
|
|
|
|
# This file will define the following variables:
|
2014-11-17 17:43:06 +08:00
|
|
|
# - OpenCV_LIBS : The list of libraries to link against.
|
2012-06-28 23:41:27 +08:00
|
|
|
# - OpenCV_INCLUDE_DIRS : The OpenCV include directories.
|
|
|
|
# - OpenCV_COMPUTE_CAPABILITIES : The version of compute capability
|
2016-01-11 22:54:14 +08:00
|
|
|
# - OpenCV_VERSION : The version of this OpenCV build: "@OPENCV_VERSION_PLAIN@"
|
|
|
|
# - 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@"
|
|
|
|
# - OpenCV_VERSION_STATUS : Development status of this build: "@OPENCV_VERSION_STATUS@"
|
2012-06-28 23:41:27 +08:00
|
|
|
#
|
|
|
|
# Advanced variables:
|
|
|
|
# - OpenCV_SHARED
|
|
|
|
#
|
|
|
|
# ===================================================================================
|
|
|
|
#
|
|
|
|
# Windows pack specific options:
|
|
|
|
# - OpenCV_STATIC
|
|
|
|
# - OpenCV_CUDA
|
|
|
|
|
2012-06-29 00:13:29 +08:00
|
|
|
if(CMAKE_VERSION VERSION_GREATER 2.6)
|
|
|
|
get_property(OpenCV_LANGUAGES GLOBAL PROPERTY ENABLED_LANGUAGES)
|
|
|
|
if(NOT ";${OpenCV_LANGUAGES};" MATCHES ";CXX;")
|
|
|
|
enable_language(CXX)
|
|
|
|
endif()
|
|
|
|
endif()
|
|
|
|
|
2012-06-28 23:41:27 +08:00
|
|
|
if(NOT DEFINED OpenCV_STATIC)
|
|
|
|
# look for global setting
|
2015-03-31 05:38:43 +08:00
|
|
|
if(BUILD_SHARED_LIBS)
|
2012-06-28 23:41:27 +08:00
|
|
|
set(OpenCV_STATIC OFF)
|
|
|
|
else()
|
|
|
|
set(OpenCV_STATIC ON)
|
|
|
|
endif()
|
|
|
|
endif()
|
|
|
|
|
|
|
|
if(NOT DEFINED OpenCV_CUDA)
|
|
|
|
# if user' app uses CUDA, then it probably wants CUDA-enabled OpenCV binaries
|
|
|
|
if(CUDA_FOUND)
|
|
|
|
set(OpenCV_CUDA ON)
|
|
|
|
endif()
|
|
|
|
endif()
|
|
|
|
|
|
|
|
if(MSVC)
|
|
|
|
if(CMAKE_CL_64)
|
|
|
|
set(OpenCV_ARCH x64)
|
2015-02-21 00:47:45 +08:00
|
|
|
elseif((CMAKE_GENERATOR MATCHES "ARM") OR ("${arch_hint}" STREQUAL "ARM") OR (CMAKE_VS_EFFECTIVE_PLATFORMS MATCHES "ARM|arm"))
|
|
|
|
# see Modules/CmakeGenericSystem.cmake
|
|
|
|
set(OpenCV_ARCH ARM)
|
2012-06-28 23:41:27 +08:00
|
|
|
else()
|
|
|
|
set(OpenCV_ARCH x86)
|
|
|
|
endif()
|
|
|
|
if(MSVC_VERSION EQUAL 1400)
|
|
|
|
set(OpenCV_RUNTIME vc8)
|
|
|
|
elseif(MSVC_VERSION EQUAL 1500)
|
|
|
|
set(OpenCV_RUNTIME vc9)
|
|
|
|
elseif(MSVC_VERSION EQUAL 1600)
|
|
|
|
set(OpenCV_RUNTIME vc10)
|
|
|
|
elseif(MSVC_VERSION EQUAL 1700)
|
|
|
|
set(OpenCV_RUNTIME vc11)
|
2013-11-18 23:39:39 +08:00
|
|
|
elseif(MSVC_VERSION EQUAL 1800)
|
|
|
|
set(OpenCV_RUNTIME vc12)
|
2015-05-02 22:24:14 +08:00
|
|
|
elseif(MSVC_VERSION EQUAL 1900)
|
|
|
|
set(OpenCV_RUNTIME vc14)
|
2012-06-28 23:41:27 +08:00
|
|
|
endif()
|
|
|
|
elseif(MINGW)
|
|
|
|
set(OpenCV_RUNTIME mingw)
|
|
|
|
|
|
|
|
execute_process(COMMAND ${CMAKE_CXX_COMPILER} -dumpmachine
|
2015-03-17 20:52:59 +08:00
|
|
|
OUTPUT_VARIABLE OPENCV_GCC_TARGET_MACHINE
|
2012-06-28 23:41:27 +08:00
|
|
|
OUTPUT_STRIP_TRAILING_WHITESPACE)
|
2015-03-17 20:52:59 +08:00
|
|
|
if(OPENCV_GCC_TARGET_MACHINE MATCHES "amd64|x86_64|AMD64")
|
2012-06-28 23:41:27 +08:00
|
|
|
set(MINGW64 1)
|
|
|
|
set(OpenCV_ARCH x64)
|
|
|
|
else()
|
|
|
|
set(OpenCV_ARCH x86)
|
|
|
|
endif()
|
|
|
|
endif()
|
|
|
|
|
2013-08-07 16:53:48 +08:00
|
|
|
if(NOT OpenCV_FIND_QUIETLY)
|
|
|
|
message(STATUS "OpenCV ARCH: ${OpenCV_ARCH}")
|
|
|
|
message(STATUS "OpenCV RUNTIME: ${OpenCV_RUNTIME}")
|
|
|
|
message(STATUS "OpenCV STATIC: ${OpenCV_STATIC}")
|
|
|
|
endif()
|
|
|
|
|
2016-01-11 22:54:14 +08:00
|
|
|
get_filename_component(OpenCV_CONFIG_PATH "${CMAKE_CURRENT_LIST_FILE}" PATH)
|
2012-06-28 23:41:27 +08:00
|
|
|
if(OpenCV_RUNTIME AND OpenCV_ARCH)
|
|
|
|
if(OpenCV_STATIC AND EXISTS "${OpenCV_CONFIG_PATH}/${OpenCV_ARCH}/${OpenCV_RUNTIME}/staticlib/OpenCVConfig.cmake")
|
|
|
|
if(OpenCV_CUDA AND EXISTS "${OpenCV_CONFIG_PATH}/gpu/${OpenCV_ARCH}/${OpenCV_RUNTIME}/staticlib/OpenCVConfig.cmake")
|
|
|
|
set(OpenCV_LIB_PATH "${OpenCV_CONFIG_PATH}/gpu/${OpenCV_ARCH}/${OpenCV_RUNTIME}/staticlib")
|
|
|
|
else()
|
|
|
|
set(OpenCV_LIB_PATH "${OpenCV_CONFIG_PATH}/${OpenCV_ARCH}/${OpenCV_RUNTIME}/staticlib")
|
|
|
|
endif()
|
|
|
|
elseif(EXISTS "${OpenCV_CONFIG_PATH}/${OpenCV_ARCH}/${OpenCV_RUNTIME}/lib/OpenCVConfig.cmake")
|
|
|
|
if(OpenCV_CUDA AND EXISTS "${OpenCV_CONFIG_PATH}/gpu/${OpenCV_ARCH}/${OpenCV_RUNTIME}/lib/OpenCVConfig.cmake")
|
|
|
|
set(OpenCV_LIB_PATH "${OpenCV_CONFIG_PATH}/gpu/${OpenCV_ARCH}/${OpenCV_RUNTIME}/lib")
|
|
|
|
else()
|
|
|
|
set(OpenCV_LIB_PATH "${OpenCV_CONFIG_PATH}/${OpenCV_ARCH}/${OpenCV_RUNTIME}/lib")
|
|
|
|
endif()
|
|
|
|
endif()
|
|
|
|
endif()
|
|
|
|
|
|
|
|
if(OpenCV_LIB_PATH AND EXISTS "${OpenCV_LIB_PATH}/OpenCVConfig.cmake")
|
|
|
|
include("${OpenCV_LIB_PATH}/OpenCVConfig.cmake")
|
|
|
|
|
|
|
|
if(NOT OpenCV_FIND_QUIETLY)
|
|
|
|
message(STATUS "Found OpenCV ${OpenCV_VERSION} in ${OpenCV_LIB_PATH}")
|
|
|
|
if(NOT OpenCV_LIB_PATH MATCHES "/staticlib")
|
|
|
|
get_filename_component(_OpenCV_LIB_PATH "${OpenCV_LIB_PATH}/../bin" ABSOLUTE)
|
|
|
|
file(TO_NATIVE_PATH "${_OpenCV_LIB_PATH}" _OpenCV_LIB_PATH)
|
|
|
|
message(STATUS "You might need to add ${_OpenCV_LIB_PATH} to your PATH to be able to run your applications.")
|
|
|
|
if(OpenCV_LIB_PATH MATCHES "/gpu/")
|
|
|
|
string(REPLACE "\\gpu" "" _OpenCV_LIB_PATH2 "${_OpenCV_LIB_PATH}")
|
|
|
|
message(STATUS "GPU support is enabled so you might also need ${_OpenCV_LIB_PATH2} in your PATH (it must go after the ${_OpenCV_LIB_PATH}).")
|
|
|
|
endif()
|
|
|
|
endif()
|
|
|
|
endif()
|
|
|
|
else()
|
|
|
|
if(NOT OpenCV_FIND_QUIETLY)
|
2013-10-03 23:27:57 +08:00
|
|
|
message(WARNING
|
2014-11-17 17:43:06 +08:00
|
|
|
"Found OpenCV Windows Pack but it has no binaries compatible with your configuration.
|
2013-10-03 23:27:57 +08:00
|
|
|
You should manually point CMake variable OpenCV_DIR to your build of OpenCV library."
|
|
|
|
)
|
2012-06-28 23:41:27 +08:00
|
|
|
endif()
|
2016-01-11 22:54:14 +08:00
|
|
|
set(OpenCV_FOUND FALSE)
|
2012-06-28 23:41:27 +08:00
|
|
|
endif()
|