Compare commits

...

1 Commits

Author SHA1 Message Date
Shaun Reed bf137bc788 Cleanup 2023-03-11 15:16:41 -05:00
6 changed files with 114 additions and 157 deletions

View File

@ -8,7 +8,7 @@ on:
jobs:
Build-Qtk:
env:
CONFIG: -DQTK_UPDATE_SUBMODULES=ON -DQTK_DEBUG=OFF -DQTK_ENABLE_CCACHE=OFF -DQTK_INSTALL_GUI=ON -DQTK_INSTALL_LIB=ON -DQTK_INSTALL_PLUGINS=OFF
CONFIG: -DQTK_UPDATE_SUBMODULES=ON -DQTK_DEBUG=OFF -DQTK_ENABLE_CCACHE=OFF -DQTK_BUILD_GUI=ON -DQTK_INSTALL_LIBRARY=ON -DQTK_INSTALL_PLUGINS=OFF
strategy:
fail-fast: false
matrix:
@ -70,11 +70,11 @@ jobs:
shell: bash
run: cmake --build build/ --target package --config Release
# - uses: actions/upload-artifact@v3
# if: always()
# with:
# name: qtk-${{ matrix.os }}-install
# path: install/*
- name: Upload Qtk install directory
uses: actions/upload-artifact@v3
with:
name: qtk-${{ matrix.os }}-install
path: install/*
# TODO: Enable after trimming resources.
# - name: Package Qtk Application Sources
@ -82,27 +82,18 @@ jobs:
# shell: bash
# run: |
# cmake --build build/ --target package_source
#
# - name: Upload package artifacts
# uses: actions/upload-artifact@v3
# if: always()
# with:
# name: qtk-packages-${{ matrix.os }}
# name: qtk-${{ matrix.os }}-packages
# path: |
# build/packages/
# build/packages/*
# !build/packages/_CPack_Packages/*
- name: Upload logs on failure
uses: actions/upload-artifact@v3
if: ${{ failure() && matrix.os == 'windows-latest' }}
with:
name: qtk-failed-packages-${{ matrix.os }}
path: |
build/_CPack_Packages/win64/NSIS/NSISOutput.log
Build-Qtk-Library:
env:
CONFIG: -DQTK_UPDATE_SUBMODULES=ON -DQTK_DEBUG=OFF -DQTK_ENABLE_CCACHE=OFF -DQTK_INSTALL_GUI=OFF -DQTK_INSTALL_LIB=ON -DQTK_INSTALL_PLUGINS=OFF
CONFIG: -DQTK_UPDATE_SUBMODULES=ON -DQTK_DEBUG=OFF -DQTK_ENABLE_CCACHE=OFF -DQTK_BUILD_GUI=OFF -DQTK_INSTALL_LIBRARY=ON -DQTK_INSTALL_PLUGINS=OFF
strategy:
fail-fast: false
matrix:
@ -164,32 +155,25 @@ jobs:
shell: bash
run: cmake --build build/ --target package --config Release
# - uses: actions/upload-artifact@v3
# if: always()
# with:
# name: libqtk-${{ matrix.os }}-install
# path: install/*
# - name: Upload package artifacts
# uses: actions/upload-artifact@v3
# if: always()
# with:
# name: libqtk-packages-${{ matrix.os }}
# path: |
# build/packages/
# !build/packages/_CPack_Packages/*
- name: Upload logs on failure
- name: Upload libqtk install
uses: actions/upload-artifact@v3
if: ${{ failure() && matrix.os == 'windows-latest' }}
if: always()
with:
name: libqtk-failed-packages-${{ matrix.os }}
name: libqtk-${{ matrix.os }}-install
path: install/*
- name: Upload package artifacts
uses: actions/upload-artifact@v3
if: always()
with:
name: libqtk-packages-${{ matrix.os }}
path: |
build/_CPack_Packages/win64/NSIS/NSISOutput.log
build/packages/
!build/packages/_CPack_Packages/*
Build-Qtk-Plugins:
env:
CONFIG: -DQTK_UPDATE_SUBMODULES=ON -DQTK_DEBUG=OFF -DQTK_ENABLE_CCACHE=OFF -DQTK_INSTALL_GUI=OFF -DQTK_INSTALL_LIB=OFF -DQTK_INSTALL_PLUGINS=ON
CONFIG: -DQTK_UPDATE_SUBMODULES=ON -DQTK_DEBUG=OFF -DQTK_ENABLE_CCACHE=OFF -DQTK_BUILD_GUI=OFF -DQTK_INSTALL_LIBRARY=OFF -DQTK_INSTALL_PLUGINS=ON
strategy:
fail-fast: false
matrix:
@ -278,25 +262,3 @@ jobs:
shell: bash
run: |
sudo apt install libassimp-dev
- name: Build Qtk
if: matrix.os == 'windows-latest'
shell: bash
run: |
cmake -B build/ ${{ matrix.cmake }} -DQTK_DEBUG=OFF -DQTK_ENABLE_CCACHE=OFF
cmake --build build/ --config Release
- name: Build Qtk
if: matrix.os != 'windows-latest'
shell: bash
run: |
cmake -B build/ ${{ matrix.cmake }} -DQTK_DEBUG=OFF -DQTK_ENABLE_CCACHE=OFF
cmake --build build/ --config Release -- -j $(nproc)
# TODO: Enable with tag only when done testing
# Release-Qtk:
# needs: Build-Qtk
# strategy:
# fail-fast: false
# matrix:
# os: [ubuntu-latest, windows-latest, macos-latest]

View File

@ -23,6 +23,7 @@ if(WIN32)
set(CMAKE_COMPILE_WARNING_AS_ERROR OFF)
add_compile_options(/wd4131 /wd4127)
endif()
#add_compile_options(-fPIC)
################################################################################
# Project
@ -46,8 +47,8 @@ include(GNUInstallDirs)
################################################################################
option(QTK_DEBUG "Enable debugger" OFF)
option(QTK_UPDATE_SUBMODULES "Update external project (assimp) submodule" OFF)
option(QTK_INSTALL_GUI "Build the Qtk desktop application" ON)
option(QTK_INSTALL_LIB "Install libqtk to CMAKE_INSTALL_PREFIX path." ON)
option(QTK_BUILD_GUI "Build the Qtk desktop application" ON)
option(QTK_INSTALL_LIBRARY "Install libqtk to CMAKE_INSTALL_PREFIX path." ON)
option(QTK_INSTALL_PLUGINS "Install Qtk plugin collection to Qt Creator." OFF)
option(QTK_BUILD_EXAMPLE "Build the Qtk example desktop application" ON)
option(QTK_ENABLE_CCACHE "Enable ccache" ON)

View File

@ -92,7 +92,7 @@ using libqtk.
Below is an example of installing on a system path.
```bash
cmake -S qtk/ -B qtk/build/ -DCMAKE_PREFIX_PATH=$HOME/Qt/6.5.0/gcc_64 -DQTK_INSTALL_GUI=OFF -DQTK_INSTALL_PLUGINS=OFF -DQTK_DEBUG=OFF
cmake -S qtk/ -B qtk/build/ -DCMAKE_PREFIX_PATH=$HOME/Qt/6.5.0/gcc_64 -DQTK_BUILD_GUI=OFF -DQTK_INSTALL_PLUGINS=OFF -DQTK_DEBUG=OFF
cmake --build qtk/build/ -j $(nproc --ignore=2)
sudo cmake --install . --prefix=/usr/local
-- Install configuration: "Release"
@ -133,7 +133,7 @@ interfaces.
To build and install the Qtk plugin collection -
```bash
cmake -S /path/to/qtk -B /path/to/qtk/build -DCMAKE_PREFIX_PATH=$HOME/Qt/6.5.0/gcc_64 -DQTK_INSTALL_PLUGINS=ON -DQTK_INSTALL_GUI=OFF -DQTK_INSTALL_LIB=OFF
cmake -S /path/to/qtk -B /path/to/qtk/build -DCMAKE_PREFIX_PATH=$HOME/Qt/6.5.0/gcc_64 -DQTK_INSTALL_PLUGINS=ON -DQTK_BUILD_GUI=OFF -DQTK_INSTALL_LIBRARY=OFF
cmake --build /path/to/qtk/build
cmake --install /path/to/qtk/build
```
@ -278,10 +278,11 @@ Any of the above options can be appended with `--trace-expand` to debug package
generation issues.
The contents of all packages will depend on how the build was configured.
If we are generating packages for *only* libqtk, we set `-DQTK_INSTALL_LIB=ON`
If we are generating packages for *only* libqtk, we
set `-DQTK_INSTALL_LIBRARY=ON`
during the cmake configuration step.
To generate packages for Qtk desktop application, we should
set `-DQTK_INSTALL_GUI=ON`, and optionally `-DQTK_INSTALL_LIB=ON` if we would
set `-DQTK_BUILD_GUI=ON`, and optionally `-DQTK_INSTALL_LIBRARY=ON` if we would
like to bundle libqtk with the desktop application.
The NSIS installer will allow component-specific path modification for all of
@ -295,6 +296,8 @@ Some useful links and resources that I have found while working on this project.
[QtPlugin Import / Export plugins](https://doc.qt.io/qt-6/qtplugin.html)
[KDAB](https://www.kdab.com/)
## Model Artists
"Alien Hominid" (https://skfb.ly/onStx) by Nwilly_art is licensed under Creative

View File

@ -6,14 +6,43 @@
################################################################################
# Qtk Library
# We always build libqtk since the plugins and GUI both depend on it.
add_subdirectory(qtk)
install(
FILES
"${CMAKE_CURRENT_BINARY_DIR}/${PROJECT_NAME}Config.cmake"
"${CMAKE_CURRENT_BINARY_DIR}/${PROJECT_NAME}ConfigVersion.cmake"
COMPONENT libqtk
DESTINATION lib/cmake/${PROJECT_NAME}
)
install(
EXPORT qtk_export
FILE ${PROJECT_NAME}Targets.cmake
NAMESPACE ${PROJECT_NAME}::
COMPONENT libqtk
DESTINATION lib/cmake/${PROJECT_NAME}
)
# System install for qtk_library
install(
TARGETS qtk_library
# Associate qtk_library target with qtk-export
EXPORT qtk_export
COMPONENT libqtk
FILE_SET HEADERS DESTINATION include
INCLUDES DESTINATION include
LIBRARY DESTINATION lib
ARCHIVE DESTINATION lib/static
RUNTIME DESTINATION bin
)
# Qtk Application
if (QTK_INSTALL_GUI OR QTK_INSTALL_PLUGINS)
if (QTK_BUILD_GUI OR QTK_INSTALL_PLUGINS)
add_subdirectory(app)
endif()
# Install custom Qtk plugins for Qt Designer.
if(QTK_INSTALL_PLUGINS)
if(QTK_INSTALL_PLUGINS)
# Optionally install custom Qtk plugins for Qt Designer.
install(
TARGETS qtk_library qtk_plugin_library
COMPONENT qtk_collection
@ -28,11 +57,11 @@ if (QTK_INSTALL_GUI OR QTK_INSTALL_PLUGINS)
ARCHIVE DESTINATION "${QTK_PLUGIN_INSTALL_DIR}"
RUNTIME DESTINATION "${QTK_PLUGIN_INSTALL_DIR}"
)
endif()
endif()
if(QTK_INSTALL_GUI)
if(QTK_BUILD_GUI)
install(
TARGETS qtk_app qtk_library
TARGETS qtk_app
COMPONENT qtk
BUNDLE DESTINATION .
LIBRARY DESTINATION lib
@ -69,7 +98,6 @@ if (QTK_INSTALL_GUI OR QTK_INSTALL_PLUGINS)
file(APPEND ${VSUSER_FILE} "</Project>\n")
endif()
endif()
endif()
endif()
write_basic_package_version_file(
@ -82,35 +110,6 @@ configure_package_config_file(
INSTALL_DESTINATION lib/cmake/${PROJECT_NAME}
)
if (QTK_INSTALL_LIB)
install(
FILES
"${CMAKE_CURRENT_BINARY_DIR}/${PROJECT_NAME}Config.cmake"
"${CMAKE_CURRENT_BINARY_DIR}/${PROJECT_NAME}ConfigVersion.cmake"
COMPONENT libqtk
DESTINATION lib/cmake/${PROJECT_NAME}
)
install(
EXPORT qtk_export
FILE ${PROJECT_NAME}Targets.cmake
NAMESPACE ${PROJECT_NAME}::
COMPONENT libqtk
DESTINATION lib/cmake/${PROJECT_NAME}
)
# System install for qtk_library
install(
TARGETS qtk_library
# Associate qtk_library target with qtk-export
EXPORT qtk_export
COMPONENT libqtk
FILE_SET HEADERS DESTINATION include
INCLUDES DESTINATION include
LIBRARY DESTINATION lib
ARCHIVE DESTINATION lib/static
RUNTIME DESTINATION bin
)
endif()
set(CPACK_RESOURCE_FILE_LICENSE "${CMAKE_SOURCE_DIR}/LICENSE")
set(CPACK_PACKAGE_VERSION_MAJOR "${PROJECT_VERSION_MAJOR}")
set(CPACK_PACKAGE_VERSION_MINOR "${PROJECT_VERSION_MINOR}")

View File

@ -54,13 +54,6 @@ set(
main.cpp
)
qt6_add_big_resources(QTK_APP_SOURCES "${QTK_RESOURCES}/resources.qrc")
configure_file(
resources.h.in
"${CMAKE_CURRENT_BINARY_DIR}/resources.h"
@ONLY
)
qt_add_executable(qtk_app ${QTK_APP_SOURCES})
target_link_libraries(qtk_app PRIVATE qtk_plugin_library)

View File

@ -7,7 +7,6 @@
##############################################################################*/
#include "qtkscene.h"
#include "resources.h"
using namespace Qtk;