-
-
Notifications
You must be signed in to change notification settings - Fork 345
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
4 changed files
with
150 additions
and
12 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,14 +1,54 @@ | ||
diff -Nuarp opencv-3.4.20.orig/cmake/OpenCVGenConfig.cmake opencv-3.4.20/cmake/OpenCVGenConfig.cmake | ||
--- opencv-3.4.20.orig/cmake/OpenCVGenConfig.cmake 2023-06-27 19:29:13.000000000 +0800 | ||
+++ opencv-3.4.20/cmake/OpenCVGenConfig.cmake 2023-08-30 11:59:03.095856713 +0800 | ||
@@ -15,6 +15,10 @@ if(HAVE_CUDA) | ||
ocv_cmake_configure("${CMAKE_CURRENT_LIST_DIR}/templates/OpenCVConfig-CUDA.cmake.in" CUDA_CONFIGCMAKE @ONLY) | ||
endif() | ||
|
||
+if(HAVE_OPENMP) | ||
+ ocv_cmake_configure("${CMAKE_CURRENT_LIST_DIR}/templates/OpenCVConfig-OPENMP.cmake.in" OPENMP_CONFIGCMAKE @ONLY) | ||
+endif() | ||
+ | ||
if(ANDROID) | ||
if(NOT ANDROID_NATIVE_API_LEVEL) | ||
set(OpenCV_ANDROID_NATIVE_API_LEVEL_CONFIGCMAKE 0) | ||
diff -Nuarp opencv-3.4.20.orig/cmake/templates/OpenCVConfig.cmake.in opencv-3.4.20/cmake/templates/OpenCVConfig.cmake.in | ||
--- opencv-3.4.20.orig/cmake/templates/OpenCVConfig.cmake.in 2023-06-27 19:29:13.000000000 +0800 | ||
+++ opencv-3.4.20/cmake/templates/OpenCVConfig.cmake.in 2023-08-30 11:59:19.223817499 +0800 | ||
@@ -94,6 +94,7 @@ endif() | ||
|
||
|
||
@CUDA_CONFIGCMAKE@ | ||
+@OPENMP_CONFIGCMAKE@ | ||
@ANDROID_CONFIGCMAKE@ | ||
|
||
@IPPICV_CONFIGCMAKE@ | ||
diff -Nuarp opencv-3.4.20.orig/cmake/templates/OpenCVConfig-OPENMP.cmake.in opencv-3.4.20/cmake/templates/OpenCVConfig-OPENMP.cmake.in | ||
--- opencv-3.4.20.orig/cmake/templates/OpenCVConfig-OPENMP.cmake.in 1970-01-01 08:00:00.000000000 +0800 | ||
+++ opencv-3.4.20/cmake/templates/OpenCVConfig-OPENMP.cmake.in 2023-08-30 11:58:12.298980226 +0800 | ||
@@ -0,0 +1,5 @@ | ||
+set(OpenCV_USE_OPENMP "@HAVE_OPENMP@") | ||
+ | ||
+if(OpenCV_USE_OPENMP) | ||
+ find_package(OpenMP) | ||
+endif() | ||
diff -Nuarp opencv-3.4.20.orig/modules/core/CMakeLists.txt opencv-3.4.20/modules/core/CMakeLists.txt | ||
--- opencv-3.4.20.orig/modules/core/CMakeLists.txt 2023-06-27 19:29:13.000000000 +0800 | ||
+++ opencv-3.4.20/modules/core/CMakeLists.txt 2023-08-13 19:39:56.659037366 +0800 | ||
@@ -31,6 +31,10 @@ if(HAVE_TBB) | ||
list(APPEND extra_libs tbb) | ||
endif() | ||
+++ opencv-3.4.20/modules/core/CMakeLists.txt 2023-08-30 12:13:56.534064133 +0800 | ||
@@ -113,6 +113,16 @@ ocv_target_link_libraries(${the_module} | ||
"${OPENCV_HAL_LINKER_LIBS}" | ||
) | ||
|
||
+if(HAVE_OPENMP AND DEFINED OpenMP_CXX_LIBRARIES AND OpenMP_CXX_LIBRARIES) | ||
+ list(APPEND extra_libs ${OpenMP_CXX_LIBRARIES}) | ||
+if(HAVE_OPENMP) | ||
+ if(ANDROID_NDK_MAJOR AND (ANDROID_NDK_MAJOR GREATER 20)) | ||
+ ocv_target_link_libraries(${the_module} PUBLIC "-fopenmp" "-static-openmp") | ||
+ elseif(OpenMP_CXX_FOUND) | ||
+ ocv_target_link_libraries(${the_module} PUBLIC OpenMP::OpenMP_CXX) | ||
+ else() | ||
+ ocv_target_link_libraries(${the_module} PUBLIC "${OpenMP_CXX_FLAGS}") | ||
+ endif() | ||
+endif() | ||
+ | ||
if(DEFINED WINRT AND NOT DEFINED ENABLE_WINRT_MODE_NATIVE) | ||
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} /ZW") | ||
if(OPENCV_CORE_EXCLUDE_C_API) | ||
ocv_target_compile_definitions(${the_module} PRIVATE "OPENCV_EXCLUDE_C_API=1") | ||
endif() |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,54 @@ | ||
diff -Nuarp opencv-4.8.0.orig/cmake/OpenCVGenConfig.cmake opencv-4.8.0/cmake/OpenCVGenConfig.cmake | ||
--- opencv-4.8.0.orig/cmake/OpenCVGenConfig.cmake 2023-06-28 19:53:33.000000000 +0800 | ||
+++ opencv-4.8.0/cmake/OpenCVGenConfig.cmake 2023-08-30 12:46:00.413783565 +0800 | ||
@@ -15,6 +15,10 @@ if(HAVE_CUDA) | ||
ocv_cmake_configure("${CMAKE_CURRENT_LIST_DIR}/templates/OpenCVConfig-CUDA.cmake.in" CUDA_CONFIGCMAKE @ONLY) | ||
endif() | ||
|
||
+if(HAVE_OPENMP) | ||
+ ocv_cmake_configure("${CMAKE_CURRENT_LIST_DIR}/templates/OpenCVConfig-OPENMP.cmake.in" OPENMP_CONFIGCMAKE @ONLY) | ||
+endif() | ||
+ | ||
if(ANDROID) | ||
if(NOT ANDROID_NATIVE_API_LEVEL) | ||
set(OpenCV_ANDROID_NATIVE_API_LEVEL_CONFIGCMAKE 0) | ||
diff -Nuarp opencv-4.8.0.orig/cmake/templates/OpenCVConfig.cmake.in opencv-4.8.0/cmake/templates/OpenCVConfig.cmake.in | ||
--- opencv-4.8.0.orig/cmake/templates/OpenCVConfig.cmake.in 2023-06-28 19:53:33.000000000 +0800 | ||
+++ opencv-4.8.0/cmake/templates/OpenCVConfig.cmake.in 2023-08-30 12:46:16.641712071 +0800 | ||
@@ -94,6 +94,7 @@ endif() | ||
|
||
|
||
@CUDA_CONFIGCMAKE@ | ||
+@OPENMP_CONFIGCMAKE@ | ||
@ANDROID_CONFIGCMAKE@ | ||
|
||
@IPPICV_CONFIGCMAKE@ | ||
diff -Nuarp opencv-4.8.0.orig/cmake/templates/OpenCVConfig-OPENMP.cmake.in opencv-4.8.0/cmake/templates/OpenCVConfig-OPENMP.cmake.in | ||
--- opencv-4.8.0.orig/cmake/templates/OpenCVConfig-OPENMP.cmake.in 1970-01-01 08:00:00.000000000 +0800 | ||
+++ opencv-4.8.0/cmake/templates/OpenCVConfig-OPENMP.cmake.in 2023-08-30 11:58:12.298980226 +0800 | ||
@@ -0,0 +1,5 @@ | ||
+set(OpenCV_USE_OPENMP "@HAVE_OPENMP@") | ||
+ | ||
+if(OpenCV_USE_OPENMP) | ||
+ find_package(OpenMP) | ||
+endif() | ||
diff -Nuarp opencv-4.8.0.orig/modules/core/CMakeLists.txt opencv-4.8.0/modules/core/CMakeLists.txt | ||
--- opencv-4.8.0.orig/modules/core/CMakeLists.txt 2023-06-28 19:53:33.000000000 +0800 | ||
+++ opencv-4.8.0/modules/core/CMakeLists.txt 2023-08-30 12:45:06.680020296 +0800 | ||
@@ -169,8 +169,14 @@ if(HAVE_HPX) | ||
ocv_target_link_libraries(${the_module} LINK_PRIVATE "${HPX_LIBRARIES}") | ||
endif() | ||
|
||
-if(HAVE_OPENMP AND DEFINED OpenMP_CXX_LIBRARIES AND OpenMP_CXX_LIBRARIES) | ||
- ocv_target_link_libraries(${the_module} LINK_PRIVATE "${OpenMP_CXX_LIBRARIES}") | ||
+if(HAVE_OPENMP) | ||
+ if(ANDROID_NDK_MAJOR AND (ANDROID_NDK_MAJOR GREATER 20)) | ||
+ ocv_target_link_libraries(${the_module} PUBLIC "-fopenmp" "-static-openmp") | ||
+ elseif(OpenMP_CXX_FOUND) | ||
+ ocv_target_link_libraries(${the_module} PUBLIC OpenMP::OpenMP_CXX) | ||
+ else() | ||
+ ocv_target_link_libraries(${the_module} PUBLIC "${OpenMP_CXX_FLAGS}") | ||
+ endif() | ||
endif() | ||
|
||
ocv_add_accuracy_tests() |