Issue 1:
Duplicate #17432

Windows 10, CMake 3.18, CUDA 10.2. OpenCV rev. 0cbaaba, contrib rev. 39ced2af67b5f76d5d2f3a9c1f9cebfc0ddd8c65.

During configuration CMake issues an error:

CMake Error at cmake/OpenCVDetectCUDA.cmake:111 (string):
string sub-command STRIP requires two arguments.
Call Stack (most recent call first):
cmake/OpenCVDetectCUDA.cmake:164 (ocv_filter_available_architecture)
cmake/OpenCVFindLibsPerf.cmake:43 (include)
CMakeLists.txt:688 (include)

CMake Error at cmake/OpenCVDetectCUDA.cmake:125 (string):
string sub-command REPLACE requires at least four arguments.
Call Stack (most recent call first):
cmake/OpenCVDetectCUDA.cmake:174 (ocv_wipeout_deprecated)
cmake/OpenCVFindLibsPerf.cmake:43 (include)
CMakeLists.txt:688 (include)

I investigated the latest changes and found that the error occurs after commit 476aa44.

@tomoaki0705, Could you please look.

Full log:

Detected processor: AMD64
Found PythonInterp: C:/Program Files/Python37/python.exe (found suitable version "3.7.7", minimum required is "2.7")
libjpeg-turbo: VERSION = 2.0.4, BUILD = opencv-4.4.0-pre-libjpeg-turbo
Could NOT find OpenJPEG (minimal suitable version: 2.0, recommended version >= 2.3.1)
IPPICV: Download: ippicv_2020_win_intel64_20191018_general.zip
found Intel IPP (ICV version): 2020.0.0 [2020.0.0 Gold]
at: E:/Lib_prebuild/opencv/prebuild_x64/3rdparty/ippicv/ippicv_win/icv
found Intel IPP Integration Wrappers sources: 2020.0.0
at: E:/Lib_prebuild/opencv/prebuild_x64/3rdparty/ippicv/ippicv_win/iw
Found CUDNN: C:/Program Files/NVIDIA GPU Computing Toolkit/CUDA/v10.2/lib/x64/cudnn.lib (found suitable version "7.6.5", minimum required is "7.5")
CUDA detected: 10.2
CMake Error at cmake/OpenCVDetectCUDA.cmake:111 (string):
string sub-command STRIP requires two arguments.
Call Stack (most recent call first):
cmake/OpenCVDetectCUDA.cmake:164 (ocv_filter_available_architecture)
cmake/OpenCVFindLibsPerf.cmake:43 (include)
CMakeLists.txt:688 (include)

CMake Error at cmake/OpenCVDetectCUDA.cmake:125 (string):
string sub-command REPLACE requires at least four arguments.
Call Stack (most recent call first):
cmake/OpenCVDetectCUDA.cmake:174 (ocv_wipeout_deprecated)
cmake/OpenCVFindLibsPerf.cmake:43 (include)
CMakeLists.txt:688 (include)

CUDA NVCC target flags: -D_FORCE_INLINES
Check size of int
Check size of int - done
Found MKL 2019.0.3 at: E:/Lib_prebuild/MKL
LAPACK(MKL): LAPACK_LIBRARIES: E:/Lib_prebuild/MKL/lib/mkl_intel_lp64.lib;E:/Lib_prebuild/MKL/lib/mkl_sequential.lib;E:/Lib_prebuild/MKL/lib/mkl_core.lib
LAPACK(MKL): Support is enabled.
Found JNI: C:/Program Files/Java/jdk-14.0.1/lib/jawt.lib
The following CMake options are exported from the Inference Engine build

THREADING: TBB

Detected InferenceEngine: cmake package (2.1.0)
CMake Warning at cmake/OpenCVDetectInferenceEngine.cmake:132 (message):
InferenceEngine version has not been set, 2020.3 will be used by default.
Set INF_ENGINE_RELEASE variable if you experience build errors.
Call Stack (most recent call first):
CMakeLists.txt:750 (include)

