Skip to content

Commit c8be05d

Browse files
Try to install fmt+eigen3 via vcpkg
1 parent 3a00b61 commit c8be05d

File tree

1 file changed

+30
-20
lines changed

1 file changed

+30
-20
lines changed

.github/workflows/reusable-ros-tooling-win-build.yml

Lines changed: 30 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -55,28 +55,31 @@ jobs:
5555
with:
5656
python-version: '3.8'
5757

58-
# install more dependencies here, we can't use vcpkg because it overrides the python version
59-
# and colcon fails later
60-
- name: Install Eigen
61-
run: |
62-
Invoke-WebRequest -Uri https://gitlab.com/libeigen/eigen/-/archive/3.4.0/eigen-3.4.0.zip -OutFile eigen-3.4.0.zip
63-
Expand-Archive -Path eigen-3.4.0.zip -DestinationPath C:\Eigen
64-
Move-Item -Path C:\Eigen\eigen-3.4.0\* -Destination C:\Eigen
65-
Remove-Item -Path C:\Eigen\eigen-3.4.0 -Recurse
66-
cd C:\Eigen
67-
ls
68-
cmake -B build -DCMAKE_INSTALL_PREFIX="C:\EigenInstall"
69-
cmake --build build --target install
58+
- name: vcpkg build
59+
uses: johnwason/vcpkg-action@v6
60+
if: ${{ inputs.install_vcpkg }}
61+
id: vcpkg
62+
with:
63+
pkgs: fmt eigen3
64+
triplet: x64-windows-release
65+
token: ${{ github.token }}
66+
github-binarycache: true
7067

71-
- name: Install fmt
68+
- name: Make json from vcpkg cmake
69+
if: ${{ inputs.install_vcpkg }}
70+
id: vcpkg-json
7271
run: |
73-
git clone https://github.com/fmtlib/fmt.git
74-
cd fmt
75-
mkdir build
76-
cd build
77-
cmake ..
78-
ls
79-
cmake --build . --target INSTALL --config Release
72+
# Split the string on spaces and assign to variables
73+
$variables = "${{ steps.vcpkg.outputs.vcpkg-cmake-config }}" -split ' '
74+
# Replace forward slashes with backslashes (for Windows) and escape them for json
75+
$singlePath = $variables[0] -replace "/", "\"
76+
$doublePath = $singlePath -replace "\\", "\\"
77+
Write-Host "Transformed output: $doublePath"
78+
$var2 = $variables[1]
79+
$var3 = $variables[2]
80+
"toolchain-file=$doublePath" | Out-File -FilePath $Env:GITHUB_OUTPUT -Append
81+
"target-triplet=$var2" | Out-File -FilePath $Env:GITHUB_OUTPUT -Append
82+
"manifest-mode=$var3" | Out-File -FilePath $Env:GITHUB_OUTPUT -Append
8083
8184
- uses: ros-tooling/[email protected]
8285
with:
@@ -142,6 +145,13 @@ jobs:
142145
colcon-mixin-repository: https://raw.githubusercontent.com/colcon/colcon-mixin-repository/master/index.yaml
143146
colcon-defaults: |
144147
{
148+
"build": {
149+
"cmake-args": [
150+
"${{ steps.vcpkg-json.outputs.toolchain-file }}",
151+
"${{ steps.vcpkg-json.outputs.target-triplet }}",
152+
"${{ steps.vcpkg-json.outputs.manifest-mode }}"
153+
]
154+
},
145155
"test": {
146156
"executor": "sequential"
147157
}

0 commit comments

Comments
 (0)