# ----------------------------------------------------------------------------
# Root CMake file for OpenCV
#
# From the off-tree build directory, invoke:
# $ cmake <PATH_TO_OPENCV_ROOT>
#
# ----------------------------------------------------------------------------
# Disable in-source builds to prevent source tree corruption.
if(" ${CMAKE_SOURCE_DIR}" STREQUAL " ${CMAKE_BINARY_DIR}")
message(FATAL_ERROR "
FATAL: In-source builds are not allowed.
You should create a separate directory for build files.
")
endif()
include(cmake/OpenCVMinDepVersions.cmake)
if(CMAKE_SYSTEM_NAME MATCHES WindowsPhone OR CMAKE_SYSTEM_NAME MATCHES WindowsStore)
cmake_minimum_required(VERSION 3.1 FATAL_ERROR)
#Required to resolve linker error issues due to incompatibility with CMake v3.0+ policies.
#CMake fails to find _fseeko() which leads to subsequent linker error.
#See details here: http://www.cmake.org/Wiki/CMake/Policies
cmake_policy(VERSION 2.8)
else()
cmake_minimum_required(VERSION "${MIN_VER_CMAKE}" FATAL_ERROR)
endif()
#
# Configure CMake policies
#
if(POLICY CMP0026)
cmake_policy(SET CMP0026 NEW)
endif()
if(POLICY CMP0042)
cmake_policy(SET CMP0042 NEW) # CMake 3.0+ (2.8.12): MacOS "@rpath" in target's install name
endif()
if(POLICY CMP0046)
cmake_policy(SET CMP0046 NEW) # warn about non-existed dependencies
endif()
if(POLICY CMP0051)
cmake_policy(SET CMP0051 NEW)
endif()
if(POLICY CMP0054) # CMake 3.1: Only interpret if() arguments as variables or keywords when unquoted.
cmake_policy(SET CMP0054 NEW)
endif()
if(POLICY CMP0056)
cmake_policy(SET CMP0056 NEW) # try_compile(): link flags
endif()
if(POLICY CMP0066)
cmake_policy(SET CMP0066 NEW) # CMake 3.7: try_compile(): use per-config flags, like CMAKE_CXX_FLAGS_RELEASE
endif()
if(POLICY CMP0067)
cmake_policy(SET CMP0067 NEW) # CMake 3.8: try_compile(): honor language standard variables (like C++11)
endif()
if(POLICY CMP0068)
cmake_policy(SET CMP0068 NEW) # CMake 3.9+: `RPATH` settings on macOS do not affect `install_name`.
endif()
if(POLICY CMP0071)
cmake_policy(SET CMP0071 NEW) # CMake 3.10+: Let `AUTOMOC` and `AUTOUIC` process `GENERATED` files.
endif()
if(POLICY CMP0075)
cmake_policy(SET CMP0075 NEW) # CMake 3.12+: Include file check macros honor `CMAKE_REQUIRED_LIBRARIES`
endif()
if(POLICY CMP0077)
cmake_policy(SET CMP0077 NEW) # CMake 3.13+: option() honors normal variables.
endif()
if(POLICY CMP0091)
cmake_policy(SET CMP0091 NEW) # CMake 3.15+: leave MSVC runtime selection out of default CMAKE_<LANG>_FLAGS_<CONFIG> flags
endif()
if(POLICY CMP0146)
cmake_policy(SET CMP0146 OLD) # CMake 3.27+: use CMake FindCUDA if available.
endif()
if(POLICY CMP0148)
cmake_policy(SET CMP0148 OLD) # CMake 3.27+: use CMake FindPythonInterp and FindPythonLib if available.
endif()
#
# Configure OpenCV CMake hooks
#
include(cmake/OpenCVUtils.cmake)
ocv_cmake_reset_hooks()
ocv_check_environment_variables(OPENCV_CMAKE_HOOKS_DIR)
if(DEFINED OPENCV_CMAKE_HOOKS_DIR)
foreach(__dir ${OPENCV_CMAKE_HOOKS_DIR})
get_filename_component(__dir "${__dir}" ABSOLUTE)
ocv_cmake_hook_register_dir(${__dir})
endforeach()
endif()
ocv_cmake_hook(CMAKE_INIT)
# must go before the project()/enable_language() commands
ocv_update(CMAKE_CONFIGURATION_TYPES "Debug;Release" CACHE STRING "Configs" FORCE)
if(NOT DEFINED CMAKE_BUILD_TYPE
AND NOT OPENCV_SKIP_DEFAULT_BUILD_TYPE
)
message(STATUS "'Release' build type is used by default. Use CMAKE_BUILD_TYPE to specify build type (Release or Debug)")
set(CMAKE_BUILD_TYPE "Release" CACHE STRING "Choose the type of build")
endif()
if(DEFINED CMAKE_BUILD_TYPE)
set_property(CACHE CMAKE_BUILD_TYPE PROPERTY STRINGS "${CMAKE_CONFIGURATION_TYPES}")
endif()
option(ENABLE_PIC "Generate position independent code (necessary for shared libraries)" TRUE)
set(CMAKE_POSITION_INDEPENDENT_CODE ${ENABLE_PIC})
ocv_cmake_hook(PRE_CMAKE_BOOTSTRAP)
# Bootstrap CMake system: setup CMAKE_SYSTEM_NAME and other vars
# workaround: https://gitlab.kitware.com/cmake/cmake/-/issues/20989
if(OPENCV_WORKAROUND_CMAKE_20989)
set(CMAKE_SYSTEM_PROCESSOR_BACKUP ${CMAKE_SYSTEM_PROCESSOR})
endif()
project(OpenCV CXX C)
if(OPENCV_WORKAROUND_CMAKE_20989)
set(CMAKE_SYSTEM_PROCESSOR ${CMAKE_SYSTEM_PROCESSOR_BACKUP})
endif()
enable_testing()
ocv_cmake_hook(POST_CMAKE_BOOTSTRAP)
if(NOT OPENCV_SKIP_CMAKE_SYSTEM_FILE)
include("cmake/platforms/OpenCV-${CMAKE_SYSTEM_NAME}.cmake" OPTIONAL RESULT_VARIABLE "OPENCV_CMAKE_SYSTEM_FILE")
if(NOT OPENCV_CMAKE_SYSTEM_FILE)
message(STATUS "OpenCV: system-specific configuration file is not found: '${CMAKE_SYSTEM_NAME}'")
endif()
endif()
if(CMAKE_INSTALL_PREFIX_INITIALIZED_TO_DEFAULT) # https://cmake.org/cmake/help/latest/variable/CMAKE_INSTALL_PREFIX_INITIALIZED_TO_DEFAULT.html
if(NOT CMAKE_CROSSCOMPILING)
if(WIN32)
set(CMAKE_INSTALL_PREFIX "${CMAKE_BINARY_DIR}/install" CACHE PATH "Installation Directory" FORCE)
else()
set(CMAKE_INSTALL_PREFIX "/usr/local" CACHE PATH "Installation Directory" FORCE)
endif()
else()
# any cross-compiling
set(CMAKE_INSTALL_PREFIX "${CMAKE_BINARY_DIR}/install" CACHE PATH "Installation Directory" FORCE)
endif()
endif()
if(MSVC)
set(CMAKE_USE_RELATIVE_PATHS ON CACHE INTERNAL "" FORCE)
endif()
ocv_cmake_eval(DEBUG_PRE ONCE)
ocv_clear_vars(OpenCVModules_TARGETS)
# ----------------------------------------------------------------------------
# Autodetect if we are in a GIT repository
# ----------------------------------------------------------------------------
find_host_package(Git QUIET)
if(NOT DEFINED OPENCV_VCSVERSION AND GIT_FOUND)
ocv_git_describe(OPENCV_VCSVERSION "${OpenCV_SOURCE_DIR}")
elseif(NOT DEFINED OPENCV_VCSVERSION)
# We don't have git:
set(OPENCV_VCSVERSION "unknown")
endif()
include(cmake/OpenCVDownload.cmake)
# ----------------------------------------------------------------------------
# Detect compiler and target platform architecture
# ----------------------------------------------------------------------------
include(cmake/OpenCVDetectCXXCompiler.cmake)
ocv_cmake_hook(POST_DETECT_COMPILER)
# ----------------------------------------------------------------------------
# OpenCV cmake options
# ----------------------------------------------------------------------------
set(BUILD_LIST "" CACHE STRING "Build only listed modules (comma-separated, e.g. 'videoio,dnn,ts')")
OCV_OPTION(OPENCV_ENABLE_NONFREE "Enable non-free algorithms" OFF)
# 3rd party libs
OCV_OPTION(OPENCV_FORCE_3RDPARTY_BUILD "Force using 3rdparty code from source" OFF)
OCV_OPTION(BUILD_ZLIB "Build zlib from source" (WIN32 OR APPLE OR OPENCV_FORCE_3RDPARTY_BUILD) )
OCV_OPTION(BUILD_TIFF "Build libtiff from source" (WIN32 OR ANDROID OR APPLE OR OPENCV_FORCE_3RDPARTY_BUILD) )
OCV_OPTION(BUILD_OPENJPEG "Build OpenJPEG from source" (WIN32 OR ANDROID OR APPLE OR OPENCV_FORCE_3RDPARTY_BUILD) )
OCV_OPTION(BUILD_JASPER "Build libjasper from source" (WIN32 OR ANDROID OR APPLE OR OPENCV_FORCE_3RDPARTY_BUILD) )
OCV_OPTION(BUILD_JPEG "Build libjpeg from source" (WIN32 OR ANDROID OR APPLE OR OPENCV_FORCE_3RDPARTY_BUILD) )
OCV_OPTION(BUILD_PNG "Build libpng from source" (WIN32 OR ANDROID OR APPLE OR OPENCV_FORCE_3RDPARTY_BUILD) )
OCV_OPTION(BUILD_OPENEXR "Build openexr from source" (OPENCV_FORCE_3RDPARTY_BUILD) )
OCV_OPTION(BUILD_WEBP "Build WebP from source" (((WIN32 OR ANDROID OR APPLE) AND NOT WINRT) OR OPENCV_FORCE_3RDPARTY_BUILD) )
OCV_OPTION(BUILD_TBB "Download and build TBB from source" (ANDROID OR OPENCV_FORCE_3RDPARTY_BUILD) )
OCV_OPTION(BUILD_IPP_IW "Build IPP IW from source" (NOT MINGW OR OPENCV_FORCE_3RDPARTY_BUILD) IF (X86_64 OR X86) AND NOT WINRT )
OCV_OPTION(BUILD_ITT "Build Intel ITT from source"
没有合适的资源?快使用搜索试试~ 我知道了~
Open Source Computer Vision Library.rar
共2000个文件
cpp:755个
hpp:308个
py:223个
需积分: 5 0 下载量 152 浏览量
2024-10-08
15:07:52
上传
评论
收藏 95.19MB RAR 举报
温馨提示
opencv
资源推荐
资源详情
资源评论
收起资源包目录
Open Source Computer Vision Library.rar (2000个子文件)
impl.c 15KB
ts_gtest.cpp 407KB
connectedcomponents.cpp 324KB
ocl.cpp 246KB
colormap.cpp 177KB
color_lab.cpp 174KB
resize.cpp 168KB
softfloat.cpp 164KB
imgwarp.cpp 155KB
dxt.cpp 153KB
test_math.cpp 128KB
gl_core_3_1.cpp 124KB
cap_dshow.cpp 124KB
histogram.cpp 115KB
test_color.cpp 111KB
test_arithm.cpp 105KB
datastructs.cpp 99KB
hershey_fonts.cpp 98KB
ts_func.cpp 97KB
drawing.cpp 97KB
mathfuncs.cpp 93KB
hough.cpp 88KB
system.cpp 87KB
array.cpp 87KB
test_filter.cpp 85KB
Mat.cpp 83KB
persistence.cpp 82KB
test_mat.cpp 81KB
svm.cpp 79KB
arithm.cpp 78KB
test_ds.cpp 77KB
demosaicing.cpp 74KB
ts_perf.cpp 73KB
pyramids.cpp 72KB
minmax.cpp 65KB
min_enclosing_triangle.cpp 65KB
test_io.cpp 64KB
directx.cpp 63KB
filter.dispatch.cpp 62KB
contours.cpp 59KB
test_histograms.cpp 58KB
thresh.cpp 57KB
test_arithm.cpp 57KB
grfmt_tiff.cpp 57KB
tree.cpp 57KB
test_operations.cpp 56KB
test_imgwarp.cpp 55KB
norm.cpp 54KB
lapack.cpp 52KB
matrix_wrap.cpp 52KB
opengl.cpp 52KB
test_tiff.cpp 51KB
morph.dispatch.cpp 51KB
ann_mlp.cpp 50KB
stackblur.cpp 46KB
matmul.dispatch.cpp 45KB
templmatch.cpp 43KB
matrix_expressions.cpp 43KB
matrix_operations.cpp 42KB
test_imgwarp_strict.cpp 42KB
lda.cpp 42KB
shapedescr.cpp 41KB
gbt.cpp 40KB
lsd.cpp 40KB
audio_spectrogram.cpp 40KB
loadsave.cpp 40KB
test_drawing.cpp 40KB
test_umat.cpp 39KB
matrix_transform.cpp 38KB
test_convhull.cpp 38KB
OcvTransform.cpp 38KB
perf_arithm.cpp 37KB
test_templmatch.cpp 37KB
umatrix.cpp 37KB
copy.cpp 37KB
face_beautification.cpp 36KB
matrix.cpp 36KB
data.cpp 36KB
emd.cpp 35KB
canny.cpp 35KB
opencl-opencv-interop.cpp 34KB
ts.cpp 34KB
trace.cpp 34KB
cuda_info.cpp 33KB
camera_calibration.cpp 33KB
stitching_detailed.cpp 32KB
deriv.cpp 32KB
generalized_hough.cpp 31KB
core_bindings.cpp 31KB
va_intel.cpp 31KB
test_connectedcomponents.cpp 31KB
approx.cpp 31KB
smooth.dispatch.cpp 30KB
geometry.cpp 30KB
parallel.cpp 30KB
container_avi.cpp 29KB
calibration.cpp 29KB
grfmt_exr.cpp 29KB
rand.cpp 28KB
em.cpp 28KB
共 2000 条
- 1
- 2
- 3
- 4
- 5
- 6
- 20
资源评论
徐浪老师
- 粉丝: 8196
- 资源: 9015
上传资源 快速赚钱
- 我的内容管理 展开
- 我的资源 快来上传第一个资源
- 我的收益 登录查看自己的收益
- 我的积分 登录查看自己的积分
- 我的C币 登录后查看C币余额
- 我的收藏
- 我的下载
- 下载帮助
最新资源
- syntax_error如何解决.md
- java.性能监控Prometheus.md
- file_not_found_error如何解决.md
- io_error如何解决.md
- java.Grafana.md
- MeshFormatUnsupportedException解决办法.md
- IncompatibleGraphicsVersionException解决办法.md
- eof_error如何解决.md
- java.控制结构.md
- permission_error如何解决.md
- GraphicsApiNotSupportedException解决办法.md
- java.if.md
- MultiThreadRenderingFailureException解决办法.md
- java.for.md
- out_of_bounds_error如何解决.md
- java.while.md
资源上传下载、课程学习等过程中有任何疑问或建议,欢迎提出宝贵意见哦~我们会及时处理!
点击此处反馈
安全验证
文档复制为VIP权益,开通VIP直接复制
信息提交成功