Skip to content

Commit

Permalink
fix
Browse files Browse the repository at this point in the history
  • Loading branch information
ptitjano committed Apr 26, 2024
1 parent 2d839d4 commit 912e870
Showing 1 changed file with 17 additions and 8 deletions.
25 changes: 17 additions & 8 deletions Dockerfile.windows
Original file line number Diff line number Diff line change
Expand Up @@ -2,28 +2,37 @@ FROM mcr.microsoft.com/windows/servercore:ltsc2022

SHELL ["powershell", "-Command", "$ErrorActionPreference = 'Stop'; $ProgressPreference='SilentlyContinue'; $VerbosePreference = 'Continue';"]

RUN $env:starter_path = Get-Location
# RUN $env:starter_path = Get-Location

# download and install vs build tools needed by vcpkg
RUN Invoke-WebRequest "https://aka.ms/vs/17/release/vs_buildtools.exe" \
-OutFile "$env:TEMP\vs_buildtools.exe" -UseBasicParsing
RUN Start-Process -FilePath "$env:TEMP\vs_buildtools.exe" \
-ArgumentList "--wait", "--nocache", "--norestart", "--noUpdateInstaller", \
"--add", "Microsoft.VisualStudio.Workload.VCTools", \
"--add", "Microsoft.VisualStudio.Component.VC.Tools.x86.x64", \
"--add", "Microsoft.Component.MSBuild", \
"--add", "Microsoft.VisualStudio.Component.Windows11SDK.22621", \
"--includeRecommended" \
-Wait

# install git from choco
RUN iex ((New-Object System.Net.WebClient).DownloadString('https://chocolatey.org/install.ps1')); \
choco install git -y --no-progress

# install vcpkg
# RUN $env:VCPKG_INSTALL_DIR="c:\\vcpkg"
# RUN $env:VCPKG_DEFAULT_TRIPLET="x64-windows"
RUN git clone https://github.com/microsoft/vcpkg c:\vcpkg && \
cd c:\vcpkg && \
bootstrap-vcpkg.bat -disableMetrics && \
.\vcpkg install cgal boost-program-options boost-timer boost-test --triplet x64-windows
RUN git clone https://github.com/microsoft/vcpkg c:\vcpkg; \
Start-Process -FilePath "c:\vcpkg\bootstrap-vcpkg.bat -ArgumentList "-disableMetrics" -Wait; \
c:\vcpkg\vcpkg install cgal boost-program-options boost-timer boost-test --triplet x64-windows

# build sfcgal
RUN cd $env:starter_path && \
cmake -S . -B build -DCMAKE_BUILD_TYPE=Release -DSFCGAL_BUILD_TESTS=OFF -DCMAKE_TOOLCHAIN_FILE="$env:VCPKG_INSTALL_DIR\scripts\buildsystems\vcpkg.cmake"
# RUN cd $env:starter_path; \
# cmake -S . -B build -DCMAKE_BUILD_TYPE=Release -DSFCGAL_BUILD_TESTS=OFF -DCMAKE_TOOLCHAIN_FILE="$env:VCPKG_INSTALL_DIR\scripts\buildsystems\vcpkg.cmake"
RUN cmake -S . -B build \
-DCMAKE_BUILD_TYPE=Release \
-DSFCGAL_BUILD_TESTS=OFF \
-DCMAKE_TOOLCHAIN_FILE="$env:VCPKG_INSTALL_DIR\scripts\buildsystems\vcpkg.cmake"

# Restore default shell for Windows containers.
SHELL ["cmd.exe", "/s", "/c"]
Expand Down

0 comments on commit 912e870

Please sign in to comment.