From 63a581cff8988c91936583205107c38a4ac5c81c Mon Sep 17 00:00:00 2001 From: Charlie Birks Date: Sat, 6 Feb 2021 12:20:14 +0000 Subject: [PATCH] CMake/boilerplate updates --- .github/workflows/build.yml | 7 +++---- CMakeLists.txt | 9 ++++++++- 2 files changed, 11 insertions(+), 5 deletions(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 0703168..88b2837 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -91,7 +91,7 @@ jobs: - name: Configure CMake shell: bash working-directory: ${{runner.workspace}}/main/build - run: cmake $GITHUB_WORKSPACE/main -DCMAKE_BUILD_TYPE=$BUILD_TYPE -DCMAKE_INSTALL_PREFIX=`pwd` ${{matrix.cmake-args}} + run: cmake $GITHUB_WORKSPACE/main -DCMAKE_BUILD_TYPE=$BUILD_TYPE -DCPACK_PACKAGE_FILE_NAME=${{env.RELEASE_FILE}} ${{matrix.cmake-args}} # And then run the build itself - name: Build @@ -105,9 +105,8 @@ jobs: shell: bash working-directory: ${{runner.workspace}}/main/build run: | - cmake --build . --target install - tar -zcf ${RELEASE_FILE}.tar.gz bin/ - 7z a ${RELEASE_FILE}.zip bin/* + cmake --build . --target package + # Push the tar file to the release - name: Upload tar if: github.event_name == 'release' && matrix.release-suffix != '' diff --git a/CMakeLists.txt b/CMakeLists.txt index 20cff97..bffca3b 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -1,5 +1,5 @@ # Basic parameters; check that these match your project / environment -cmake_minimum_required(VERSION 3.8) +cmake_minimum_required(VERSION 3.9) project(mjpeg-player) set(32BLIT_PATH "../" CACHE PATH "Path to 32blit.cmake") @@ -7,6 +7,7 @@ set(PROJECT_SOURCE avi-file.cpp mjpeg-player.cpp ) +set(PROJECT_DISTRIBS LICENSE README.md) #set(CMAKE_CXX_FLAGS_DEBUG "${CMAKE_CXX_FLAGS_DEBUG} -fsanitize=address") @@ -30,3 +31,9 @@ blit_metadata (${PROJECT_NAME} metadata.yml) target_link_libraries (${PROJECT_NAME} DUH) add_custom_target (flash DEPENDS ${PROJECT_NAME}.flash) + +# setup release packages +install (FILES ${PROJECT_DISTRIBS} DESTINATION .) +set (CPACK_INCLUDE_TOPLEVEL_DIRECTORY OFF) +set (CPACK_GENERATOR "ZIP" "TGZ") +include (CPack) \ No newline at end of file