Debian Codegraph @

python/ci/install-colmap-windows.ps1

raw
1 $ErrorActionPreference = "Stop"
2 Set-StrictMode -Version Latest
3 $PSNativeCommandUseErrorActionPreference = $true
4
5 $CURRDIR = $PWD
6
7 $COMPILER_TOOLS_DIR = "${env:COMPILER_CACHE_DIR}/bin"
8 New-Item -ItemType Directory -Force -Path ${COMPILER_TOOLS_DIR}
9 $env:Path = "${COMPILER_TOOLS_DIR};" + $env:Path
10
11 If (!(Test-Path -path "${COMPILER_TOOLS_DIR}/ccache.exe" -PathType Leaf)) {
12 .github/workflows/install-ccache.ps1 -Destination "${COMPILER_TOOLS_DIR}"
13 }
14 ccache --zero-stats
15
16 # Setup vcpkg
17 cd ${CURRDIR}
18 git clone https://github.com/microsoft/vcpkg ${env:VCPKG_INSTALLATION_ROOT}
19 cd ${env:VCPKG_INSTALLATION_ROOT}
20 ./bootstrap-vcpkg.bat
21
22 cd ${CURRDIR}
23 & "./scripts/shell/enter_vs_dev_shell.ps1"
24 & "${env:VCPKG_ROOT}/vcpkg.exe" integrate install
25
26 # Build COLMAP
27 mkdir build
28 cd build
29 cmake .. `
30 -GNinja `
31 -DCMAKE_MAKE_PROGRAM=ninja `
32 -DCUDA_ENABLED="OFF" `
33 -DONNX_ENABLED="OFF" `
34 -DGUI_ENABLED="OFF" `
35 -DCGAL_ENABLED="OFF" `
36 -DLSD_ENABLED="OFF" `
37 -DCMAKE_BUILD_TYPE="Release" `
38 -DCMAKE_TOOLCHAIN_FILE="${env:CMAKE_TOOLCHAIN_FILE}" `
39 -DVCPKG_TARGET_TRIPLET="${env:VCPKG_TARGET_TRIPLET}" `
40 -DFETCHCONTENT_BASE_DIR="${env:FETCHCONTENT_BASE_DIR}"
41 ninja install
42
43 ccache --show-stats --verbose