From 50fcb396383721d9d97e2645fa8799e20a4c9700 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Tiago=20Concei=C3=A7=C3=A3o?= Date: Sun, 21 Aug 2022 06:22:58 +0100 Subject: [PATCH] Create cvextern.dll.ps1 --- build/cvextern.dll.ps1 | 48 ++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 48 insertions(+) create mode 100644 build/cvextern.dll.ps1 diff --git a/build/cvextern.dll.ps1 b/build/cvextern.dll.ps1 new file mode 100644 index 0000000..fcd1f82 --- /dev/null +++ b/build/cvextern.dll.ps1 @@ -0,0 +1,48 @@ +# Script to build the cvextern.dll +# Can be run outside UVtools and as standalone script + +# Requirements: +## git +## cmake +## Visual Studio with development tools and sdk + +# Script working directory +Set-Location $PSScriptRoot + +$libFolder = 'emgucv' +$buildFile = "platforms\windows\Build_Binary_x86.bat" +$buildArgs = '64 mini commercial no-openni no-doc no-package build' + +if ($args.Count -gt 0){ + if($args[0] -eq 'clean'){ + if(Test-Path -Path "$libFolder"){ + Remove-Item -Force -Recurse -Path "$libFolder" + } + exit; + } +} + +if (-not (Test-Path -Path "$libFolder/$buildFile" -PathType Leaf)) { + $confirmation = Read-Host "$libFolder directory does not exists, do you want to download it? +y/yes = Download master branch +4.6.0 = Download specific tag +n/no = Cancel +Option" + + if ($confirmation -eq 'y' -or $confirmation -eq 'yes') { + Write-Output "Clone master" + git clone --recurse-submodules --depth 1 "https://github.com/emgucv/emgucv" "$libFolder" + }elseif($confirmation -match '^\d\.\d\.\d$') { + Write-Output "$confirmation" + git clone --recurse-submodules --depth 1 --branch "$confirmation" "https://github.com/emgucv/emgucv" "$libFolder" + } + else { + exit; + } +} + +Set-Location "$libFolder" + +Write-Output "Building" +cmd.exe /c "$buildFile $buildArgs" +Write-Output "Completed - Check for errors but also for libcvextern presence on $libFolder\libs\runtimes"