Found VTK 8.2.0 (C:/Lib/VTK/build_x64/lib/cmake/vtk-8.2/UseVTK.cmake)
ADE: Download: v0.1.1f.zip
OpenCV Python: during development append to PYTHONPATH: E:/Lib_prebuild/opencv/prebuild_x64/python_loader
FFMPEG: Download: opencv_videoio_ffmpeg.dll
FFMPEG: Download: opencv_videoio_ffmpeg_64.dll
FFMPEG: Download: ffmpeg_version.cmake
Looking for mfapi.h
Looking for mfapi.h - found
Looking for d3d11_4.h
Looking for d3d11_4.h - found
Caffe: NO
Protobuf: NO
Glog: NO
freetype2: NO
harfbuzz: NO
No preference for use of exported gflags CMake configuration set, and no hints for include/library directories provided. Defaulting to preferring an installed/exported gflags CMake configuration if available.
Found installed version of gflags: C:/Lib/gflags/build_x64/lib/cmake/gflags
Detected gflags version: 2.2.2
Found installed version of Eigen: E:/Lib_prebuild/eigen/build_x64/share/eigen3/cmake
Found required Ceres dependency: Eigen version 3.3.7 in E:/Lib_prebuild/eigen/build_x64/include/eigen3
Found installed version of glog: E:/Lib_prebuild/glog/prebuild_x64
Detected glog version: 0.4.0
Found required Ceres dependency: glog
Found installed version of gflags: C:/Lib/gflags/build_x64/lib/cmake/gflags
Detected gflags version: 2.2.2
Found required Ceres dependency: gflags
Ceres version 1.14.0 detected here: E:/Lib_prebuild/ceres-solver/build_x64 was built with C++11. Ceres target will add C++11 flags to compile options for targets using it.
Found Ceres version: 1.14.0 installed in: E:/Lib_prebuild/ceres-solver/build_x64 with components: [EigenSparse, SparseLinearAlgebraLibrary, LAPACK, SuiteSparse, SchurSpecializations, C++11, OpenMP, Multithreading]
Checking SFM deps... TRUE
Tesseract: NO
Allocator metrics storage type: 'long long'
Registering hook 'INIT_MODULE_SOURCES_opencv_dnn': E:/Lib_prebuild/opencv/source/opencv/modules/dnn/cmake/hooks/INIT_MODULE_SOURCES_opencv_dnn.cmake
DNN: Enabling Inference Engine NN Builder API support
xfeatures2d/boostdesc: Download: boostdesc_bgm.i
xfeatures2d/boostdesc: Download: boostdesc_bgm_bi.i
xfeatures2d/boostdesc: Download: boostdesc_bgm_hd.i
xfeatures2d/boostdesc: Download: boostdesc_binboost_064.i
xfeatures2d/boostdesc: Download: boostdesc_binboost_128.i
xfeatures2d/boostdesc: Download: boostdesc_binboost_256.i
xfeatures2d/boostdesc: Download: boostdesc_lbgm.i
xfeatures2d/vgg: Download: vgg_generated_48.i
xfeatures2d/vgg: Download: vgg_generated_64.i
xfeatures2d/vgg: Download: vgg_generated_80.i
xfeatures2d/vgg: Download: vgg_generated_120.i
data: Download: face_landmark_model.dat
No preference for use of exported gflags CMake configuration set, and no hints for include/library directories provided. Defaulting to preferring an installed/exported gflags CMake configuration if available.
Found installed version of gflags: C:/Lib/gflags/build_x64/lib/cmake/gflags
Detected gflags version: 2.2.2
Found installed version of Eigen: E:/Lib_prebuild/eigen/build_x64/share/eigen3/cmake
Found required Ceres dependency: Eigen version 3.3.7 in E:/Lib_prebuild/eigen/build_x64/include/eigen3
Found installed version of glog: E:/Lib_prebuild/glog/prebuild_x64
Detected glog version: 0.4.0
Found required Ceres dependency: glog
Found installed version of gflags: C:/Lib/gflags/build_x64/lib/cmake/gflags
Detected gflags version: 2.2.2
Found required Ceres dependency: gflags
Ceres version 1.14.0 detected here: E:/Lib_prebuild/ceres-solver/build_x64 was built with C++11. Ceres target will add C++11 flags to compile options for targets using it.
Found Ceres version: 1.14.0 installed in: E:/Lib_prebuild/ceres-solver/build_x64 with components: [EigenSparse, SparseLinearAlgebraLibrary, LAPACK, SuiteSparse, SchurSpecializations, C++11, OpenMP, Multithreading]
Checking SFM deps... TRUE
NVIDIA_OPTICAL_FLOW: Download: 79c6cee80a2df9a196f20afd6b598a9810964c32.zip
CMake Warning at cmake/OpenCVGenSetupVars.cmake:54 (message):
CONFIGURATION IS NOT SUPPORTED: validate setupvars script in install
directory
Call Stack (most recent call first):
CMakeLists.txt:968 (include)

General configuration for OpenCV 4.4.0-pre =====================================
Version control: 4.3.0-421-g0cbaaba4b1

Extra modules:
Location (extra): E:/Lib_prebuild/opencv/source/opencv_contrib/modules
Version control (extra): 4.3.0-62-g39ced2af

Platform:
Timestamp: 2020-06-14T07:00:26Z
Host: Windows 10.0.17763 AMD64
CMake: 3.18.0-rc1
CMake generator: Visual Studio 15 2017
CMake build tool: C:/Program Files (x86)/Microsoft Visual Studio/2017/Enterprise/MSBuild/15.0/Bin/MSBuild.exe
MSVC: 1916

