Update CMakeLists.txt #136
This file contains 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 on Multiple Platforms | |
on: | |
push: | |
branches: [ "master" ] | |
pull_request: | |
branches: [ "master" ] | |
jobs: | |
build: | |
runs-on: ${{ matrix.os }} | |
strategy: | |
fail-fast: false | |
matrix: | |
os: [ubuntu-latest, windows-latest] | |
steps: | |
# Step 1: Checkout the repository | |
- name: Checkout repository | |
uses: actions/checkout@v4 | |
with: | |
submodules: recursive | |
# Step 2: Install dependencies | |
- name: Install dependencies on Ubuntu | |
if: ${{ matrix.os == 'ubuntu-latest' }} | |
run: | | |
sudo apt-get update | |
sudo apt-get install -y build-essential libgtk-3-dev cmake apt-utils git wget | |
- name: Install dependencies on Windows | |
if: ${{ matrix.os == 'windows-latest' }} | |
run: | | |
choco install cmake --installargs 'ADD_CMAKE_TO_PATH=System' -y | |
choco install visualstudio2019buildtools -y --ignore-checksums | |
choco install git -y | |
# Step 3: Build wxWidgets (cross-platform setup) | |
- name: Configure and build wxWidgets | |
run: | | |
mkdir -p external/wxWidgets/build | |
cd external/wxWidgets/build | |
cmake .. -DCMAKE_BUILD_TYPE=Release -DwxBUILD_SHARED=OFF | |
cmake --build . --config Release | |
# Step 4: Build and test your project | |
- name: Build and test using CMake | |
run: | | |
mkdir build && cd build | |
cmake .. -DCMAKE_BUILD_TYPE=Release | |
cmake --build . --config Release | |
ctest --output-on-failure |