diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index e731903..c2b51aa 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -25,25 +25,25 @@ jobs: - os: ubuntu-20.04 name: Linux release-suffix: LIN64 - cmake-args: -D32BLIT_PATH=$GITHUB_WORKSPACE/32blit + cmake-args: -D32BLIT_DIR=$GITHUB_WORKSPACE/32blit-sdk apt-packages: libsdl2-dev libsdl2-image-dev libsdl2-net-dev python3-setuptools - os: ubuntu-20.04 name: STM32 release-suffix: STM32 - cmake-args: -DCMAKE_TOOLCHAIN_FILE=$GITHUB_WORKSPACE/32blit/32blit.toolchain + cmake-args: -DCMAKE_TOOLCHAIN_FILE=$GITHUB_WORKSPACE/32blit-sdk/32blit.toolchain apt-packages: gcc-arm-none-eabi libnewlib-arm-none-eabi libstdc++-arm-none-eabi-newlib python3-setuptools - os: macos-latest name: macOS release-suffix: MACOS - cmake-args: -D32BLIT_PATH=$GITHUB_WORKSPACE/32blit + cmake-args: -D32BLIT_DIR=$GITHUB_WORKSPACE/32blit-sdk brew-packages: sdl2 sdl2_image sdl2_net - os: windows-latest name: Visual Studio release-suffix: WIN64 - cmake-args: -D32BLIT_PATH=$GITHUB_WORKSPACE/32blit + cmake-args: -D32BLIT_DIR=$GITHUB_WORKSPACE/32blit-sdk runs-on: ${{matrix.os}} @@ -61,8 +61,8 @@ jobs: - name: Checkout 32Blit API uses: actions/checkout@v2 with: - repository: pimoroni/32blit-beta - path: 32blit + repository: 32blit/32blit-sdk + path: 32blit-sdk # Linux dependencies - name: Install Linux deps diff --git a/CMakeLists.txt b/CMakeLists.txt index f4a69d1..497bfa4 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -4,9 +4,6 @@ cmake_minimum_required(VERSION 3.9) # Replace "game" with a name for your project (this is used the name of the output) project(game) -# This is the default value for 32BLIT_PATH, usually you would set this through -D32BLIT_PATH=the/path, but you can change the default here for convenience -set(32BLIT_PATH "../" CACHE PATH "Path to the directory containing 32blit.cmake") - # Add your sources here (adding headers is optional, but helps some CMake generators) set(PROJECT_SOURCE game.cpp game.hpp) @@ -19,10 +16,8 @@ if(MSVC) else() add_compile_options("-Wall" "-Wextra" "-Wdouble-promotion" "-Wno-unused-parameter") endif() -if(NOT EXISTS ${32BLIT_PATH}/32blit.cmake) - message(FATAL_ERROR "Define location of 32Blit API with -D32BLIT_PATH=") -endif() -include (${32BLIT_PATH}/32blit.cmake) + +find_package (32BLIT CONFIG REQUIRED PATHS ../32blit-sdk) blit_executable (${PROJECT_NAME} ${PROJECT_SOURCE}) blit_assets_yaml (${PROJECT_NAME} assets.yml)