Documenti di Didattica
Documenti di Professioni
Documenti di Cultura
include(cmake/OpenCVMinDepVersions.cmake)
if(WINRT)
add_definitions(-DWINRT -DNO_GETENV)
if(POLICY CMP0022)
cmake_policy(SET CMP0022 OLD)
endif()
if(POLICY CMP0026)
# silence cmake 3.0+ warnings about reading LOCATION attribute
cmake_policy(SET CMP0026 OLD)
endif()
if (POLICY CMP0042)
# silence cmake 3.0+ warnings about MACOSX_RPATH
cmake_policy(SET CMP0042 OLD)
endif()
enable_testing()
project(OpenCV CXX C)
if(MSVC)
set(CMAKE_USE_RELATIVE_PATHS ON CACHE INTERNAL "" FORCE)
endif()
include(cmake/OpenCVUtils.cmake)
ocv_clear_vars(OpenCVModules_TARGETS)
# ----------------------------------------------------------------------------
# Break in case of popular CMake configuration mistakes
# ----------------------------------------------------------------------------
if(NOT CMAKE_SIZEOF_VOID_P GREATER 0)
message(FATAL_ERROR "CMake fails to deterimine the bitness of target platform.
Please check your CMake and compiler installation. If you are crosscompiling then
ensure that your CMake toolchain file correctly sets the compiler details.")
endif()
# ----------------------------------------------------------------------------
# Detect compiler and target platform architecture
# ----------------------------------------------------------------------------
include(cmake/OpenCVDetectCXXCompiler.cmake)
# ----------------------------------------------------------------------------
# OpenCV cmake options
# ----------------------------------------------------------------------------
if(ENABLE_IMPL_COLLECTION)
add_definitions(-DCV_COLLECT_IMPL_DATA)
endif()
# ----------------------------------------------------------------------------
# Get actual OpenCV version number from sources
# ----------------------------------------------------------------------------
include(cmake/OpenCVVersion.cmake)
# ----------------------------------------------------------------------------
# Build & install layouts
# ----------------------------------------------------------------------------
if (ANDROID)
if (ANDROID_ABI MATCHES "NEON")
set(ENABLE_NEON ON)
endif()
if (ANDROID_ABI MATCHES "VFPV3")
set(ENABLE_VFPV3 ON)
endif()
endif()
if(ANDROID OR WIN32)
set(OPENCV_DOC_INSTALL_PATH doc)
else()
set(OPENCV_DOC_INSTALL_PATH share/OpenCV/doc)
endif()
if(ANDROID)
set(OPENCV_SAMPLES_BIN_INSTALL_PATH "${OpenCV_INSTALL_BINARIES_PREFIX}samples/$
{ANDROID_NDK_ABI_NAME}")
else()
set(OPENCV_SAMPLES_BIN_INSTALL_PATH "${OpenCV_INSTALL_BINARIES_PREFIX}samples")
endif()
if(ANDROID)
set(OPENCV_BIN_INSTALL_PATH "${OpenCV_INSTALL_BINARIES_PREFIX}bin/$
{ANDROID_NDK_ABI_NAME}")
else()
set(OPENCV_BIN_INSTALL_PATH "${OpenCV_INSTALL_BINARIES_PREFIX}bin")
endif()
if(NOT OPENCV_TEST_INSTALL_PATH)
set(OPENCV_TEST_INSTALL_PATH "${OPENCV_BIN_INSTALL_PATH}")
endif()
if (OPENCV_TEST_DATA_PATH)
get_filename_component(OPENCV_TEST_DATA_PATH ${OPENCV_TEST_DATA_PATH} ABSOLUTE)
endif()
if(ANDROID)
set(LIBRARY_OUTPUT_PATH "${OpenCV_BINARY_DIR}/lib/$
{ANDROID_NDK_ABI_NAME}")
set(3P_LIBRARY_OUTPUT_PATH "${OpenCV_BINARY_DIR}/3rdparty/lib/$
{ANDROID_NDK_ABI_NAME}")
set(OPENCV_LIB_INSTALL_PATH sdk/native/libs/${ANDROID_NDK_ABI_NAME})
set(OPENCV_3P_LIB_INSTALL_PATH sdk/native/3rdparty/libs/${ANDROID_NDK_ABI_NAME})
set(OPENCV_CONFIG_INSTALL_PATH sdk/native/jni)
set(OPENCV_INCLUDE_INSTALL_PATH sdk/native/jni/include)
set(OPENCV_SAMPLES_SRC_INSTALL_PATH samples/native)
set(OPENCV_OTHER_INSTALL_PATH sdk/etc)
else()
set(LIBRARY_OUTPUT_PATH "${OpenCV_BINARY_DIR}/lib")
set(3P_LIBRARY_OUTPUT_PATH "${OpenCV_BINARY_DIR}/3rdparty/lib${LIB_SUFFIX}")
set(CMAKE_INSTALL_RPATH "${CMAKE_INSTALL_PREFIX}/${OPENCV_LIB_INSTALL_PATH}")
set(CMAKE_INSTALL_RPATH_USE_LINK_PATH TRUE)
if(INSTALL_TO_MANGLED_PATHS)
set(OPENCV_INCLUDE_INSTALL_PATH ${OPENCV_INCLUDE_INSTALL_PATH}/opencv-$
{OPENCV_VERSION})
string(REPLACE "OpenCV" "OpenCV-${OPENCV_VERSION}" OPENCV_3P_LIB_INSTALL_PATH "$
{OPENCV_3P_LIB_INSTALL_PATH}")
string(REPLACE "OpenCV" "OpenCV-${OPENCV_VERSION}"
OPENCV_SAMPLES_SRC_INSTALL_PATH "${OPENCV_SAMPLES_SRC_INSTALL_PATH}")
string(REPLACE "OpenCV" "OpenCV-${OPENCV_VERSION}" OPENCV_CONFIG_INSTALL_PATH "$
{OPENCV_CONFIG_INSTALL_PATH}")
string(REPLACE "OpenCV" "OpenCV-${OPENCV_VERSION}" OPENCV_DOC_INSTALL_PATH "$
{OPENCV_DOC_INSTALL_PATH}")
string(REPLACE "OpenCV" "OpenCV-${OPENCV_VERSION}" OPENCV_JAR_INSTALL_PATH "$
{OPENCV_JAR_INSTALL_PATH}")
string(REPLACE "OpenCV" "OpenCV-${OPENCV_VERSION}" OPENCV_TEST_DATA_INSTALL_PATH
"${OPENCV_TEST_DATA_INSTALL_PATH}")
string(REPLACE "OpenCV" "OpenCV-${OPENCV_VERSION}" OPENCV_OTHER_INSTALL_PATH "$
{OPENCV_OTHER_INSTALL_PATH}")
endif()
if(WIN32)
# Postfix of DLLs:
set(OPENCV_DLLVERSION "${OPENCV_VERSION_MAJOR}${OPENCV_VERSION_MINOR}$
{OPENCV_VERSION_PATCH}")
set(OPENCV_DEBUG_POSTFIX d)
else()
# Postfix of so's:
set(OPENCV_DLLVERSION "")
set(OPENCV_DEBUG_POSTFIX "")
endif()
if(DEFINED CMAKE_DEBUG_POSTFIX)
set(OPENCV_DEBUG_POSTFIX "${CMAKE_DEBUG_POSTFIX}")
endif()
# ----------------------------------------------------------------------------
# Path for build/platform -specific headers
# ----------------------------------------------------------------------------
set(OPENCV_CONFIG_FILE_INCLUDE_DIR "${CMAKE_BINARY_DIR}/" CACHE PATH "Where to
create the platform-dependant cvconfig.h")
ocv_include_directories(${OPENCV_CONFIG_FILE_INCLUDE_DIR})
# ----------------------------------------------------------------------------
# Path for additional modules
# ----------------------------------------------------------------------------
set(OPENCV_EXTRA_MODULES_PATH "" CACHE PATH "Where to look for additional OpenCV
modules")
# ----------------------------------------------------------------------------
# Autodetect if we are in a GIT repository
# ----------------------------------------------------------------------------
find_host_package(Git QUIET)
if(GIT_FOUND)
execute_process(COMMAND "${GIT_EXECUTABLE}" describe --tags --always --dirty
--match "[0-9].[0-9].[0-9]*"
WORKING_DIRECTORY "${OpenCV_SOURCE_DIR}"
OUTPUT_VARIABLE OPENCV_VCSVERSION
RESULT_VARIABLE GIT_RESULT
ERROR_QUIET
OUTPUT_STRIP_TRAILING_WHITESPACE
)
if(NOT GIT_RESULT EQUAL 0)
set(OPENCV_VCSVERSION "unknown")
endif()
else()
# We don't have git:
set(OPENCV_VCSVERSION "unknown")
endif()
# ----------------------------------------------------------------------------
# OpenCV compiler and linker options
# ----------------------------------------------------------------------------
# In case of Makefiles if the user does not setup CMAKE_BUILD_TYPE, assume it's
Release:
if(CMAKE_GENERATOR MATCHES "Makefiles|Ninja" AND "${CMAKE_BUILD_TYPE}" STREQUAL "")
set(CMAKE_BUILD_TYPE Release)
endif()
include(cmake/OpenCVCompilerOptions.cmake)
# ----------------------------------------------------------------------------
# Use statically or dynamically linked CRT?
# Default: dynamic
# ----------------------------------------------------------------------------
if(MSVC)
include(cmake/OpenCVCRTLinkage.cmake)
endif(MSVC)
# ----------------------------------------------------------------------------
# CHECK FOR SYSTEM LIBRARIES, OPTIONS, ETC..
# ----------------------------------------------------------------------------
if(UNIX)
find_package(PkgConfig QUIET)
include(CheckFunctionExists)
include(CheckIncludeFile)
if(NOT APPLE)
CHECK_INCLUDE_FILE(pthread.h HAVE_LIBPTHREAD)
if(ANDROID)
set(OPENCV_LINKER_LIBS ${OPENCV_LINKER_LIBS} dl m log)
elseif(${CMAKE_SYSTEM_NAME} MATCHES "FreeBSD|NetBSD|DragonFly|OpenBSD")
set(OPENCV_LINKER_LIBS ${OPENCV_LINKER_LIBS} m pthread)
elseif(EMSCRIPTEN)
# no need to link to system libs with emscripten
else()
set(OPENCV_LINKER_LIBS ${OPENCV_LINKER_LIBS} dl m pthread rt)
endif()
else()
set(HAVE_LIBPTHREAD YES)
endif()
endif()
include(cmake/OpenCVPCHSupport.cmake)
include(cmake/OpenCVModule.cmake)
# ----------------------------------------------------------------------------
# Detect endianness of build platform
# ----------------------------------------------------------------------------
if(IOS)
# test_big_endian needs try_compile, which doesn't work for iOS
# http://public.kitware.com/Bug/view.php?id=12288
set(WORDS_BIGENDIAN 0)
else()
include(TestBigEndian)
test_big_endian(WORDS_BIGENDIAN)
endif()
# ----------------------------------------------------------------------------
# Detect 3rd-party libraries
# ----------------------------------------------------------------------------
include(cmake/OpenCVFindLibsGrfmt.cmake)
include(cmake/OpenCVFindLibsGUI.cmake)
include(cmake/OpenCVFindLibsVideo.cmake)
include(cmake/OpenCVFindLibsPerf.cmake)
# ----------------------------------------------------------------------------
# Detect other 3rd-party libraries/tools
# ----------------------------------------------------------------------------
include(cmake/OpenCVDetectVTK.cmake)
# ----------------------------------------------------------------------------
# Add CUDA libraries (needed for apps/tools, samples)
# ----------------------------------------------------------------------------
if(HAVE_CUDA)
set(OPENCV_LINKER_LIBS ${OPENCV_LINKER_LIBS} ${CUDA_LIBRARIES} $
{CUDA_npp_LIBRARY})
if(HAVE_CUBLAS)
set(OPENCV_LINKER_LIBS ${OPENCV_LINKER_LIBS} ${CUDA_cublas_LIBRARY})
endif()
if(HAVE_CUFFT)
set(OPENCV_LINKER_LIBS ${OPENCV_LINKER_LIBS} ${CUDA_cufft_LIBRARY})
endif()
foreach(p ${CUDA_LIBS_PATH})
set(OPENCV_LINKER_LIBS ${OPENCV_LINKER_LIBS} -L${p})
endforeach()
endif()
# ----------------------------------------------------------------------------
# Solution folders:
# ----------------------------------------------------------------------------
if(ENABLE_SOLUTION_FOLDERS)
set_property(GLOBAL PROPERTY USE_FOLDERS ON)
set_property(GLOBAL PROPERTY PREDEFINED_TARGETS_FOLDER "CMakeTargets")
endif()
# ----------------------------------------------------------------------------
# Process subdirectories
# ----------------------------------------------------------------------------
# OpenCV modules
add_subdirectory(modules)
# extra applications
if(BUILD_opencv_apps)
add_subdirectory(apps)
endif()
# examples
if(BUILD_EXAMPLES OR BUILD_ANDROID_EXAMPLES OR INSTALL_PYTHON_EXAMPLES)
add_subdirectory(samples)
endif()
if(ANDROID)
add_subdirectory(platforms/android/service)
endif()
# ----------------------------------------------------------------------------
# Finalization: generate configuration-based files
# ----------------------------------------------------------------------------
if(NOT OPENCV_README_FILE)
if(ANDROID)
set(OPENCV_README_FILE $
{CMAKE_CURRENT_SOURCE_DIR}/platforms/android/README.android)
endif()
endif()
if(NOT OPENCV_LICENSE_FILE)
set(OPENCV_LICENSE_FILE ${CMAKE_CURRENT_SOURCE_DIR}/LICENSE)
endif()
# for UNIX it does not make sense as LICENSE and readme will be part of the package
automatically
if(ANDROID OR NOT UNIX)
install(FILES ${OPENCV_LICENSE_FILE}
PERMISSIONS OWNER_READ GROUP_READ WORLD_READ
DESTINATION ${CMAKE_INSTALL_PREFIX} COMPONENT libs)
if(OPENCV_README_FILE)
install(FILES ${OPENCV_README_FILE}
PERMISSIONS OWNER_READ GROUP_READ WORLD_READ
DESTINATION ${CMAKE_INSTALL_PREFIX} COMPONENT libs)
endif()
endif()
# ----------------------------------------------------------------------------
# Summary:
# ----------------------------------------------------------------------------
status("")
status("General configuration for OpenCV ${OPENCV_VERSION}
=====================================")
if(OPENCV_VCSVERSION)
status(" Version control:" ${OPENCV_VCSVERSION})
endif()
status("")
status(" C/C++:")
status(" Built as dynamic libs?:" BUILD_SHARED_LIBS THEN YES ELSE NO)
status(" C++ Compiler:" ${OPENCV_COMPILER_STR})
status(" C++ flags (Release):" ${CMAKE_CXX_FLAGS} ${CMAKE_CXX_FLAGS_RELEASE})
status(" C++ flags (Debug):" ${CMAKE_CXX_FLAGS} ${CMAKE_CXX_FLAGS_DEBUG})
status(" C Compiler:" ${CMAKE_C_COMPILER} ${CMAKE_C_COMPILER_ARG1})
status(" C flags (Release):" ${CMAKE_C_FLAGS} ${CMAKE_C_FLAGS_RELEASE})
status(" C flags (Debug):" ${CMAKE_C_FLAGS} ${CMAKE_C_FLAGS_DEBUG})
if(WIN32)
status(" Linker flags (Release):" ${CMAKE_EXE_LINKER_FLAGS} $
{CMAKE_EXE_LINKER_FLAGS_RELEASE})
status(" Linker flags (Debug):" ${CMAKE_EXE_LINKER_FLAGS} $
{CMAKE_EXE_LINKER_FLAGS_DEBUG})
else()
status(" Linker flags (Release):" ${CMAKE_SHARED_LINKER_FLAGS} $
{CMAKE_SHARED_LINKER_FLAGS_RELEASE})
status(" Linker flags (Debug):" ${CMAKE_SHARED_LINKER_FLAGS} $
{CMAKE_SHARED_LINKER_FLAGS_DEBUG})
endif()
status(" Precompiled headers:" PCHSupport_FOUND AND
ENABLE_PRECOMPILED_HEADERS THEN YES ELSE NO)
if(HAVE_QT5)
status(" QT 5.x:" HAVE_QT THEN "YES (ver $
{Qt5Core_VERSION_STRING})" ELSE NO)
status(" QT OpenGL support:" HAVE_QT_OPENGL THEN "YES (${Qt5OpenGL_LIBRARIES}
${Qt5OpenGL_VERSION_STRING})" ELSE NO)
elseif(HAVE_QT)
status(" QT 4.x:" HAVE_QT THEN "YES (ver $
{QT_VERSION_MAJOR}.${QT_VERSION_MINOR}.${QT_VERSION_PATCH} ${QT_EDITION})" ELSE NO)
status(" QT OpenGL support:" HAVE_QT_OPENGL THEN "YES ($
{QT_QTOPENGL_LIBRARY})" ELSE NO)
else()
if(DEFINED WITH_QT)
status(" QT:" NO)
endif()
if(DEFINED WITH_WIN32UI)
status(" Win32 UI:" HAVE_WIN32UI THEN YES ELSE NO)
else()
if(APPLE)
if(WITH_CARBON)
status(" Carbon:" YES)
else()
status(" Cocoa:" YES)
endif()
else()
if(HAVE_GTK3)
status(" GTK+ 3.x:" HAVE_GTK THEN "YES (ver ${ALIASOF_gtk+-
3.0_VERSION})" ELSE NO)
elseif(HAVE_GTK)
status(" GTK+ 2.x:" HAVE_GTK THEN "YES (ver ${ALIASOF_gtk+-
2.0_VERSION})" ELSE NO)
else()
status(" GTK+:" NO)
endif()
status(" GThread :" HAVE_GTHREAD THEN "YES (ver ${ALIASOF_gthread-
2.0_VERSION})" ELSE NO)
status(" GtkGlExt:" HAVE_GTKGLEXT THEN "YES (ver ${ALIASOF_gtkglext-
1.0_VERSION})" ELSE NO)
endif()
endif()
endif()
if(WITH_JPEG)
status(" JPEG:" JPEG_FOUND THEN "${JPEG_LIBRARY} (ver $
{JPEG_LIB_VERSION})" ELSE "build (ver ${JPEG_LIB_VERSION})")
else()
status(" JPEG:" "NO")
endif()
if(WITH_WEBP)
status(" WEBP:" WEBP_FOUND THEN "${WEBP_LIBRARY} (ver $
{WEBP_VERSION})" ELSE "build (ver ${WEBP_VERSION})")
else()
status(" WEBP:" "NO")
endif()
if(WITH_PNG)
status(" PNG:" PNG_FOUND THEN "${PNG_LIBRARY} (ver ${PNG_VERSION})"
ELSE "build (ver ${PNG_VERSION})")
else()
status(" PNG:" "NO")
endif()
if(WITH_TIFF)
if(TIFF_VERSION_STRING AND TIFF_FOUND)
status(" TIFF:" "${TIFF_LIBRARY} (ver ${TIFF_VERSION} - $
{TIFF_VERSION_STRING})")
else()
status(" TIFF:" TIFF_FOUND THEN "${TIFF_LIBRARY} (ver $
{TIFF_VERSION})" ELSE "build (ver ${TIFF_VERSION} - $
{TIFF_VERSION_STRING})")
endif()
else()
status(" TIFF:" "NO")
endif()
if(WITH_JASPER)
status(" JPEG 2000:" JASPER_FOUND THEN "${JASPER_LIBRARY} (ver $
{JASPER_VERSION_STRING})" ELSE "build (ver ${JASPER_VERSION_STRING})")
else()
status(" JPEG 2000:" "NO")
endif()
if(WITH_OPENEXR)
status(" OpenEXR:" OPENEXR_FOUND THEN "${OPENEXR_LIBRARIES} (ver $
{OPENEXR_VERSION})" ELSE "build (ver ${OPENEXR_VERSION})")
else()
status(" OpenEXR:" "NO")
endif()
if( WITH_GDAL )
status(" GDAL:" GDAL_FOUND THEN "${GDAL_LIBRARY}" ELSE "NO")
else()
status(" GDAL:" "NO")
endif()
if (DEFINED WITH_VFW)
status(" Video for Windows:" HAVE_VFW THEN YES
ELSE NO)
endif(DEFINED WITH_VFW)
if(DEFINED WITH_1394)
status(" DC1394 1.x:" HAVE_DC1394 THEN "YES (ver $
{ALIASOF_libdc1394_VERSION})" ELSE NO)
status(" DC1394 2.x:" HAVE_DC1394_2 THEN "YES (ver $
{ALIASOF_libdc1394-2_VERSION})" ELSE NO)
endif(DEFINED WITH_1394)
if(DEFINED WITH_AVFOUNDATION)
status(" AVFoundation:" WITH_AVFOUNDATION THEN YES
ELSE NO)
endif(DEFINED WITH_AVFOUNDATION)
if(DEFINED WITH_FFMPEG)
if(WIN32)
status(" FFMPEG:" WITH_FFMPEG THEN "YES (prebuilt binaries)"
ELSE NO)
else()
status(" FFMPEG:" HAVE_FFMPEG THEN YES ELSE NO)
endif()
status(" codec:" HAVE_FFMPEG_CODEC THEN "YES (ver $
{ALIASOF_libavcodec_VERSION})" ELSE NO)
status(" format:" HAVE_FFMPEG_FORMAT THEN "YES (ver $
{ALIASOF_libavformat_VERSION})" ELSE NO)
status(" util:" HAVE_FFMPEG_UTIL THEN "YES (ver $
{ALIASOF_libavutil_VERSION})" ELSE NO)
status(" swscale:" HAVE_FFMPEG_SWSCALE THEN "YES (ver $
{ALIASOF_libswscale_VERSION})" ELSE NO)
status(" resample:" HAVE_FFMPEG_RESAMPLE THEN "YES (ver $
{ALIASOF_libavresample_VERSION})" ELSE NO)
status(" gentoo-style:" HAVE_GENTOO_FFMPEG THEN YES
ELSE NO)
endif(DEFINED WITH_FFMPEG)
if(DEFINED WITH_GSTREAMER)
status(" GStreamer:" HAVE_GSTREAMER THEN ""
ELSE NO)
if(HAVE_GSTREAMER)
status(" base:" "YES (ver ${GSTREAMER_BASE_VERSION})")
status(" video:" "YES (ver ${GSTREAMER_VIDEO_VERSION})")
status(" app:" "YES (ver ${GSTREAMER_APP_VERSION})")
status(" riff:" "YES (ver ${GSTREAMER_RIFF_VERSION})")
status(" pbutils:" "YES (ver ${GSTREAMER_PBUTILS_VERSION})")
endif(HAVE_GSTREAMER)
endif(DEFINED WITH_GSTREAMER)
if(DEFINED WITH_OPENNI)
status(" OpenNI:" HAVE_OPENNI THEN "YES (ver $
{OPENNI_VERSION_STRING}, build ${OPENNI_VERSION_BUILD})"
ELSE NO)
status(" OpenNI PrimeSensor Modules:" HAVE_OPENNI_PRIME_SENSOR_MODULE
THEN "YES ($
{OPENNI_PRIME_SENSOR_MODULE})" ELSE NO)
endif(DEFINED WITH_OPENNI)
if(DEFINED WITH_OPENNI2)
status(" OpenNI2:" HAVE_OPENNI2 THEN "YES (ver $
{OPENNI2_VERSION_STRING}, build ${OPENNI2_VERSION_BUILD})"
ELSE NO)
endif(DEFINED WITH_OPENNI2)
if(DEFINED WITH_PVAPI)
status(" PvAPI:" HAVE_PVAPI THEN YES
ELSE NO)
endif(DEFINED WITH_PVAPI)
if(DEFINED WITH_GIGEAPI)
status(" GigEVisionSDK:" HAVE_GIGE_API THEN YES
ELSE NO)
endif(DEFINED WITH_GIGEAPI)
if(DEFINED WITH_QUICKTIME)
status(" QuickTime:" HAVE_QUICKTIME THEN YES
ELSE NO)
status(" QTKit:" HAVE_QTKIT THEN YES
ELSE NO)
endif(DEFINED WITH_QUICKTIME)
if(DEFINED WITH_UNICAP)
status(" UniCap:" HAVE_UNICAP THEN "YES (ver $
{ALIASOF_libunicap_VERSION})" ELSE NO)
status(" UniCap ucil:" HAVE_UNICAP_UCIL THEN "YES (ver $
{ALIASOF_libucil_VERSION})" ELSE NO)
endif(DEFINED WITH_UNICAP)
if(DEFINED WITH_V4L)
if(HAVE_CAMV4L)
set(HAVE_CAMV4L_STR "YES")
else()
set(HAVE_CAMV4L_STR "NO")
endif()
if(HAVE_CAMV4L2)
set(HAVE_CAMV4L2_STR "YES")
elseif(HAVE_VIDEOIO)
set(HAVE_CAMV4L2_STR "YES(videoio)")
else()
set(HAVE_CAMV4L2_STR "NO")
endif()
status(" V4L/V4L2:" HAVE_LIBV4L
THEN "Using libv4l1 (ver ${ALIASOF_libv4l1_VERSION}) / libv4l2 (ver $
{ALIASOF_libv4l2_VERSION})"
ELSE "${HAVE_CAMV4L_STR}/${HAVE_CAMV4L2_STR}")
endif(DEFINED WITH_V4L)
if(DEFINED WITH_DSHOW)
status(" DirectShow:" HAVE_DSHOW THEN YES
ELSE NO)
endif(DEFINED WITH_DSHOW)
if(DEFINED WITH_MSMF)
status(" Media Foundation:" HAVE_MSMF THEN YES
ELSE NO)
endif(DEFINED WITH_MSMF)
if(DEFINED WITH_XIMEA)
status(" XIMEA:" HAVE_XIMEA THEN YES
ELSE NO)
endif(DEFINED WITH_XIMEA)
if(DEFINED WITH_XINE)
status(" Xine:" HAVE_XINE THEN "YES (ver $
{ALIASOF_libxine_VERSION})" ELSE NO)
endif(DEFINED WITH_XINE)
if(DEFINED WITH_INTELPERC)
status(" Intel PerC:" HAVE_INTELPERC THEN "YES"
ELSE NO)
endif(DEFINED WITH_INTELPERC)
if(DEFINED WITH_GPHOTO2)
status(" gPhoto2:" HAVE_GPHOTO2 THEN "YES"
ELSE NO)
endif(DEFINED WITH_GPHOTO2)
if(DEFINED WITH_IPP_A)
status(" Use IPP Async:" HAVE_IPP_A THEN "YES" ELSE NO)
endif(DEFINED WITH_IPP_A)
if(DEFINED WITH_VA)
status(" Use VA:" HAVE_VA THEN "YES" ELSE NO)
endif(DEFINED WITH_VA)
if(DEFINED WITH_VA_INTEL)
status(" Use Intel VA-API/OpenCL:" HAVE_VA_INTEL THEN "YES (MSDK: $
{VA_INTEL_MSDK_ROOT} OpenCL: ${VA_INTEL_IOCL_ROOT})" ELSE NO)
endif(DEFINED WITH_VA_INTEL)
if(HAVE_CUDA)
status("")
status(" NVIDIA CUDA")
status(" Use CUFFT:" HAVE_CUFFT THEN YES ELSE NO)
status(" Use CUBLAS:" HAVE_CUBLAS THEN YES ELSE NO)
status(" USE NVCUVID:" HAVE_NVCUVID THEN YES ELSE NO)
status(" NVIDIA GPU arch:" ${OPENCV_CUDA_ARCH_BIN})
status(" NVIDIA PTX archs:" ${OPENCV_CUDA_ARCH_PTX})
status(" Use fast math:" CUDA_FAST_MATH THEN YES ELSE NO)
endif()
if(HAVE_OPENCL)
status("")
status(" OpenCL:")
if(HAVE_OPENCL_STATIC)
set(__opencl_ver "static")
else()
set(__opencl_ver "dynamic")
endif()
status(" Version:" ${__opencl_ver})
if(OPENCL_INCLUDE_DIR)
status(" Include path:" ${OPENCL_INCLUDE_DIRS})
endif()
if(OPENCL_LIBRARIES)
set(__libs "")
foreach(l ${OPENCL_LIBRARIES})
if(TARGET ${l})
get_target_property(p ${l} LOCATION)
if(p MATCHES NOTFOUND)
list(APPEND __libs "${l}")
else()
list(APPEND __libs "${p}")
endif()
else()
list(APPEND __libs "${l}")
endif()
endforeach()
status(" libraries:" ${__libs})
endif()
status(" Use AMDFFT:" HAVE_CLAMDFFT THEN YES ELSE NO)
status(" Use AMDBLAS:" HAVE_CLAMDBLAS THEN YES ELSE NO)
endif()
status("")
status(" Python (for build):" PYTHON_DEFAULT_AVAILABLE THEN "$
{PYTHON_DEFAULT_EXECUTABLE}" ELSE NO)
ocv_finalize_status()
# ----------------------------------------------------------------------------
# Warn in the case of in-source build
# ----------------------------------------------------------------------------
if("${CMAKE_CURRENT_SOURCE_DIR}" STREQUAL "${CMAKE_CURRENT_BINARY_DIR}")
message(WARNING "The source directory is the same as binary directory. \"make
clean\" may damage the source tree")
endif()
# ----------------------------------------------------------------------------
# CPack stuff
# ----------------------------------------------------------------------------
include(cmake/OpenCVPackaging.cmake)