Add packaging for example app

+ Update CI workflows
This commit is contained in:
Shaun Reed 2023-04-02 11:43:59 -04:00
parent 3c2f7e8b5d
commit be69d2d242
3 changed files with 28 additions and 24 deletions

View File

@ -6,9 +6,9 @@ on:
workflow_dispatch: workflow_dispatch:
jobs: jobs:
Build-Qtk: Qtk:
env: env:
CONFIG: -DQTK_SUBMODULES=ON -DQTK_DEBUG=OFF -DQTK_CCACHE=OFF -DQTK_GUI=ON -DQTK_LIBRARY=ON -DQTK_PLUGINS=OFF CONFIG: -DQTK_SUBMODULES=ON -DQTK_DEBUG=OFF -DQTK_CCACHE=OFF -DQTK_GUI=ON -DQTK_LIBRARY=ON -DQTK_PLUGINS=OFF -DQTK_EXAMPLE=ON
strategy: strategy:
fail-fast: false fail-fast: false
matrix: matrix:
@ -44,24 +44,18 @@ jobs:
sudo apt update -y sudo apt update -y
sudo apt install libxcb-cursor0 -y sudo apt install libxcb-cursor0 -y
- name: Configure Qtk Application (Windows) - name: Configure Qtk Application
if: matrix.os == 'windows-latest'
shell: bash shell: bash
run: cmake -B build/ ${{ matrix.cmake }} run: cmake -B build/ ${{ matrix.cmake }}
- name: Build Qtk Application (Windows) - name: Build Qtk Application (Windows)
if: matrix.os == 'windows-latest' if: matrix.os == 'windows-latest'
shell: bash shell: bash
run: cmake --build build/ --config Release run: cmake --build build/ --config Release --target qtk_gui
# OSX / Linux # OSX / Linux
- name: Configure Qtk Application (OSX / Linux) - name: Build Qtk Application
if: matrix.os != 'windows-latest'
shell: bash
run: cmake -B build/ ${{ matrix.cmake }}
- name: Build Qtk Application (OSX / Linux)
if: matrix.os != 'windows-latest' if: matrix.os != 'windows-latest'
shell: bash shell: bash
run: cmake --build build/ --config Release --target qtk_gui -- -j $(nproc) run: cmake --build build/ --config Release --target qtk_gui -- -j $(nproc)
@ -87,7 +81,7 @@ jobs:
if: matrix.os == 'ubuntu-latest' if: matrix.os == 'ubuntu-latest'
uses: actions/upload-artifact@v3 uses: actions/upload-artifact@v3
with: with:
name: qtk-app-${{ matrix.os }} name: qtk-gui-${{ matrix.os }}
path: | path: |
build/packages/*.deb build/packages/*.deb
@ -102,7 +96,7 @@ jobs:
if: matrix.os == 'windows-latest' if: matrix.os == 'windows-latest'
uses: actions/upload-artifact@v3 uses: actions/upload-artifact@v3
with: with:
name: qtk-app-${{ matrix.os }} name: qtk-gui-${{ matrix.os }}
path: | path: |
build/packages/*.exe build/packages/*.exe
@ -117,14 +111,14 @@ jobs:
if: matrix.os == 'macos-latest' if: matrix.os == 'macos-latest'
uses: actions/upload-artifact@v3 uses: actions/upload-artifact@v3
with: with:
name: qtk-app-${{ matrix.os }} name: qtk-gui-${{ matrix.os }}
path: | path: |
build/packages/*.tar.gz build/packages/*.tar.gz
- name: Upload Qtk install directory - name: Upload Qtk install directory
uses: actions/upload-artifact@v3 uses: actions/upload-artifact@v3
with: with:
name: qtk-app-${{ matrix.os }}-install name: qtk-gui-${{ matrix.os }}-installdir
path: install/* path: install/*
# TODO: Enable after trimming resources. # TODO: Enable after trimming resources.
@ -142,9 +136,9 @@ jobs:
# build/packages/* # build/packages/*
# !build/packages/_CPack_Packages/* # !build/packages/_CPack_Packages/*
Build-Qtk-Library: Qtk-Library:
env: env:
CONFIG: -DQTK_SUBMODULES=ON -DQTK_DEBUG=OFF -DQTK_CCACHE=OFF -DQTK_GUI=OFF -DQTK_LIBRARY=ON -DQTK_PLUGINS=OFF CONFIG: -DQTK_SUBMODULES=ON -DQTK_DEBUG=OFF -DQTK_CCACHE=OFF -DQTK_GUI=OFF -DQTK_LIBRARY=ON -DQTK_PLUGINS=OFF -DQTK_EXAMPLE=OFF
strategy: strategy:
fail-fast: false fail-fast: false
matrix: matrix:
@ -255,12 +249,12 @@ jobs:
uses: actions/upload-artifact@v3 uses: actions/upload-artifact@v3
if: always() if: always()
with: with:
name: libqtk-${{ matrix.os }}-install name: libqtk-${{ matrix.os }}-installdir
path: install/* path: install/*
Build-Qtk-Plugins: Qtk-Plugins:
env: env:
CONFIG: -DQTK_SUBMODULES=ON -DQTK_DEBUG=OFF -DQTK_CCACHE=OFF -DQTK_GUI=OFF -DQTK_LIBRARY=OFF -DQTK_PLUGINS=ON CONFIG: -DQTK_SUBMODULES=ON -DQTK_DEBUG=OFF -DQTK_CCACHE=OFF -DQTK_GUI=OFF -DQTK_LIBRARY=OFF -DQTK_PLUGINS=ON -DQTK_EXAMPLE=OFF
strategy: strategy:
fail-fast: false fail-fast: false
matrix: matrix:
@ -318,7 +312,7 @@ jobs:
shell: bash shell: bash
run: cmake --install build/ --config Release --prefix=$(pwd)/install --component qtk_plugins run: cmake --install build/ --config Release --prefix=$(pwd)/install --component qtk_plugins
Build-Qtk-Assimp-Targets: Qtk-Assimp-Targets:
strategy: strategy:
fail-fast: false fail-fast: false
matrix: matrix:

View File

@ -172,5 +172,5 @@ add_subdirectory(src)
if(QTK_EXAMPLE) if(QTK_EXAMPLE)
# Create a namespaced alias for linking with qtk_library in the example. # Create a namespaced alias for linking with qtk_library in the example.
add_library(${PROJECT_NAME}::qtk_library ALIAS qtk_library) add_library(${PROJECT_NAME}::qtk_library ALIAS qtk_library)
add_subdirectory(example-app) add_subdirectory(example-app EXCLUDE_FROM_ALL)
endif() endif()

View File

@ -22,7 +22,11 @@ if(CMAKE_CXX_COMPILER_ID MATCHES "MSVC")
endif() endif()
# If you did not install Qtk on a system path, point cmake to installation. # If you did not install Qtk on a system path, point cmake to installation.
set(QTK_PATH ../build/install/lib/cmake/Qtk CACHE PATH "Path to installation of Qtk" FORCE) set(
QTK_PATH ../build/install/lib/cmake/Qtk
CACHE PATH "Path to installation of Qtk"
FORCE
)
# If you did not install Qt6 on a system path, point cmake to installation. # If you did not install Qt6 on a system path, point cmake to installation.
set(QT_INSTALL_DIR "$ENV{HOME}/Qt/6.5.0/gcc_64/" CACHE PATH "Path to Qt6") set(QT_INSTALL_DIR "$ENV{HOME}/Qt/6.5.0/gcc_64/" CACHE PATH "Path to Qt6")
@ -71,7 +75,7 @@ configure_file(
@ONLY @ONLY
) )
add_executable(qtk_example ${EXAMPLE_SOURCES}) qt_add_executable(qtk_example ${EXAMPLE_SOURCES})
target_link_libraries(qtk_example PUBLIC Qt6::Widgets Qt6::OpenGLWidgets Qt6::Core) target_link_libraries(qtk_example PUBLIC Qt6::Widgets Qt6::OpenGLWidgets Qt6::Core)
target_link_libraries(qtk_example PUBLIC Qtk::qtk_library) target_link_libraries(qtk_example PUBLIC Qtk::qtk_library)
target_include_directories(qtk_example PRIVATE "${CMAKE_CURRENT_BINARY_DIR}") target_include_directories(qtk_example PRIVATE "${CMAKE_CURRENT_BINARY_DIR}")
@ -84,3 +88,9 @@ install(
ARCHIVE DESTINATION lib/static ARCHIVE DESTINATION lib/static
RUNTIME DESTINATION bin RUNTIME DESTINATION bin
) )
qt_generate_deploy_app_script(
TARGET qtk_example
OUTPUT_SCRIPT QTK_EXAMPLE_DEPLOY_SCRIPT
NO_UNSUPPORTED_PLATFORM_ERROR
)
install(SCRIPT ${QTK_EXAMPLE_DEPLOY_SCRIPT} COMPONENT qtk_example)