Skip to content

Commit

Permalink
Updated cmake.yml
Browse files Browse the repository at this point in the history
  • Loading branch information
yushulx committed Jun 18, 2024
1 parent 0b16e08 commit f94bbd7
Showing 1 changed file with 35 additions and 0 deletions.
35 changes: 35 additions & 0 deletions .github/workflows/cmake.yml
Original file line number Diff line number Diff line change
Expand Up @@ -71,6 +71,41 @@ jobs:

steps:
- uses: actions/checkout@v3

# Download OpenCV source code
- name: Download OpenCV source code
run: |
git clone https://github.com/opencv/opencv.git
cd opencv
git checkout 4.x # Or specify a specific version
# Configure and build OpenCV
- name: Configure OpenCV
run: |
cmake -S opencv -B opencv/build -DBUILD_SHARED_LIBS=ON -DBUILD_opencv_world=OFF -DBUILD_opencv_apps=OFF -DBUILD_opencv_calib3d=OFF -DBUILD_opencv_dnn=OFF -DBUILD_opencv_features2d=OFF -DBUILD_opencv_flann=OFF -DBUILD_opencv_gapi=OFF -DBUILD_opencv_ml=OFF -DBUILD_opencv_objdetect=OFF -DBUILD_opencv_photo=OFF -DBUILD_opencv_stitching=OFF -DBUILD_opencv_video=OFF -DBUILD_TESTS=OFF -DBUILD_PERF_TESTS=OFF -DBUILD_EXAMPLES=OFF -DBUILD_DOCS=OFF -DCMAKE_BUILD_TYPE=${{ env.BUILD_TYPE }}
- name: Build OpenCV
run: cmake --build opencv/build --config ${{ env.BUILD_TYPE }}

# Package the built shared libraries
- name: Package Shared Libraries
run: |
mkdir -p packages/${{ matrix.os }}
cp -r opencv/build/lib packages/${{ matrix.os }}/
if: runner.os == 'Linux' || runner.os == 'macOS'

- name: Package Shared Libraries for Windows
run: |
mkdir -p packages/${{ matrix.os }}
cp -r opencv/build/Release/*.dll packages/${{ matrix.os }}/
if: runner.os == 'Windows'

# Upload artifacts
- name: Upload Shared Libraries
uses: actions/upload-artifact@v2
with:
name: shared-libraries-${{ matrix.os }}
path: packages/${{ matrix.os }}

- name: Set up QEMU
if: runner.os == 'Linux'
Expand Down

0 comments on commit f94bbd7

Please sign in to comment.