CPU/HW features:
Baseline: SSE SSE2 SSE3
requested: SSE3
Dispatched code generation: SSE4_1 SSE4_2 FP16 AVX AVX2 AVX512_SKX
requested: SSE4_1 SSE4_2 AVX FP16 AVX2 AVX512_SKX
SSE4_1 (15 files): + SSSE3 SSE4_1
SSE4_2 (1 files): + SSSE3 SSE4_1 POPCNT SSE4_2
FP16 (0 files): + SSSE3 SSE4_1 POPCNT SSE4_2 FP16 AVX
AVX (4 files): + SSSE3 SSE4_1 POPCNT SSE4_2 AVX
AVX2 (29 files): + SSSE3 SSE4_1 POPCNT SSE4_2 FP16 FMA3 AVX AVX2
AVX512_SKX (4 files): + SSSE3 SSE4_1 POPCNT SSE4_2 FP16 FMA3 AVX AVX2 AVX_512F AVX512_COMMON AVX512_SKX

C/C++:
Built as dynamic libs?: YES
C++ standard: 11
C++ Compiler: C:/Program Files (x86)/Microsoft Visual Studio/2017/Enterprise/VC/Tools/MSVC/14.16.27023/bin/Hostx86/x64/cl.exe (ver 19.16.27039.0)
C++ flags (Release): /DWIN32 /D_WINDOWS /W4 /GR /D _CRT_SECURE_NO_DEPRECATE /D _CRT_NONSTDC_NO_DEPRECATE /D _SCL_SECURE_NO_WARNINGS /Gy /bigobj /Oi /fp:precise /EHa /wd4127 /wd4251 /wd4324 /wd4275 /wd4512 /wd4589 /MP /MD /O2 /Ob2 /DNDEBUG
C++ flags (Debug): /DWIN32 /D_WINDOWS /W4 /GR /D _CRT_SECURE_NO_DEPRECATE /D _CRT_NONSTDC_NO_DEPRECATE /D _SCL_SECURE_NO_WARNINGS /Gy /bigobj /Oi /fp:precise /EHa /wd4127 /wd4251 /wd4324 /wd4275 /wd4512 /wd4589 /MP /MDd /Zi /Ob0 /Od /RTC1
C Compiler: C:/Program Files (x86)/Microsoft Visual Studio/2017/Enterprise/VC/Tools/MSVC/14.16.27023/bin/Hostx86/x64/cl.exe
C flags (Release): /DWIN32 /D_WINDOWS /W3 /D _CRT_SECURE_NO_DEPRECATE /D _CRT_NONSTDC_NO_DEPRECATE /D _SCL_SECURE_NO_WARNINGS /Gy /bigobj /Oi /fp:precise /MP /MD /O2 /Ob2 /DNDEBUG
C flags (Debug): /DWIN32 /D_WINDOWS /W3 /D _CRT_SECURE_NO_DEPRECATE /D _CRT_NONSTDC_NO_DEPRECATE /D _SCL_SECURE_NO_WARNINGS /Gy /bigobj /Oi /fp:precise /MP /MDd /Zi /Ob0 /Od /RTC1
Linker flags (Release): /machine:x64 /INCREMENTAL:NO
Linker flags (Debug): /machine:x64 /debug /INCREMENTAL
ccache: NO
Precompiled headers: YES
Extra dependencies: cudart_static.lib nppc.lib nppial.lib nppicc.lib nppicom.lib nppidei.lib nppif.lib nppig.lib nppim.lib nppist.lib nppisu.lib nppitc.lib npps.lib cublas.lib cudnn.lib cufft.lib -LIBPATH:C:/Program Files/NVIDIA GPU Computing Toolkit/CUDA/v10.2/lib/x64
3rdparty dependencies:

OpenCV modules:
To be built: alphamat aruco bgsegm bioinspired calib3d ccalib core cudaarithm cudabgsegm cudacodec cudafeatures2d cudafilters cudaimgproc cudalegacy cudaobjdetect cudaoptflow cudastereo cudawarping cudev datasets dnn dnn_objdetect dnn_superres dpm face features2d flann fuzzy gapi hfs highgui img_hash imgcodecs imgproc intensity_transform line_descriptor ml objdetect optflow ovis phase_unwrapping photo plot python3 quality rapid reg rgbd saliency sfm shape stereo stitching structured_light superres surface_matching text tracking video videoio videostab viz xfeatures2d ximgproc xobjdetect xphoto
Disabled: world
Disabled by dependency: -
Unavailable: cnn_3dobj cvv freetype hdf java js matlab python2 ts
Applications: examples apps
Documentation: NO
Non-free algorithms: NO

Windows RT support: NO

GUI:
Win32 UI: YES
VTK support: YES (ver 8.2.0)

