Skip to content

Commit 500153c

Browse files
Better GitHub
1 parent eb74066 commit 500153c

2 files changed

Lines changed: 17 additions & 46 deletions

File tree

.github/workflows/main.yml

Lines changed: 12 additions & 46 deletions
Original file line numberDiff line numberDiff line change
@@ -68,59 +68,25 @@ jobs:
6868
cp -r oidn_temp/* thirdparty/oidn/ 2>/dev/null || true
6969
fi
7070
71+
- name: Setup vcpkg
72+
if: runner.os == 'Windows'
73+
uses: lukka/run-vcpkg@v11
74+
with:
75+
vcpkgGitCommitId: '3e8ae4add5a6ac3b3b9f8c9d1'
76+
7177
- name: Install dependencies (Windows)
7278
if: runner.os == 'Windows'
7379
shell: powershell
7480
run: |
75-
# Download and extract Embree
76-
Invoke-WebRequest -Uri "${{ matrix.embree_url }}" -OutFile "embree.zip"
77-
Expand-Archive -Path "embree.zip" -DestinationPath "."
78-
$expectedEmbreeDir = "${{ matrix.embree_dir }}"
81+
# Install Embree via vcpkg (OIDN not available in vcpkg, keep manual install)
82+
& vcpkg\vcpkg.exe install embree:x64-windows
7983
80-
# Clean existing Embree installation
81-
if (Test-Path "thirdparty/embree") {
82-
Remove-Item -Path "thirdparty/embree" -Recurse -Force
83-
}
84+
# Set environment variables for CMake
85+
echo "EMBREE_LOCATION=$env:VCPKG_ROOT/installed/x64-windows" | Out-File -FilePath $env:GITHUB_ENV -Append
8486
85-
# Handle different extraction structures
86-
if (Test-Path $expectedEmbreeDir) {
87-
# Expected directory exists, move it
88-
Move-Item -Path $expectedEmbreeDir -Destination "thirdparty/embree" -Force
89-
} else {
90-
# Check if embree files were extracted directly
91-
$embreeFiles = Get-ChildItem -Path "." -Directory | Where-Object { $_.Name -like "*embree*" }
92-
if ($embreeFiles) {
93-
Move-Item -Path $embreeFiles[0].FullName -Destination "thirdparty/embree" -Force
94-
} else {
95-
Write-Host "Warning: Could not find extracted Embree directory. Creating empty thirdparty/embree"
96-
New-Item -ItemType Directory -Path "thirdparty/embree" -Force | Out-Null
97-
}
98-
}
99-
100-
# Add to PATH and set EMBREE_LOCATION
101-
echo "$PWD/thirdparty/embree/bin" | Out-File -FilePath $env:GITHUB_PATH -Append
102-
echo "EMBREE_LOCATION=$PWD/thirdparty/embree" | Out-File -FilePath $env:GITHUB_ENV -Append
103-
104-
# Download and extract OIDN for Windows (v2.3.3 from RenderKit)
87+
# Install OIDN manually (simplified approach)
10588
Invoke-WebRequest -Uri "https://github.com/RenderKit/oidn/releases/download/v2.3.3/oidn-2.3.3.x64.windows.zip" -OutFile "oidn.zip"
106-
Expand-Archive -Path "oidn.zip" -DestinationPath "."
107-
Get-ChildItem -Path "." -Name
108-
# Clean existing OIDN installation
109-
if (Test-Path "thirdparty/oidn") {
110-
Remove-Item -Path "thirdparty/oidn" -Recurse -Force
111-
}
112-
# Move extracted OIDN directory to thirdparty
113-
if (Test-Path "oidn-2.3.3.x64.windows") {
114-
Move-Item -Path "oidn-2.3.3.x64.windows" -Destination "thirdparty/oidn" -Force
115-
} else {
116-
# Handle different extraction structures
117-
$extractedDirs = Get-ChildItem -Path "." -Directory | Where-Object { $_.Name -notlike "*embree*" -and $_.Name -like "*oidn*" }
118-
if ($extractedDirs) {
119-
Move-Item -Path $extractedDirs[0].FullName -Destination "thirdparty/oidn" -Force
120-
} else {
121-
Write-Host "Warning: Could not find extracted OIDN directory"
122-
}
123-
}
89+
Expand-Archive -Path "oidn.zip" -DestinationPath "thirdparty/oidn" -Force
12490
12591
- name: Verify OIDN installation
12692
if: runner.os == 'Windows'

CMakeLists.txt

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,11 @@ cmake_policy(SET CMP0091 NEW)
66
cmake_policy(SET CMP0056 NEW)
77
cmake_policy(SET CMP0066 NEW)
88

9+
# Setup vcpkg toolchain if available
10+
if(DEFINED ENV{VCPKG_ROOT} AND NOT DEFINED CMAKE_TOOLCHAIN_FILE)
11+
set(CMAKE_TOOLCHAIN_FILE "$ENV{VCPKG_ROOT}/scripts/buildsystems/vcpkg.cmake" CACHE STRING "")
12+
endif()
13+
914
project(etx-tracer VERSION 0.0.1)
1015

1116
set_property(GLOBAL PROPERTY USE_FOLDERS ON)

0 commit comments

Comments
 (0)