From e44e3ab0a7a9a8c08f531e68f55e7958e163d49f Mon Sep 17 00:00:00 2001 From: Maksim Shabunin Date: Tue, 29 Oct 2024 17:17:27 +0300 Subject: [PATCH] build: raise min cmake version to 3.13 in other places --- CMakeLists.txt | 10 +--------- cmake/OpenCVGenPkgconfig.cmake | 2 +- .../linux_gcc_cmake/linux_gcc_cmake.markdown | 2 +- .../core/misc/plugins/parallel_openmp/CMakeLists.txt | 2 +- modules/core/misc/plugins/parallel_tbb/CMakeLists.txt | 2 +- modules/gapi/CMakeLists.txt | 2 +- modules/highgui/misc/plugins/plugin_gtk/CMakeLists.txt | 2 +- modules/java/android_sdk/libcxx_helper/CMakeLists.txt | 2 +- modules/python/CMakeLists.txt | 2 +- modules/videoio/misc/plugin_ffmpeg/CMakeLists.txt | 2 +- modules/videoio/misc/plugin_gstreamer/CMakeLists.txt | 2 +- .../OpenCV/src/main/cpp/CMakeLists.txt.template | 2 +- platforms/android/build-tests/test_cmake_build.py | 2 +- platforms/linux/gnu.toolchain.cmake | 2 +- samples/CMakeLists.example.in | 2 +- samples/CMakeLists.txt | 2 +- .../tutorial-2-mixedprocessing/jni/CMakeLists.txt | 2 +- samples/android/tutorial-4-opencl/jni/CMakeLists.txt | 2 +- samples/cpp/example_cmake/CMakeLists.txt | 2 +- .../tutorial_code/core/parallel_backend/CMakeLists.txt | 2 +- .../gpu/gpu-thrust-interop/CMakeLists.txt | 4 ++-- samples/hal/c_hal/CMakeLists.txt | 2 +- samples/hal/slow_hal/CMakeLists.txt | 2 +- 23 files changed, 24 insertions(+), 32 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index 9e983bad79..3130dd36eb 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -15,15 +15,7 @@ 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() +cmake_minimum_required(VERSION "${MIN_VER_CMAKE}" FATAL_ERROR) # # Configure CMake policies diff --git a/cmake/OpenCVGenPkgconfig.cmake b/cmake/OpenCVGenPkgconfig.cmake index 52e18d8fc3..9fc2c91a97 100644 --- a/cmake/OpenCVGenPkgconfig.cmake +++ b/cmake/OpenCVGenPkgconfig.cmake @@ -110,7 +110,7 @@ endif() # ============================================================================= else() # DEFINED CMAKE_HELPER_SCRIPT -cmake_minimum_required(VERSION 2.8.12.2) +cmake_minimum_required(VERSION 3.13) cmake_policy(SET CMP0012 NEW) include("${CMAKE_HELPER_SCRIPT}") include("${OpenCV_SOURCE_DIR}/cmake/OpenCVUtils.cmake") diff --git a/doc/tutorials/introduction/linux_gcc_cmake/linux_gcc_cmake.markdown b/doc/tutorials/introduction/linux_gcc_cmake/linux_gcc_cmake.markdown index d08280db64..686f4584f8 100644 --- a/doc/tutorials/introduction/linux_gcc_cmake/linux_gcc_cmake.markdown +++ b/doc/tutorials/introduction/linux_gcc_cmake/linux_gcc_cmake.markdown @@ -61,7 +61,7 @@ int main(int argc, char** argv ) Now you have to create your CMakeLists.txt file. It should look like this: @code{.cmake} -cmake_minimum_required(VERSION 2.8) +cmake_minimum_required(VERSION 3.13) project( DisplayImage ) find_package( OpenCV REQUIRED ) include_directories( ${OpenCV_INCLUDE_DIRS} ) diff --git a/modules/core/misc/plugins/parallel_openmp/CMakeLists.txt b/modules/core/misc/plugins/parallel_openmp/CMakeLists.txt index 024d2046cf..bfe31448ab 100644 --- a/modules/core/misc/plugins/parallel_openmp/CMakeLists.txt +++ b/modules/core/misc/plugins/parallel_openmp/CMakeLists.txt @@ -1,4 +1,4 @@ -cmake_minimum_required(VERSION 3.5) +cmake_minimum_required(VERSION 3.13) project(opencv_core_parallel_openmp CXX) get_filename_component(OpenCV_SOURCE_DIR "${CMAKE_CURRENT_LIST_DIR}/../../../../.." ABSOLUTE) diff --git a/modules/core/misc/plugins/parallel_tbb/CMakeLists.txt b/modules/core/misc/plugins/parallel_tbb/CMakeLists.txt index c2129c7c2c..eff71fa7df 100644 --- a/modules/core/misc/plugins/parallel_tbb/CMakeLists.txt +++ b/modules/core/misc/plugins/parallel_tbb/CMakeLists.txt @@ -1,4 +1,4 @@ -cmake_minimum_required(VERSION 3.5) +cmake_minimum_required(VERSION 3.13) project(opencv_core_parallel_tbb CXX) get_filename_component(OpenCV_SOURCE_DIR "${CMAKE_CURRENT_LIST_DIR}/../../../../.." ABSOLUTE) diff --git a/modules/gapi/CMakeLists.txt b/modules/gapi/CMakeLists.txt index b324237b5b..6757c853bd 100644 --- a/modules/gapi/CMakeLists.txt +++ b/modules/gapi/CMakeLists.txt @@ -1,7 +1,7 @@ # FIXME: Rework standalone build in more generic maner # (Restructure directories, add common pass, etc) if(NOT DEFINED OPENCV_INITIAL_PASS) - cmake_minimum_required(VERSION 3.3) + cmake_minimum_required(VERSION 3.13) project(gapi_standalone) include("cmake/standalone.cmake") return() diff --git a/modules/highgui/misc/plugins/plugin_gtk/CMakeLists.txt b/modules/highgui/misc/plugins/plugin_gtk/CMakeLists.txt index c9cd0b6f1b..85b9137176 100644 --- a/modules/highgui/misc/plugins/plugin_gtk/CMakeLists.txt +++ b/modules/highgui/misc/plugins/plugin_gtk/CMakeLists.txt @@ -1,4 +1,4 @@ -cmake_minimum_required(VERSION 3.5) +cmake_minimum_required(VERSION 3.13) project(opencv_highgui_gtk) get_filename_component(OpenCV_SOURCE_DIR "${CMAKE_CURRENT_LIST_DIR}/../../../../.." ABSOLUTE) diff --git a/modules/java/android_sdk/libcxx_helper/CMakeLists.txt b/modules/java/android_sdk/libcxx_helper/CMakeLists.txt index c2dcd6d4d8..3c03be08da 100644 --- a/modules/java/android_sdk/libcxx_helper/CMakeLists.txt +++ b/modules/java/android_sdk/libcxx_helper/CMakeLists.txt @@ -1,4 +1,4 @@ -cmake_minimum_required(VERSION 3.6) +cmake_minimum_required(VERSION 3.13) project(opencv_jni_shared) diff --git a/modules/python/CMakeLists.txt b/modules/python/CMakeLists.txt index a13501e03f..da3d0823a2 100644 --- a/modules/python/CMakeLists.txt +++ b/modules/python/CMakeLists.txt @@ -25,7 +25,7 @@ add_subdirectory(python3) else() # standalone build -cmake_minimum_required(VERSION 2.8.12.2) +cmake_minimum_required(VERSION 3.13) project(OpenCVPython CXX C) include("./standalone.cmake") diff --git a/modules/videoio/misc/plugin_ffmpeg/CMakeLists.txt b/modules/videoio/misc/plugin_ffmpeg/CMakeLists.txt index 204a425b17..fa8b277e00 100644 --- a/modules/videoio/misc/plugin_ffmpeg/CMakeLists.txt +++ b/modules/videoio/misc/plugin_ffmpeg/CMakeLists.txt @@ -1,4 +1,4 @@ -cmake_minimum_required(VERSION 3.5) +cmake_minimum_required(VERSION 3.13) get_filename_component(OpenCV_SOURCE_DIR "${CMAKE_CURRENT_LIST_DIR}/../../../.." ABSOLUTE) include("${OpenCV_SOURCE_DIR}/cmake/OpenCVPluginStandalone.cmake") diff --git a/modules/videoio/misc/plugin_gstreamer/CMakeLists.txt b/modules/videoio/misc/plugin_gstreamer/CMakeLists.txt index b8e7aa5b55..5f3201f0e3 100644 --- a/modules/videoio/misc/plugin_gstreamer/CMakeLists.txt +++ b/modules/videoio/misc/plugin_gstreamer/CMakeLists.txt @@ -1,4 +1,4 @@ -cmake_minimum_required(VERSION 3.5) +cmake_minimum_required(VERSION 3.13) get_filename_component(OpenCV_SOURCE_DIR "${CMAKE_CURRENT_LIST_DIR}/../../../.." ABSOLUTE) include("${OpenCV_SOURCE_DIR}/cmake/OpenCVPluginStandalone.cmake") diff --git a/platforms/android/aar-template/OpenCV/src/main/cpp/CMakeLists.txt.template b/platforms/android/aar-template/OpenCV/src/main/cpp/CMakeLists.txt.template index 02ef035e0a..cdad9e89bb 100644 --- a/platforms/android/aar-template/OpenCV/src/main/cpp/CMakeLists.txt.template +++ b/platforms/android/aar-template/OpenCV/src/main/cpp/CMakeLists.txt.template @@ -1,4 +1,4 @@ -cmake_minimum_required(VERSION 3.6) +cmake_minimum_required(VERSION 3.13) project("opencv") diff --git a/platforms/android/build-tests/test_cmake_build.py b/platforms/android/build-tests/test_cmake_build.py index ffcbdc32ad..ce15a1bcb8 100644 --- a/platforms/android/build-tests/test_cmake_build.py +++ b/platforms/android/build-tests/test_cmake_build.py @@ -7,7 +7,7 @@ import logging as log log.basicConfig(format='%(message)s', level=log.DEBUG) CMAKE_TEMPLATE='''\ -CMAKE_MINIMUM_REQUIRED(VERSION 2.8) +CMAKE_MINIMUM_REQUIRED(VERSION 3.13) # Enable C++17 set(CMAKE_CXX_STANDARD 17) diff --git a/platforms/linux/gnu.toolchain.cmake b/platforms/linux/gnu.toolchain.cmake index 64258e65b3..1f3cc17636 100644 --- a/platforms/linux/gnu.toolchain.cmake +++ b/platforms/linux/gnu.toolchain.cmake @@ -1,4 +1,4 @@ -cmake_minimum_required(VERSION 3.5) +cmake_minimum_required(VERSION 3.13) # load settings in case of "try compile" set(TOOLCHAIN_CONFIG_FILE "${CMAKE_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/toolchain.config.cmake") diff --git a/samples/CMakeLists.example.in b/samples/CMakeLists.example.in index 7cf20d5e44..aa60fc1e60 100644 --- a/samples/CMakeLists.example.in +++ b/samples/CMakeLists.example.in @@ -1,5 +1,5 @@ # cmake needs this line -cmake_minimum_required(VERSION 3.1) +cmake_minimum_required(VERSION 3.13) if(NOT DEFINED EXAMPLE_NAME) message(FATAL_ERROR "Invalid build script: missing EXAMPLE_NAME") diff --git a/samples/CMakeLists.txt b/samples/CMakeLists.txt index 355a252185..933e2f9eff 100644 --- a/samples/CMakeLists.txt +++ b/samples/CMakeLists.txt @@ -59,7 +59,7 @@ else() # Standalone mode # #=================================================================================================== -cmake_minimum_required(VERSION 3.1) +cmake_minimum_required(VERSION 3.13) project(samples C CXX) option(BUILD_EXAMPLES "Build samples" ON) diff --git a/samples/android/tutorial-2-mixedprocessing/jni/CMakeLists.txt b/samples/android/tutorial-2-mixedprocessing/jni/CMakeLists.txt index 37e9a698bb..63356c3f10 100644 --- a/samples/android/tutorial-2-mixedprocessing/jni/CMakeLists.txt +++ b/samples/android/tutorial-2-mixedprocessing/jni/CMakeLists.txt @@ -1,4 +1,4 @@ -cmake_minimum_required(VERSION 3.6) +cmake_minimum_required(VERSION 3.13) set(target mixed_sample) project(${target} CXX) diff --git a/samples/android/tutorial-4-opencl/jni/CMakeLists.txt b/samples/android/tutorial-4-opencl/jni/CMakeLists.txt index d1a1dcf234..1cc2115579 100644 --- a/samples/android/tutorial-4-opencl/jni/CMakeLists.txt +++ b/samples/android/tutorial-4-opencl/jni/CMakeLists.txt @@ -1,4 +1,4 @@ -cmake_minimum_required(VERSION 3.6) +cmake_minimum_required(VERSION 3.13) set(target JNIpart) project(${target} CXX) diff --git a/samples/cpp/example_cmake/CMakeLists.txt b/samples/cpp/example_cmake/CMakeLists.txt index 8d5cd98af2..5f6ac01d9a 100644 --- a/samples/cpp/example_cmake/CMakeLists.txt +++ b/samples/cpp/example_cmake/CMakeLists.txt @@ -1,5 +1,5 @@ # cmake needs this line -cmake_minimum_required(VERSION 3.1) +cmake_minimum_required(VERSION 3.13) # Define project name project(opencv_example_project) diff --git a/samples/cpp/tutorial_code/core/parallel_backend/CMakeLists.txt b/samples/cpp/tutorial_code/core/parallel_backend/CMakeLists.txt index 1c8c8412a9..0a18bb96c2 100644 --- a/samples/cpp/tutorial_code/core/parallel_backend/CMakeLists.txt +++ b/samples/cpp/tutorial_code/core/parallel_backend/CMakeLists.txt @@ -1,4 +1,4 @@ -cmake_minimum_required(VERSION 3.9) +cmake_minimum_required(VERSION 3.13) find_package(OpenCV REQUIRED COMPONENTS opencv_core) diff --git a/samples/cpp/tutorial_code/gpu/gpu-thrust-interop/CMakeLists.txt b/samples/cpp/tutorial_code/gpu/gpu-thrust-interop/CMakeLists.txt index 037d508569..daf3b08f49 100644 --- a/samples/cpp/tutorial_code/gpu/gpu-thrust-interop/CMakeLists.txt +++ b/samples/cpp/tutorial_code/gpu/gpu-thrust-interop/CMakeLists.txt @@ -1,4 +1,4 @@ -CMAKE_MINIMUM_REQUIRED(VERSION 2.8) +CMAKE_MINIMUM_REQUIRED(VERSION 3.13) FIND_PACKAGE(CUDA REQUIRED) INCLUDE_DIRECTORIES(${CUDA_INCLUDE_DIRS}) @@ -7,4 +7,4 @@ FIND_PACKAGE(OpenCV REQUIRED COMPONENTS core) INCLUDE_DIRECTORIES(${OpenCV_INCLUDE_DIRS}) CUDA_ADD_EXECUTABLE(opencv_thrust main.cu) -TARGET_LINK_LIBRARIES(opencv_thrust ${OpenCV_LIBS}) \ No newline at end of file +TARGET_LINK_LIBRARIES(opencv_thrust ${OpenCV_LIBS}) diff --git a/samples/hal/c_hal/CMakeLists.txt b/samples/hal/c_hal/CMakeLists.txt index 8cf78aa5ff..a570f6d4ef 100644 --- a/samples/hal/c_hal/CMakeLists.txt +++ b/samples/hal/c_hal/CMakeLists.txt @@ -1,4 +1,4 @@ -cmake_minimum_required(VERSION 2.8.12.2 FATAL_ERROR) +cmake_minimum_required(VERSION 3.13 FATAL_ERROR) set(PROJECT_NAME "c_hal") set(HAL_LIB_NAME "c_hal") diff --git a/samples/hal/slow_hal/CMakeLists.txt b/samples/hal/slow_hal/CMakeLists.txt index 1ffa4670b6..0dcca89b3d 100644 --- a/samples/hal/slow_hal/CMakeLists.txt +++ b/samples/hal/slow_hal/CMakeLists.txt @@ -1,4 +1,4 @@ -cmake_minimum_required(VERSION 2.8.12.2 FATAL_ERROR) +cmake_minimum_required(VERSION 3.13 FATAL_ERROR) set(PROJECT_NAME "slow_hal") set(HAL_LIB_NAME "slow_hal")