Media I/O:
ZLib: build (ver 1.2.11)
JPEG: build-libjpeg-turbo (ver 2.0.4-62)
WEBP: build (ver encoder: 0x020f)
PNG: build (ver 1.6.37)
TIFF: build (ver 42 - 4.0.10)
JPEG 2000: build Jasper (ver 1.900.1)
OpenEXR: build (ver 2.3.0)
HDR: YES
SUNRASTER: YES
PXM: YES
PFM: YES

Video I/O:
DC1394: NO
FFMPEG: YES (prebuilt binaries)
avcodec: YES (58.54.100)
avformat: YES (58.29.100)
avutil: YES (56.31.100)
swscale: YES (5.5.100)
avresample: YES (4.0.0)
GStreamer: NO
DirectShow: YES
Media Foundation: YES
DXVA: YES

Parallel framework: Concurrency

Trace: YES (with Intel ITT)

Other third-party libraries:
Intel IPP: 2020.0.0 Gold [2020.0.0]
at: E:/Lib_prebuild/opencv/prebuild_x64/3rdparty/ippicv/ippicv_win/icv
Intel IPP IW: sources (2020.0.0)
at: E:/Lib_prebuild/opencv/prebuild_x64/3rdparty/ippicv/ippicv_win/iw
Lapack: YES (E:/Lib_prebuild/MKL/lib/mkl_intel_lp64.lib E:/Lib_prebuild/MKL/lib/mkl_sequential.lib E:/Lib_prebuild/MKL/lib/mkl_core.lib)
Inference Engine: YES (2020030000 / 2.1.0)
* libs: E:/Lib_prebuild/DLDT/dldt/bin/intel64/Release/inference_engine_c_api.lib / E:/Lib_prebuild/DLDT/dldt/bin/intel64/Debug/inference_engine_c_apid.lib E:/Lib_prebuild/DLDT/dldt/bin/intel64/Release/inference_engine_c_api.dll / E:/Lib_prebuild/DLDT/dldt/bin/intel64/Debug/inference_engine_c_apid.dll E:/Lib_prebuild/DLDT/dldt/bin/intel64/Release/inference_engine_c_api.dll E:/Lib_prebuild/DLDT/dldt/bin/intel64/Debug/inference_engine_c_apid.dll
* includes: E:/Lib_prebuild/DLDT/dldt/inference-engine/ie_bridges/c/include
Eigen: YES (ver 3.3.7)
Custom HAL: NO
Protobuf: build (3.5.1)

NVIDIA CUDA: YES (ver 10.2, CUFFT CUBLAS)
NVIDIA GPU arch:
NVIDIA PTX archs:

cuDNN: YES (ver 7.6.5)

OpenCL: YES (NVD3D11)
Include path: E:/Lib_prebuild/opencv/source/opencv/3rdparty/include/opencl/1.2
Link libraries: Dynamic load

Python 3:
Interpreter: C:/Program Files/Python37/python.exe (ver 3.7.7)
Libraries: optimized C:/Program Files/Python37/libs/python37.lib debug C:/Program Files/Python37/libs/python37_d.lib (ver 3.7.7)
numpy: C:/Program Files/Python37/lib/site-packages/numpy/core/include (ver 1.18.2)
install path: C:/Program Files/Python37/Lib/site-packages/cv2/python-3.7

Python (for build): C:/Program Files/Python37/python.exe

Java:
ant: NO
JNI: C:/Program Files/Java/jdk-14.0.1/include C:/Program Files/Java/jdk-14.0.1/include/win32 C:/Program Files/Java/jdk-14.0.1/include
Java wrappers: NO
Java tests: NO

Install to: E:/Lib_prebuild/opencv/prebuild_x64/install
-----------------------------------------------------------------

Configuring incomplete, errors occurred!
See also "E:/Lib_prebuild/opencv/prebuild_x64/CMakeFiles/CMakeOutput.log".
See also "E:/Lib_prebuild/opencv/prebuild_x64/CMakeFiles/CMakeError.log".

CMakeError and CMakeOutput log:

CMakeFiles.zip

Issue 2:
OpenCV => 3.4.5

Operating System / Platform => Windows 10, 64 bit

Compiler => Visual Studio 2017

Alexander Alekhin closed my last bug with "duplicate", and "won't fix". I would love to know why it's a won't fix...

If you use the dynamically imported OpenCV core DLL, and you link against MFC, when the dll unloads, there are a ton of leaked memory complaints. I do believe these are real. If I repeatedly dynamically load and unload a DLL which itself links to OpenCV's core, this causes some serious termination bugs when attempting to call FreeLibrary( ) on my dll, which has loaded OpenCV. It makes my DLL nearly unusable.

somebody present a solution, workaround, doc, whatever, but the way it exists now is near intolerable.