Sunday, July 16, 2023

github action to build an opencv project on Windows

After lots of trial and error, worked out a github actions yml file for building on Windows using Github actions instead of Appveyor. Working appveyor yml file is at appveyor.yml

Working github actions build on Windows is at msbuild.yml

All the trial and error can be seen from the commit history

Main points - 

  • We need to use the env definition instead of setx, because refreshenv does not work
  • The default shell seems to not have wget, for downloading files, the working option is
    powershell -c "Invoke-WebRequest -Uri 'https://the.url' -OutFile 'thefile.exe'" 
  • The default build configuration seems to be Win32 and not x64, so that also needed to be configured manually in the msbuild call
  • Documentation and examples are sorely lacking.
  • There are other actions like this one for cross-platform downloading and unzipping, but I'll just run separate actions for now. 

Edit: Another option for installing OpenCV might be through vcpkg - 
https://github.com/microsoft/vcpkg#quick-start-windows


No comments:

Post a Comment