mirror of
https://github.com/opencv/opencv.git
synced 2025-01-10 14:19:03 +08:00
Merge pull request #26585 from FantasqueX:clean-up-cmake-1
Clean up cmake after upgrading cmake_minimum_required to 3.13
This commit is contained in:
commit
76c2d01938
@ -1091,12 +1091,6 @@ endfunction()
|
|||||||
##############################################################################
|
##############################################################################
|
||||||
|
|
||||||
macro(CUDA_WRAP_SRCS cuda_target format generated_files)
|
macro(CUDA_WRAP_SRCS cuda_target format generated_files)
|
||||||
|
|
||||||
# If CMake doesn't support separable compilation, complain
|
|
||||||
if(CUDA_SEPARABLE_COMPILATION AND CMAKE_VERSION VERSION_LESS "2.8.10.1")
|
|
||||||
message(SEND_ERROR "CUDA_SEPARABLE_COMPILATION isn't supported for CMake versions less than 2.8.10.1")
|
|
||||||
endif()
|
|
||||||
|
|
||||||
# Set up all the command line flags here, so that they can be overridden on a per target basis.
|
# Set up all the command line flags here, so that they can be overridden on a per target basis.
|
||||||
|
|
||||||
set(nvcc_flags "")
|
set(nvcc_flags "")
|
||||||
|
@ -379,7 +379,7 @@ endif()
|
|||||||
|
|
||||||
# Apply "-Wl,--as-needed" linker flags: https://github.com/opencv/opencv/issues/7001
|
# Apply "-Wl,--as-needed" linker flags: https://github.com/opencv/opencv/issues/7001
|
||||||
if(NOT OPENCV_SKIP_LINK_AS_NEEDED)
|
if(NOT OPENCV_SKIP_LINK_AS_NEEDED)
|
||||||
if(UNIX AND (NOT APPLE OR NOT CMAKE_VERSION VERSION_LESS "3.2"))
|
if(UNIX)
|
||||||
set(_option "-Wl,--as-needed")
|
set(_option "-Wl,--as-needed")
|
||||||
set(_saved_CMAKE_EXE_LINKER_FLAGS "${CMAKE_EXE_LINKER_FLAGS}")
|
set(_saved_CMAKE_EXE_LINKER_FLAGS "${CMAKE_EXE_LINKER_FLAGS}")
|
||||||
set(CMAKE_EXE_LINKER_FLAGS "${CMAKE_EXE_LINKER_FLAGS} ${_option}") # requires CMake 3.2+ and CMP0056
|
set(CMAKE_EXE_LINKER_FLAGS "${CMAKE_EXE_LINKER_FLAGS} ${_option}") # requires CMake 3.2+ and CMP0056
|
||||||
@ -395,7 +395,7 @@ endif()
|
|||||||
|
|
||||||
# Apply "-Wl,--no-undefined" linker flags: https://github.com/opencv/opencv/pull/21347
|
# Apply "-Wl,--no-undefined" linker flags: https://github.com/opencv/opencv/pull/21347
|
||||||
if(NOT OPENCV_SKIP_LINK_NO_UNDEFINED)
|
if(NOT OPENCV_SKIP_LINK_NO_UNDEFINED)
|
||||||
if(UNIX AND ((NOT APPLE OR NOT CMAKE_VERSION VERSION_LESS "3.2") AND NOT CMAKE_SYSTEM_NAME MATCHES "OpenBSD"))
|
if(UNIX AND (NOT CMAKE_SYSTEM_NAME MATCHES "OpenBSD"))
|
||||||
set(_option "-Wl,--no-undefined")
|
set(_option "-Wl,--no-undefined")
|
||||||
set(_saved_CMAKE_EXE_LINKER_FLAGS "${CMAKE_EXE_LINKER_FLAGS}")
|
set(_saved_CMAKE_EXE_LINKER_FLAGS "${CMAKE_EXE_LINKER_FLAGS}")
|
||||||
set(CMAKE_EXE_LINKER_FLAGS "${CMAKE_EXE_LINKER_FLAGS} ${_option}") # requires CMake 3.2+ and CMP0056
|
set(CMAKE_EXE_LINKER_FLAGS "${CMAKE_EXE_LINKER_FLAGS} ${_option}") # requires CMake 3.2+ and CMP0056
|
||||||
|
@ -14,9 +14,7 @@ if(CUDA_TOOLKIT_ROOT_DIR)
|
|||||||
set(CUDA_TOOLKIT_TARGET_DIR ${CUDA_TOOLKIT_ROOT_DIR})
|
set(CUDA_TOOLKIT_TARGET_DIR ${CUDA_TOOLKIT_ROOT_DIR})
|
||||||
endif()
|
endif()
|
||||||
|
|
||||||
if(((NOT CMAKE_VERSION VERSION_LESS "3.9.0") # requires https://gitlab.kitware.com/cmake/cmake/merge_requests/663
|
if(NOT OPENCV_CUDA_FORCE_BUILTIN_CMAKE_MODULE)
|
||||||
OR OPENCV_CUDA_FORCE_EXTERNAL_CMAKE_MODULE)
|
|
||||||
AND NOT OPENCV_CUDA_FORCE_BUILTIN_CMAKE_MODULE)
|
|
||||||
ocv_update(CUDA_LINK_LIBRARIES_KEYWORD "PRIVATE")
|
ocv_update(CUDA_LINK_LIBRARIES_KEYWORD "PRIVATE")
|
||||||
find_host_package(CUDA "${MIN_VER_CUDA}" QUIET)
|
find_host_package(CUDA "${MIN_VER_CUDA}" QUIET)
|
||||||
else()
|
else()
|
||||||
|
@ -113,9 +113,7 @@ macro(ocv_initialize_nvidia_device_generations)
|
|||||||
list(APPEND _generations "Auto")
|
list(APPEND _generations "Auto")
|
||||||
endif()
|
endif()
|
||||||
set(CUDA_GENERATION "" CACHE STRING "Build CUDA device code only for specific GPU architecture. Leave empty to build for all architectures (see https://docs.opencv.org/5.x/d2/dbc/cuda_intro.html).")
|
set(CUDA_GENERATION "" CACHE STRING "Build CUDA device code only for specific GPU architecture. Leave empty to build for all architectures (see https://docs.opencv.org/5.x/d2/dbc/cuda_intro.html).")
|
||||||
if( CMAKE_VERSION VERSION_GREATER "2.8" )
|
|
||||||
set_property( CACHE CUDA_GENERATION PROPERTY STRINGS "" ${_generations} )
|
set_property( CACHE CUDA_GENERATION PROPERTY STRINGS "" ${_generations} )
|
||||||
endif()
|
|
||||||
|
|
||||||
if(CUDA_GENERATION)
|
if(CUDA_GENERATION)
|
||||||
if(NOT ";${_generations};" MATCHES ";${CUDA_GENERATION};")
|
if(NOT ";${_generations};" MATCHES ";${CUDA_GENERATION};")
|
||||||
|
@ -84,16 +84,12 @@ if(NOT ${found})
|
|||||||
"Consider providing the '${executable}' variable via CMake command line or environment variables\n")
|
"Consider providing the '${executable}' variable via CMake command line or environment variables\n")
|
||||||
endif()
|
endif()
|
||||||
ocv_clear_vars(PYTHONINTERP_FOUND PYTHON_EXECUTABLE PYTHON_VERSION_STRING PYTHON_VERSION_MAJOR PYTHON_VERSION_MINOR PYTHON_VERSION_PATCH)
|
ocv_clear_vars(PYTHONINTERP_FOUND PYTHON_EXECUTABLE PYTHON_VERSION_STRING PYTHON_VERSION_MAJOR PYTHON_VERSION_MINOR PYTHON_VERSION_PATCH)
|
||||||
if(NOT CMAKE_VERSION VERSION_LESS "3.12")
|
|
||||||
set(__PYTHON_PREFIX Python3)
|
set(__PYTHON_PREFIX Python3)
|
||||||
find_host_package(${__PYTHON_PREFIX} "${preferred_version}" COMPONENTS Interpreter)
|
find_host_package(${__PYTHON_PREFIX} "${preferred_version}" COMPONENTS Interpreter)
|
||||||
if(${__PYTHON_PREFIX}_EXECUTABLE)
|
if(${__PYTHON_PREFIX}_EXECUTABLE)
|
||||||
set(PYTHON_EXECUTABLE "${${__PYTHON_PREFIX}_EXECUTABLE}")
|
set(PYTHON_EXECUTABLE "${${__PYTHON_PREFIX}_EXECUTABLE}")
|
||||||
find_host_package(PythonInterp "${preferred_version}") # Populate other variables
|
find_host_package(PythonInterp "${preferred_version}") # Populate other variables
|
||||||
endif()
|
endif()
|
||||||
else()
|
|
||||||
message(STATUS "Consider using CMake 3.12+ for better Python support")
|
|
||||||
endif()
|
|
||||||
endif()
|
endif()
|
||||||
if(PYTHONINTERP_FOUND AND "${_python_version_major}" STREQUAL "${PYTHON_VERSION_MAJOR}")
|
if(PYTHONINTERP_FOUND AND "${_python_version_major}" STREQUAL "${PYTHON_VERSION_MAJOR}")
|
||||||
# Copy outputs
|
# Copy outputs
|
||||||
|
@ -168,13 +168,9 @@ macro(ipp_detect_version)
|
|||||||
)
|
)
|
||||||
AND NOT OPENCV_SKIP_IPP_EXCLUDE_LIBS_CORE
|
AND NOT OPENCV_SKIP_IPP_EXCLUDE_LIBS_CORE
|
||||||
)
|
)
|
||||||
if(CMAKE_VERSION VERSION_LESS "3.13.0")
|
|
||||||
set(CMAKE_SHARED_LINKER_FLAGS "-Wl,--exclude-libs,${_filename} ${CMAKE_SHARED_LINKER_FLAGS}")
|
|
||||||
else()
|
|
||||||
target_link_options(ipp${name} INTERFACE "LINKER:--exclude-libs,${_filename}")
|
target_link_options(ipp${name} INTERFACE "LINKER:--exclude-libs,${_filename}")
|
||||||
endif()
|
endif()
|
||||||
endif()
|
endif()
|
||||||
endif()
|
|
||||||
list(APPEND IPP_LIBRARIES ipp${name})
|
list(APPEND IPP_LIBRARIES ipp${name})
|
||||||
if (NOT BUILD_SHARED_LIBS AND (HAVE_IPP_ICV OR ";${OPENCV_INSTALL_EXTERNAL_DEPENDENCIES};" MATCHES ";ipp;"))
|
if (NOT BUILD_SHARED_LIBS AND (HAVE_IPP_ICV OR ";${OPENCV_INSTALL_EXTERNAL_DEPENDENCIES};" MATCHES ";ipp;"))
|
||||||
# CMake doesn't support "install(TARGETS ${IPP_PREFIX}${name} " command with imported targets
|
# CMake doesn't support "install(TARGETS ${IPP_PREFIX}${name} " command with imported targets
|
||||||
|
@ -55,10 +55,7 @@ endif(WITH_CUDA)
|
|||||||
|
|
||||||
# --- Eigen ---
|
# --- Eigen ---
|
||||||
if(WITH_EIGEN AND NOT HAVE_EIGEN)
|
if(WITH_EIGEN AND NOT HAVE_EIGEN)
|
||||||
if((OPENCV_FORCE_EIGEN_FIND_PACKAGE_CONFIG
|
if(NOT OPENCV_SKIP_EIGEN_FIND_PACKAGE_CONFIG)
|
||||||
OR NOT (CMAKE_VERSION VERSION_LESS "3.0.0") # Eigen3Targets.cmake required CMake 3.0.0+
|
|
||||||
) AND NOT OPENCV_SKIP_EIGEN_FIND_PACKAGE_CONFIG
|
|
||||||
)
|
|
||||||
find_package(Eigen3 CONFIG QUIET) # Ceres 2.0.0 CMake scripts doesn't work with CMake's FindEigen3.cmake module (due to missing EIGEN3_VERSION_STRING)
|
find_package(Eigen3 CONFIG QUIET) # Ceres 2.0.0 CMake scripts doesn't work with CMake's FindEigen3.cmake module (due to missing EIGEN3_VERSION_STRING)
|
||||||
endif()
|
endif()
|
||||||
if(NOT Eigen3_FOUND)
|
if(NOT Eigen3_FOUND)
|
||||||
|
@ -373,7 +373,7 @@ function(ocv_target_include_directories target)
|
|||||||
endif()
|
endif()
|
||||||
endif()
|
endif()
|
||||||
endforeach()
|
endforeach()
|
||||||
if(HAVE_CUDA OR CMAKE_VERSION VERSION_LESS 2.8.11)
|
if(HAVE_CUDA)
|
||||||
include_directories(${__params})
|
include_directories(${__params})
|
||||||
include_directories(SYSTEM ${__system_params})
|
include_directories(SYSTEM ${__system_params})
|
||||||
else()
|
else()
|
||||||
@ -915,15 +915,9 @@ if(DEFINED ENV{BUILD_USE_SYMLINKS})
|
|||||||
endif()
|
endif()
|
||||||
OCV_OPTION(BUILD_USE_SYMLINKS "Use symlinks instead of files copying during build (and !!INSTALL!!)" (${__symlink_default}) IF (UNIX OR DEFINED __symlink_default))
|
OCV_OPTION(BUILD_USE_SYMLINKS "Use symlinks instead of files copying during build (and !!INSTALL!!)" (${__symlink_default}) IF (UNIX OR DEFINED __symlink_default))
|
||||||
|
|
||||||
if(CMAKE_VERSION VERSION_LESS "3.2")
|
macro(ocv_cmake_byproducts var_name)
|
||||||
macro(ocv_cmake_byproducts var_name)
|
|
||||||
set(${var_name}) # nothing
|
|
||||||
endmacro()
|
|
||||||
else()
|
|
||||||
macro(ocv_cmake_byproducts var_name)
|
|
||||||
set(${var_name} BYPRODUCTS ${ARGN})
|
set(${var_name} BYPRODUCTS ${ARGN})
|
||||||
endmacro()
|
endmacro()
|
||||||
endif()
|
|
||||||
|
|
||||||
set(OPENCV_DEPHELPER "${CMAKE_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/dephelper" CACHE INTERNAL "")
|
set(OPENCV_DEPHELPER "${CMAKE_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/dephelper" CACHE INTERNAL "")
|
||||||
file(MAKE_DIRECTORY ${OPENCV_DEPHELPER})
|
file(MAKE_DIRECTORY ${OPENCV_DEPHELPER})
|
||||||
@ -1267,13 +1261,8 @@ function(ocv_install_target)
|
|||||||
|
|
||||||
# don't move this into global scope of this file: compiler settings (like MSVC variable) are not available during processing
|
# don't move this into global scope of this file: compiler settings (like MSVC variable) are not available during processing
|
||||||
if(BUILD_SHARED_LIBS) # no defaults for static libs (modern CMake is required)
|
if(BUILD_SHARED_LIBS) # no defaults for static libs (modern CMake is required)
|
||||||
if(NOT CMAKE_VERSION VERSION_LESS 3.6.0)
|
|
||||||
option(INSTALL_PDB_COMPONENT_EXCLUDE_FROM_ALL "Don't install PDB files by default" ON)
|
option(INSTALL_PDB_COMPONENT_EXCLUDE_FROM_ALL "Don't install PDB files by default" ON)
|
||||||
option(INSTALL_PDB "Add install PDB rules" ON)
|
option(INSTALL_PDB "Add install PDB rules" ON)
|
||||||
elseif(NOT CMAKE_VERSION VERSION_LESS 3.1.0)
|
|
||||||
option(INSTALL_PDB_COMPONENT_EXCLUDE_FROM_ALL "Don't install PDB files by default (not supported)" OFF)
|
|
||||||
option(INSTALL_PDB "Add install PDB rules" OFF)
|
|
||||||
endif()
|
|
||||||
endif()
|
endif()
|
||||||
|
|
||||||
if(INSTALL_PDB AND NOT INSTALL_IGNORE_PDB
|
if(INSTALL_PDB AND NOT INSTALL_IGNORE_PDB
|
||||||
@ -1305,18 +1294,13 @@ function(ocv_install_target)
|
|||||||
|
|
||||||
# message(STATUS "Process ${__target} dst=${__dst}...")
|
# message(STATUS "Process ${__target} dst=${__dst}...")
|
||||||
if(DEFINED __dst)
|
if(DEFINED __dst)
|
||||||
if(NOT CMAKE_VERSION VERSION_LESS 3.1.0)
|
|
||||||
set(__pdb_install_component "pdb")
|
set(__pdb_install_component "pdb")
|
||||||
if(DEFINED INSTALL_PDB_COMPONENT AND INSTALL_PDB_COMPONENT)
|
if(DEFINED INSTALL_PDB_COMPONENT AND INSTALL_PDB_COMPONENT)
|
||||||
set(__pdb_install_component "${INSTALL_PDB_COMPONENT}")
|
set(__pdb_install_component "${INSTALL_PDB_COMPONENT}")
|
||||||
endif()
|
endif()
|
||||||
set(__pdb_exclude_from_all "")
|
set(__pdb_exclude_from_all "")
|
||||||
if(INSTALL_PDB_COMPONENT_EXCLUDE_FROM_ALL)
|
if(INSTALL_PDB_COMPONENT_EXCLUDE_FROM_ALL)
|
||||||
if(NOT CMAKE_VERSION VERSION_LESS 3.6.0)
|
|
||||||
set(__pdb_exclude_from_all EXCLUDE_FROM_ALL)
|
set(__pdb_exclude_from_all EXCLUDE_FROM_ALL)
|
||||||
else()
|
|
||||||
message(WARNING "INSTALL_PDB_COMPONENT_EXCLUDE_FROM_ALL requires CMake 3.6+")
|
|
||||||
endif()
|
|
||||||
endif()
|
endif()
|
||||||
|
|
||||||
# message(STATUS "Adding PDB file installation rule: target=${__target} dst=${__dst} component=${__pdb_install_component}")
|
# message(STATUS "Adding PDB file installation rule: target=${__target} dst=${__dst} component=${__pdb_install_component}")
|
||||||
@ -1333,9 +1317,6 @@ function(ocv_install_target)
|
|||||||
DESTINATION "${__dst}" CONFIGURATIONS Release
|
DESTINATION "${__dst}" CONFIGURATIONS Release
|
||||||
COMPONENT ${__pdb_install_component} OPTIONAL ${__pdb_exclude_from_all})
|
COMPONENT ${__pdb_install_component} OPTIONAL ${__pdb_exclude_from_all})
|
||||||
endif()
|
endif()
|
||||||
else()
|
|
||||||
message(WARNING "PDB files installation is not supported (need CMake >= 3.1.0)")
|
|
||||||
endif()
|
|
||||||
endif()
|
endif()
|
||||||
endif()
|
endif()
|
||||||
endif()
|
endif()
|
||||||
@ -1628,45 +1609,19 @@ function(ocv_add_external_target name inc link def)
|
|||||||
endif()
|
endif()
|
||||||
add_library(ocv.3rdparty.${name} INTERFACE ${imp})
|
add_library(ocv.3rdparty.${name} INTERFACE ${imp})
|
||||||
if(def)
|
if(def)
|
||||||
if(NOT (CMAKE_VERSION VERSION_LESS "3.11.0")) # https://gitlab.kitware.com/cmake/cmake/-/merge_requests/1264 : eliminates "Cannot specify compile definitions for imported target" error message
|
|
||||||
target_compile_definitions(ocv.3rdparty.${name} INTERFACE "${def}")
|
target_compile_definitions(ocv.3rdparty.${name} INTERFACE "${def}")
|
||||||
else()
|
|
||||||
set_target_properties(ocv.3rdparty.${name} PROPERTIES INTERFACE_COMPILE_DEFINITIONS "${def}")
|
|
||||||
endif()
|
|
||||||
endif()
|
endif()
|
||||||
if(inc)
|
if(inc)
|
||||||
if(NOT (CMAKE_VERSION VERSION_LESS "3.11.0")) # https://gitlab.kitware.com/cmake/cmake/-/merge_requests/1264 : eliminates "Cannot specify compile definitions for imported target" error message
|
|
||||||
target_include_directories(ocv.3rdparty.${name} SYSTEM INTERFACE "$<BUILD_INTERFACE:${inc}>")
|
target_include_directories(ocv.3rdparty.${name} SYSTEM INTERFACE "$<BUILD_INTERFACE:${inc}>")
|
||||||
else()
|
|
||||||
set_target_properties(ocv.3rdparty.${name} PROPERTIES
|
|
||||||
INTERFACE_INCLUDE_DIRECTORIES "$<BUILD_INTERFACE:${inc}>"
|
|
||||||
INTERFACE_SYSTEM_INCLUDE_DIRECTORIES "$<BUILD_INTERFACE:${inc}>"
|
|
||||||
)
|
|
||||||
endif()
|
|
||||||
endif()
|
endif()
|
||||||
if(link)
|
if(link)
|
||||||
# When cmake version is greater than or equal to 3.11, INTERFACE_LINK_LIBRARIES no longer applies to interface library
|
|
||||||
# See https://github.com/opencv/opencv/pull/18658
|
|
||||||
if(CMAKE_VERSION VERSION_LESS 3.11)
|
|
||||||
set_target_properties(ocv.3rdparty.${name} PROPERTIES
|
|
||||||
INTERFACE_LINK_LIBRARIES "${link}")
|
|
||||||
else()
|
|
||||||
target_link_libraries(ocv.3rdparty.${name} INTERFACE ${link})
|
target_link_libraries(ocv.3rdparty.${name} INTERFACE ${link})
|
||||||
endif()
|
endif()
|
||||||
endif()
|
|
||||||
# to install used target only upgrade CMake
|
|
||||||
if(NOT BUILD_SHARED_LIBS
|
|
||||||
AND CMAKE_VERSION VERSION_LESS "3.13.0" # https://gitlab.kitware.com/cmake/cmake/-/merge_requests/2152
|
|
||||||
)
|
|
||||||
install(TARGETS ocv.3rdparty.${name} EXPORT OpenCVModules)
|
|
||||||
endif()
|
|
||||||
endfunction()
|
endfunction()
|
||||||
|
|
||||||
set(__OPENCV_EXPORTED_EXTERNAL_TARGETS "" CACHE INTERNAL "")
|
set(__OPENCV_EXPORTED_EXTERNAL_TARGETS "" CACHE INTERNAL "")
|
||||||
function(ocv_install_used_external_targets)
|
function(ocv_install_used_external_targets)
|
||||||
if(NOT BUILD_SHARED_LIBS
|
if(NOT BUILD_SHARED_LIBS)
|
||||||
AND NOT (CMAKE_VERSION VERSION_LESS "3.13.0") # upgrade CMake: https://gitlab.kitware.com/cmake/cmake/-/merge_requests/2152
|
|
||||||
)
|
|
||||||
foreach(tgt in ${ARGN})
|
foreach(tgt in ${ARGN})
|
||||||
if(tgt MATCHES "^ocv\.3rdparty\.")
|
if(tgt MATCHES "^ocv\.3rdparty\.")
|
||||||
list(FIND __OPENCV_EXPORTED_EXTERNAL_TARGETS "${tgt}" _found)
|
list(FIND __OPENCV_EXPORTED_EXTERNAL_TARGETS "${tgt}" _found)
|
||||||
@ -1784,7 +1739,7 @@ endmacro()
|
|||||||
|
|
||||||
|
|
||||||
function(ocv_add_test_from_target test_name test_kind the_target)
|
function(ocv_add_test_from_target test_name test_kind the_target)
|
||||||
if(CMAKE_VERSION VERSION_GREATER "2.8" AND NOT CMAKE_CROSSCOMPILING)
|
if(NOT CMAKE_CROSSCOMPILING)
|
||||||
if(NOT "${test_kind}" MATCHES "^(Accuracy|Performance|Sanity)$")
|
if(NOT "${test_kind}" MATCHES "^(Accuracy|Performance|Sanity)$")
|
||||||
message(FATAL_ERROR "Unknown test kind : ${test_kind}")
|
message(FATAL_ERROR "Unknown test kind : ${test_kind}")
|
||||||
endif()
|
endif()
|
||||||
@ -1979,12 +1934,7 @@ macro(ocv_get_smart_file_name output_var fpath)
|
|||||||
endmacro()
|
endmacro()
|
||||||
|
|
||||||
# Needed by install(DIRECTORY ...)
|
# Needed by install(DIRECTORY ...)
|
||||||
if(NOT CMAKE_VERSION VERSION_LESS 3.1)
|
set(compatible_MESSAGE_NEVER MESSAGE_NEVER)
|
||||||
set(compatible_MESSAGE_NEVER MESSAGE_NEVER)
|
|
||||||
else()
|
|
||||||
set(compatible_MESSAGE_NEVER "")
|
|
||||||
endif()
|
|
||||||
|
|
||||||
|
|
||||||
macro(ocv_git_describe var_name path)
|
macro(ocv_git_describe var_name path)
|
||||||
if(GIT_FOUND)
|
if(GIT_FOUND)
|
||||||
|
@ -1,7 +1,3 @@
|
|||||||
if(CMAKE_VERSION VERSION_LESS "3.9")
|
|
||||||
message(STATUS "OpenMP detection requires CMake 3.9+") # OpenMP::OpenMP_CXX target
|
|
||||||
endif()
|
|
||||||
|
|
||||||
find_package(OpenMP)
|
find_package(OpenMP)
|
||||||
if(OpenMP_FOUND)
|
if(OpenMP_FOUND)
|
||||||
if(TARGET OpenMP::OpenMP_CXX)
|
if(TARGET OpenMP::OpenMP_CXX)
|
||||||
|
@ -71,11 +71,9 @@ endforeach()
|
|||||||
include("tutorial_code/calib3d/real_time_pose_estimation/CMakeLists.txt" OPTIONAL)
|
include("tutorial_code/calib3d/real_time_pose_estimation/CMakeLists.txt" OPTIONAL)
|
||||||
|
|
||||||
# Standalone samples only
|
# Standalone samples only
|
||||||
if(OpenCV_FOUND AND NOT CMAKE_VERSION VERSION_LESS "3.1")
|
if(OpenCV_FOUND)
|
||||||
add_subdirectory("example_cmake")
|
add_subdirectory("example_cmake")
|
||||||
endif()
|
endif()
|
||||||
if(OpenCV_FOUND AND NOT CMAKE_VERSION VERSION_LESS "3.9"
|
if(OpenCV_FOUND AND NOT OPENCV_EXAMPLES_SKIP_PARALLEL_BACKEND)
|
||||||
AND NOT OPENCV_EXAMPLES_SKIP_PARALLEL_BACKEND
|
|
||||||
)
|
|
||||||
add_subdirectory("tutorial_code/core/parallel_backend")
|
add_subdirectory("tutorial_code/core/parallel_backend")
|
||||||
endif()
|
endif()
|
||||||
|
@ -1,11 +1,5 @@
|
|||||||
ocv_install_example_src(opencl *.cpp *.hpp CMakeLists.txt)
|
ocv_install_example_src(opencl *.cpp *.hpp CMakeLists.txt)
|
||||||
|
|
||||||
# cmake 3.1 needed for find_package(OpenCL)
|
|
||||||
if(CMAKE_VERSION VERSION_LESS "3.1")
|
|
||||||
message(STATUS "OpenCL samples require CMakes 3.1+")
|
|
||||||
return()
|
|
||||||
endif()
|
|
||||||
|
|
||||||
set(OPENCV_OPENCL_SAMPLES_REQUIRED_DEPS
|
set(OPENCV_OPENCL_SAMPLES_REQUIRED_DEPS
|
||||||
opencv_core
|
opencv_core
|
||||||
opencv_imgproc
|
opencv_imgproc
|
||||||
|
@ -16,13 +16,6 @@ if(NOT BUILD_EXAMPLES OR NOT OCV_DEPENDENCIES_FOUND OR OPENCV_SKIP_SAMPLES_BUILD
|
|||||||
return()
|
return()
|
||||||
endif()
|
endif()
|
||||||
|
|
||||||
if(CMAKE_VERSION VERSION_LESS "3.5")
|
|
||||||
message(STATUS "SYCL samples require CMake 3.5+")
|
|
||||||
return()
|
|
||||||
endif()
|
|
||||||
|
|
||||||
cmake_policy(VERSION 3.5)
|
|
||||||
|
|
||||||
find_package(SYCL QUIET) # will oneAPI support this straightforward way?
|
find_package(SYCL QUIET) # will oneAPI support this straightforward way?
|
||||||
|
|
||||||
if(NOT SYCL_FOUND AND NOT OPENCV_SKIP_SAMPLES_SYCL_ONEDNN)
|
if(NOT SYCL_FOUND AND NOT OPENCV_SKIP_SAMPLES_SYCL_ONEDNN)
|
||||||
|
Loading…
Reference in New Issue
Block a user