From a9a59af31695d2b9a21e588483a55a52b711b168 Mon Sep 17 00:00:00 2001 From: Sheil Kumar Date: Thu, 28 Oct 2021 17:40:50 -0700 Subject: [PATCH 1/2] OpenCV build script fixes --- external/tools/CMakeConfigureOpenCV.ps1 | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/external/tools/CMakeConfigureOpenCV.ps1 b/external/tools/CMakeConfigureOpenCV.ps1 index 7f9abc24..b46d13e4 100644 --- a/external/tools/CMakeConfigureOpenCV.ps1 +++ b/external/tools/CMakeConfigureOpenCV.ps1 @@ -30,7 +30,7 @@ else { $Args.Add("-A " + $Architecture) } -$Args.Add("-G " + $Generator) +$Args.Add("-G $Generator") $Args.Add("-DCMAKE_SYSTEM_NAME=Windows") $Args.Add("-DCMAKE_SYSTEM_VERSION=10.0") $Args.Add("-DWITH_OPENCL=OFF") @@ -54,5 +54,9 @@ if ($Clean) { $Args.Add("--clean") } -$Args.Add("-B " + $BuildDirectory) -cmake $Args "$PSScriptRoot\..\opencv" +$Args.Add("-B $BuildDirectory") +$Args.Add("$PSScriptRoot\..\opencv") + +$ArgsStr = ($Args -join " ") +$ArgsStr +cmake $Args From e7b36bf2de1d126215c472d47c69be43ffb92ce6 Mon Sep 17 00:00:00 2001 From: Sheil Kumar Date: Thu, 28 Oct 2021 18:58:41 -0700 Subject: [PATCH 2/2] Fix script --- external/tools/CMakeConfigureOpenCV.ps1 | 48 ++++++++++++------------- 1 file changed, 24 insertions(+), 24 deletions(-) diff --git a/external/tools/CMakeConfigureOpenCV.ps1 b/external/tools/CMakeConfigureOpenCV.ps1 index b46d13e4..c9088237 100644 --- a/external/tools/CMakeConfigureOpenCV.ps1 +++ b/external/tools/CMakeConfigureOpenCV.ps1 @@ -21,42 +21,42 @@ Param ) -$Args = New-Object Collections.Generic.List[String] - +$Command = New-Object Collections.Generic.List[String] +$Command.Add("cmake") if ($Architecture -eq 'x86') { - $Args.Add("-A Win32") + $Command.Add("-A Win32") } else { - $Args.Add("-A " + $Architecture) + $Command.Add("-A " + $Architecture) } -$Args.Add("-G $Generator") -$Args.Add("-DCMAKE_SYSTEM_NAME=Windows") -$Args.Add("-DCMAKE_SYSTEM_VERSION=10.0") -$Args.Add("-DWITH_OPENCL=OFF") -$Args.Add("-DWITH_FFMPEG=OFF") -$Args.Add("-DWITH_CUDA=OFF") -$Args.Add("-DBUILD_EXAMPLES=OFF") -$Args.Add("-DBUILD_TESTS=OFF") -$Args.Add("-DBUILD_opencv_apps=OFF") -$Args.Add("-DBUILD_DOCS=OFF") -$Args.Add("-DBUILD_PERF_TESTS=OFF") -$Args.Add("-DBUILD_opencv_world=ON") +$Command.Add("-G '$Generator'") +$Command.Add("-DCMAKE_SYSTEM_NAME=Windows") +$Command.Add("-DCMAKE_SYSTEM_VERSION=10.0") +$Command.Add("-DWITH_OPENCL=OFF") +$Command.Add("-DWITH_FFMPEG=OFF") +$Command.Add("-DWITH_CUDA=OFF") +$Command.Add("-DBUILD_EXAMPLES=OFF") +$Command.Add("-DBUILD_TESTS=OFF") +$Command.Add("-DBUILD_opencv_apps=OFF") +$Command.Add("-DBUILD_DOCS=OFF") +$Command.Add("-DBUILD_PERF_TESTS=OFF") +$Command.Add("-DBUILD_opencv_world=ON") if ($Architecture -eq 'x64') { - $Args.Add("-DCMAKE_SYSTEM_PROCESSOR=AMD64") + $Command.Add("-DCMAKE_SYSTEM_PROCESSOR=AMD64") } else { - $Args.Add("-DCMAKE_SYSTEM_PROCESSOR=" + $Architecture) + $Command.Add("-DCMAKE_SYSTEM_PROCESSOR=" + $Architecture) } if ($Clean) { - $Args.Add("--clean") + $Command.Add("--clean") } -$Args.Add("-B $BuildDirectory") -$Args.Add("$PSScriptRoot\..\opencv") +$Command.Add("-B '$BuildDirectory'") +$Command.Add("'$PSScriptRoot\..\opencv'") -$ArgsStr = ($Args -join " ") -$ArgsStr -cmake $Args +$CommandStr = ($Command -join " ") +$CommandStr +Invoke-Expression $CommandStr