Im cooked chat #27
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| name: CMake Multi-Platform | |
| on: | |
| push: | |
| branches: [ "main" ] | |
| pull_request: | |
| branches: [ "main" ] | |
| jobs: | |
| build: | |
| runs-on: ${{ matrix.os }} | |
| strategy: | |
| fail-fast: false | |
| matrix: | |
| os: [ubuntu-latest, windows-latest] | |
| build_type: [Debug, Release] | |
| steps: | |
| - name: Checkout Repository | |
| uses: actions/checkout@v4 | |
| - name: Set up CMake | |
| uses: jwlawson/actions-setup-cmake@v2 | |
| with: | |
| cmake-version: '4.1.1' | |
| # Linux Dependencies | |
| - name: Install Dependencies (Linux) | |
| if: runner.os == 'Linux' | |
| run: | | |
| sudo apt-get update | |
| sudo apt-get install -y pkg-config libopencv-dev libeigen3-dev libopenexr-dev | |
| # Windows Dependencies | |
| - name: Install Dependencies (Windows) | |
| if: runner.os == 'Windows' | |
| shell: pwsh | |
| run: | | |
| choco install opencv | |
| choco install eigen | |
| # Configure | |
| - name: Configure with CMake | |
| run: | | |
| if [[ "$RUNNER_OS" == "Linux" ]]; then | |
| cmake -B build -S $GITHUB_WORKSPACE \ | |
| 1-DCMAKE_BUILD_TYPE=${{ matrix.build_type }} \ | |
| -DOpenCV_DIR=/usr/lib/x86_64-linux-gnu/cmake/opencv4 | |
| else | |
| cmake -B build -S $GITHUB_WORKSPACE \ | |
| -DCMAKE_BUILD_TYPE=${{ matrix.build_type }} | |
| fi | |
| # Build | |
| - name: Build | |
| run: cmake --build build --config ${{ matrix.build_type }} --parallel | |
| # Install | |
| - name: Install | |
| run: cmake --install build --prefix instdir |