add integration test; install headers; matrix paths
This commit is contained in:
parent
0842e9506a
commit
061daaebe0
|
@ -1,5 +1,11 @@
|
||||||
name: CMake Build Matrix
|
name: CMake Build Matrix
|
||||||
|
|
||||||
|
# Directories
|
||||||
|
# - $GITHUB_WORKSPACE/qskinny_source : Checkout directory for qskinny sources
|
||||||
|
# - $GITHUB_WORKSPACE/qskinny_build : Build directory for QSkinny CMake
|
||||||
|
# - $GITHUB_WORKSPACE/qskinny_install : Install directory for QSkinny package
|
||||||
|
# - $GITHUB_WORKSPACE/qskinny_build_test : Build directory for QSkinny CMake integration test
|
||||||
|
|
||||||
on:
|
on:
|
||||||
push:
|
push:
|
||||||
branches: [cmake]
|
branches: [cmake]
|
||||||
|
@ -185,12 +191,16 @@ jobs:
|
||||||
|
|
||||||
steps:
|
steps:
|
||||||
# Checks-out your repository under $GITHUB_WORKSPACE, so your job can access it
|
# Checks-out your repository under $GITHUB_WORKSPACE, so your job can access it
|
||||||
- uses: actions/checkout@v2
|
- name: Git Checkout
|
||||||
|
uses: actions/checkout@v3
|
||||||
|
with:
|
||||||
|
path: qskinny_source
|
||||||
|
|
||||||
- name: Print env
|
- name: Print env
|
||||||
run: |
|
run: |
|
||||||
echo github.event.action: ${{ github.event.action }}
|
echo github.event.action: ${{ github.event.action }}
|
||||||
echo github.event_name: ${{ github.event_name }}
|
echo github.event_name: ${{ github.event_name }}
|
||||||
|
|
||||||
- name: Install dependencies on windows
|
- name: Install dependencies on windows
|
||||||
if: startsWith(matrix.config.os, 'windows')
|
if: startsWith(matrix.config.os, 'windows')
|
||||||
run: |
|
run: |
|
||||||
|
@ -207,6 +217,7 @@ jobs:
|
||||||
ninja --version
|
ninja --version
|
||||||
cmake --version
|
cmake --version
|
||||||
gcc --version
|
gcc --version
|
||||||
|
|
||||||
- name: Install dependencies on ubuntu9
|
- name: Install dependencies on ubuntu9
|
||||||
if: startsWith(matrix.config.name, 'Ubuntu GCC 9')
|
if: startsWith(matrix.config.name, 'Ubuntu GCC 9')
|
||||||
run: |
|
run: |
|
||||||
|
@ -242,6 +253,7 @@ jobs:
|
||||||
sudo update-alternatives --install /usr/bin/cmake cmake /opt/cmake/bin/cmake 1 --force
|
sudo update-alternatives --install /usr/bin/cmake cmake /opt/cmake/bin/cmake 1 --force
|
||||||
echo cmake version after
|
echo cmake version after
|
||||||
cmake --version
|
cmake --version
|
||||||
|
|
||||||
- name: Install dependencies on macos
|
- name: Install dependencies on macos
|
||||||
if: startsWith(matrix.config.os, 'macos')
|
if: startsWith(matrix.config.os, 'macos')
|
||||||
run: |
|
run: |
|
||||||
|
@ -253,7 +265,15 @@ jobs:
|
||||||
if: startsWith(matrix.config.name, 'Ubuntu') && endsWith(matrix.config.name, 'Qt6')
|
if: startsWith(matrix.config.name, 'Ubuntu') && endsWith(matrix.config.name, 'Qt6')
|
||||||
run: sudo apt-get install libxkbcommon-dev -y
|
run: sudo apt-get install libxkbcommon-dev -y
|
||||||
|
|
||||||
- uses: actions/checkout@v2
|
- name: Install hunspell for Ubuntu
|
||||||
|
if: false && startsWith(matrix.config.name, 'Ubuntu')
|
||||||
|
run: |
|
||||||
|
sudo apt-get install -y libhunspell-dev
|
||||||
|
|
||||||
|
- name: Install pinyin for Ubuntu
|
||||||
|
if: false && startsWith(matrix.config.name, 'Ubuntu')
|
||||||
|
run: |
|
||||||
|
sudo apt-get install -y libimepinyin-dev
|
||||||
|
|
||||||
- name: Cache Qt5
|
- name: Cache Qt5
|
||||||
if: endsWith(matrix.config.name, 'Qt5')
|
if: endsWith(matrix.config.name, 'Qt5')
|
||||||
|
@ -278,7 +298,7 @@ jobs:
|
||||||
version: "5.15.2"
|
version: "5.15.2"
|
||||||
target: "desktop"
|
target: "desktop"
|
||||||
install-deps: "true"
|
install-deps: "true"
|
||||||
modules: "qtwebengine"
|
modules: "qtwebengine qtpositioning"
|
||||||
cached: ${{ steps.cache-qt-5-15.outputs.cache-hit }}
|
cached: ${{ steps.cache-qt-5-15.outputs.cache-hit }}
|
||||||
setup-python: "false"
|
setup-python: "false"
|
||||||
tools: ""
|
tools: ""
|
||||||
|
@ -292,49 +312,53 @@ jobs:
|
||||||
version: "6.2.4"
|
version: "6.2.4"
|
||||||
target: "desktop"
|
target: "desktop"
|
||||||
install-deps: "true"
|
install-deps: "true"
|
||||||
modules: "qtwebengine"
|
modules: "qtwebengine qtpositioning"
|
||||||
cached: ${{ steps.cache-qt-6-2.outputs.cache-hit }}
|
cached: ${{ steps.cache-qt-6-2.outputs.cache-hit }}
|
||||||
setup-python: "false"
|
setup-python: "false"
|
||||||
tools: ""
|
tools: ""
|
||||||
set-env: "true"
|
set-env: "true"
|
||||||
tools-only: "false"
|
tools-only: "false"
|
||||||
|
|
||||||
- name: Install hunspell for Ubuntu
|
- name: Configure ( QSkinny )
|
||||||
if: startsWith(matrix.config.name, 'Ubuntu')
|
|
||||||
run: |
|
|
||||||
sudo apt-get install -y libhunspell-dev
|
|
||||||
|
|
||||||
- name: Install pinyin for Ubuntu
|
|
||||||
if: startsWith(matrix.config.name, 'Ubuntu')
|
|
||||||
run: |
|
|
||||||
sudo apt-get install -y libimepinyin-dev
|
|
||||||
|
|
||||||
- name: Configure
|
|
||||||
shell: bash
|
shell: bash
|
||||||
run: |
|
run: |
|
||||||
mkdir build
|
mkdir qskinny_build
|
||||||
mkdir instdir
|
mkdir qskinny_install
|
||||||
cmake \
|
cmake \
|
||||||
-S . \
|
-S qskinny_source \
|
||||||
-B . \
|
-B qskinny_build \
|
||||||
-G "${{ matrix.config.generators }}" \
|
-G "${{ matrix.config.generators }}" \
|
||||||
-DCMAKE_BUILD_TYPE=${{ matrix.config.build_type }} \
|
-DCMAKE_BUILD_TYPE=${{ matrix.config.build_type }} \
|
||||||
-DCMAKE_INSTALL_PREFIX:PATH=instdir \
|
-DCMAKE_INSTALL_PREFIX:PATH=qskinny_install \
|
||||||
-D${{ matrix.config.cmake.qtdirkey }}:PATH="${{ matrix.config.cmake.qtdirvalue }}" \
|
-D${{ matrix.config.cmake.qtdirkey }}:PATH="${{ matrix.config.cmake.qtdirvalue }}"
|
||||||
-DENABLE_HUNSPELL:BOOL=ON \
|
|
||||||
-DENABLE_PINYIN:BOOL=ON
|
|
||||||
|
|
||||||
- name: Build
|
- name: Build ( QSkinny )
|
||||||
shell: bash
|
shell: bash
|
||||||
run: cmake --build . --config ${{ matrix.config.build_type }}
|
run: cmake --build qskinny_build --config ${{ matrix.config.build_type }}
|
||||||
|
|
||||||
#- name: Tests
|
#- name: Tests
|
||||||
# shell: bash
|
# shell: bash
|
||||||
# run: ctest -j14 -C Release -T test --output-on-failure
|
# run: ctest -j14 -C Release -T test --output-on-failure
|
||||||
|
|
||||||
# - name: Install Strip
|
- name: Install ( QSkinny ) Strip
|
||||||
# shell: bash
|
shell: bash
|
||||||
# run: cmake --install . --strip
|
run: cmake --install . --strip
|
||||||
|
|
||||||
|
- name: Configure ( CMake Integration Test )
|
||||||
|
shell: bash
|
||||||
|
run: |
|
||||||
|
mkdir qskinny_build_test
|
||||||
|
cmake \
|
||||||
|
-S qskinny_source/examples/iotdashboard_smoketest \
|
||||||
|
-B qskinny_build_test \
|
||||||
|
-G "${{ matrix.config.generators }}" \
|
||||||
|
-DCMAKE_BUILD_TYPE=${{ matrix.config.build_type }} \
|
||||||
|
-D${{ matrix.config.cmake.qtdirkey }}:PATH="${{ matrix.config.cmake.qtdirvalue }}" \
|
||||||
|
-DQSkinny_DIR:PATH=qskinny_install/lib/cmake/QSkinny
|
||||||
|
|
||||||
|
- name: Build ( CMake Integration Test )
|
||||||
|
shell: bash
|
||||||
|
run: cmake --build qskinny_build_test --config ${{ matrix.config.build_type }}
|
||||||
|
|
||||||
# - name: Pack
|
# - name: Pack
|
||||||
# shell: bash
|
# shell: bash
|
||||||
|
|
|
@ -99,10 +99,6 @@ set(QSK_INSTALL_EXAMPLES examples)
|
||||||
set(CMAKE_DEBUG_POSTFIX d)
|
set(CMAKE_DEBUG_POSTFIX d)
|
||||||
# define binary install directory globally
|
# define binary install directory globally
|
||||||
set(CMAKE_INSTALL_BINDIR ${QSK_INSTALL_BINS}$<$<CONFIG:Debug>:/debug>)
|
set(CMAKE_INSTALL_BINDIR ${QSK_INSTALL_BINS}$<$<CONFIG:Debug>:/debug>)
|
||||||
# define library install directory globally
|
|
||||||
# set(CMAKE_INSTALL_LIBDIR lib$<$<CONFIG:Debug>:/debug>)
|
|
||||||
# define install rpath globally
|
|
||||||
# set(CMAKE_INSTALL_RPATH ${CMAKE_INSTALL_PREFIX}/${QSK_INSTALL_LIBS})
|
|
||||||
|
|
||||||
add_subdirectory(src)
|
add_subdirectory(src)
|
||||||
add_subdirectory(skins)
|
add_subdirectory(skins)
|
||||||
|
@ -134,7 +130,8 @@ install(TARGETS qskinny EXPORT ${PACKAGE_NAME}Targets
|
||||||
LIBRARY DESTINATION ${QSK_INSTALL_LIBS}
|
LIBRARY DESTINATION ${QSK_INSTALL_LIBS}
|
||||||
ARCHIVE DESTINATION ${QSK_INSTALL_LIBS}
|
ARCHIVE DESTINATION ${QSK_INSTALL_LIBS}
|
||||||
RUNTIME DESTINATION ${QSK_INSTALL_LIBS}
|
RUNTIME DESTINATION ${QSK_INSTALL_LIBS}
|
||||||
INCLUDES DESTINATION ${QSK_INSTALL_HEADERS})
|
INCLUDES DESTINATION ${QSK_INSTALL_HEADERS}
|
||||||
|
PUBLIC_HEADER DESTINATION ${QSK_INSTALL_HEADERS})
|
||||||
|
|
||||||
include(CMakePackageConfigHelpers)
|
include(CMakePackageConfigHelpers)
|
||||||
write_basic_package_version_file(
|
write_basic_package_version_file(
|
||||||
|
|
|
@ -80,8 +80,22 @@ set_target_properties(${TARGET_NAME}
|
||||||
AUTORCC ON
|
AUTORCC ON
|
||||||
FOLDER examples)
|
FOLDER examples)
|
||||||
|
|
||||||
target_link_libraries(${TARGET_NAME}
|
if(TARGET Qsk::qskinny)
|
||||||
|
# integration test
|
||||||
|
# - qsktestsupport doesn't exists
|
||||||
|
# - qskinny has a namespace Qsk
|
||||||
|
target_link_libraries(${TARGET_NAME}
|
||||||
|
PRIVATE
|
||||||
|
Qsk::qskinny
|
||||||
|
${Qt}::Svg)
|
||||||
|
else()
|
||||||
|
target_link_libraries(${TARGET_NAME}
|
||||||
PRIVATE
|
PRIVATE
|
||||||
qskinny
|
qskinny
|
||||||
qsktestsupport
|
qsktestsupport
|
||||||
${Qt}::Svg)
|
${Qt}::Svg)
|
||||||
|
|
||||||
|
target_compile_definitions(${TARGET_NAME}
|
||||||
|
PRIVATE
|
||||||
|
USE_SHORTCUTS)
|
||||||
|
endif()
|
|
@ -7,7 +7,9 @@
|
||||||
#include "GraphicProvider.h"
|
#include "GraphicProvider.h"
|
||||||
#include "Skin.h"
|
#include "Skin.h"
|
||||||
|
|
||||||
|
#ifdef USE_SHORTCUTS
|
||||||
#include <SkinnyShortcut.h>
|
#include <SkinnyShortcut.h>
|
||||||
|
#endif
|
||||||
|
|
||||||
#include <QskSetup.h>
|
#include <QskSetup.h>
|
||||||
#include <QskShortcutMap.h>
|
#include <QskShortcutMap.h>
|
||||||
|
@ -75,9 +77,11 @@ int main( int argc, char* argv[] )
|
||||||
|
|
||||||
qskSetup->setSkin( "DaytimeSkin" );
|
qskSetup->setSkin( "DaytimeSkin" );
|
||||||
|
|
||||||
|
#ifdef USE_SHORTCUTS
|
||||||
// With CTRL-B you can rotate a couple of visual debug modes
|
// With CTRL-B you can rotate a couple of visual debug modes
|
||||||
SkinnyShortcut::enable( SkinnyShortcut::RotateSkin | SkinnyShortcut::DebugBackground |
|
SkinnyShortcut::enable( SkinnyShortcut::RotateSkin | SkinnyShortcut::DebugBackground |
|
||||||
SkinnyShortcut::DebugStatistics | SkinnyShortcut::Quit );
|
SkinnyShortcut::DebugStatistics | SkinnyShortcut::Quit );
|
||||||
|
#endif
|
||||||
|
|
||||||
MainWindow window;
|
MainWindow window;
|
||||||
window.show();
|
window.show();
|
||||||
|
|
|
@ -0,0 +1,57 @@
|
||||||
|
cmake_minimum_required(VERSION 3.18)
|
||||||
|
|
||||||
|
project(iotdashboard_smoketest)
|
||||||
|
|
||||||
|
find_package(QSkinny REQUIRED)
|
||||||
|
|
||||||
|
if("${Qt5_DIR}" STREQUAL "" AND "${Qt6_DIR}" STREQUAL "")
|
||||||
|
message(FATAL_ERROR "Neither Qt5_DIR nor Qt6_DIR defined!")
|
||||||
|
else()
|
||||||
|
# force include Qt's private headers
|
||||||
|
if(NOT "${Qt5_DIR}" STREQUAL "")
|
||||||
|
set(Qt5Core_FIND_COMPONENTS Private CACHE STRING "force include private headers" FORCE)
|
||||||
|
set(Qt5Gui_FIND_COMPONENTS Private CACHE STRING "force include private headers" FORCE)
|
||||||
|
set(Qt5OpenGL_FIND_COMPONENTS Private CACHE STRING "force include private headers" FORCE)
|
||||||
|
set(Qt5Quick_FIND_COMPONENTS Private CACHE STRING "force include private headers" FORCE)
|
||||||
|
set(Qt5QuickWidgets_FIND_COMPONENTS Private CACHE STRING "force include private headers" FORCE)
|
||||||
|
set(Qt5Svg_FIND_COMPONENTS Private CACHE STRING "force include private headers" FORCE)
|
||||||
|
set(Qt5WebEngine_FIND_COMPONENTS Private CACHE STRING "force include private headers" FORCE)
|
||||||
|
set(Qt5WebEngineCore_FIND_COMPONENTS Private CACHE STRING "force include private headers" FORCE)
|
||||||
|
set(Qt5Widgets_FIND_COMPONENTS Private CACHE STRING "force include private headers" FORCE)
|
||||||
|
elseif(NOT "${Qt6_DIR}" STREQUAL "")
|
||||||
|
#set(Qt6Core_FIND_COMPONENTS Private CACHE STRING "force include private headers" FORCE)
|
||||||
|
#set(Qt6Gui_FIND_COMPONENTS Private CACHE STRING "force include private headers" FORCE)
|
||||||
|
set(Qt6OpenGL_FIND_COMPONENTS Private CACHE STRING "force include private headers" FORCE)
|
||||||
|
#set(Qt6Quick_FIND_COMPONENTS Private CACHE STRING "force include private headers" FORCE)
|
||||||
|
#set(Qt6QuickWidgets_FIND_COMPONENTS Private CACHE STRING "force include private headers" FORCE)
|
||||||
|
#set(Qt6Svg_FIND_COMPONENTS Private CACHE STRING "force include private headers" FORCE)
|
||||||
|
set(Qt6WebEngine_FIND_COMPONENTS Private CACHE STRING "force include private headers" FORCE)
|
||||||
|
set(Qt6WebEngineCore_FIND_COMPONENTS Private CACHE STRING "force include private headers" FORCE)
|
||||||
|
set(Qt6WebEngineQuick_FIND_COMPONENTS Private CACHE STRING "force include private headers" FORCE)
|
||||||
|
#set(Qt6Widgets_FIND_COMPONENTS Private CACHE STRING "force include private headers" FORCE)
|
||||||
|
endif()
|
||||||
|
endif()
|
||||||
|
|
||||||
|
if(NOT "${Qt5_DIR}" STREQUAL "")
|
||||||
|
find_package(Qt5 REQUIRED COMPONENTS Core Gui OpenGL Quick Svg Widgets)
|
||||||
|
find_package(Qt5 OPTIONAL_COMPONENTS QuickWidgets WebEngine WebEngineCore)
|
||||||
|
set(Qt Qt${Qt5_VERSION_MAJOR})
|
||||||
|
set(Qt_VERSION ${Qt5_VERSION})
|
||||||
|
set(Qt_VERSION_MAJOR ${Qt5_VERSION_MAJOR})
|
||||||
|
set(Qt_VERSION_MINOR ${Qt5_VERSION_MINOR})
|
||||||
|
set(Qt_VERSION_PATCH ${Qt5_VERSION_PATCH})
|
||||||
|
elseif(NOT "${Qt6_DIR}" STREQUAL "")
|
||||||
|
|
||||||
|
string(REPLACE "/lib/cmake/Qt6" "" Qt6_PREFIX_DIR "${Qt6_DIR}")
|
||||||
|
set(CMAKE_PREFIX_PATH ${CMAKE_PREFIX_PATH} ${Qt6_PREFIX_DIR})
|
||||||
|
|
||||||
|
find_package(Qt6 REQUIRED COMPONENTS Core Gui OpenGL Quick QuickWidgets Svg Widgets)
|
||||||
|
find_package(Qt6 OPTIONAL_COMPONENTS QuickWidgets WebEngineCore WebEngineQuick)
|
||||||
|
set(Qt Qt${Qt6_VERSION_MAJOR})
|
||||||
|
set(Qt_VERSION ${Qt6_VERSION})
|
||||||
|
set(Qt_VERSION_MAJOR ${Qt6_VERSION_MAJOR})
|
||||||
|
set(Qt_VERSION_MINOR ${Qt6_VERSION_MINOR})
|
||||||
|
set(Qt_VERSION_PATCH ${Qt6_VERSION_PATCH})
|
||||||
|
endif()
|
||||||
|
|
||||||
|
add_subdirectory(../iotdashboard ${CMAKE_CURRENT_BINARY_DIR}/../iotdashboard)
|
|
@ -449,3 +449,8 @@ set_target_properties(${TARGET_NAME}
|
||||||
set_target_properties(${TARGET_NAME}
|
set_target_properties(${TARGET_NAME}
|
||||||
PROPERTIES
|
PROPERTIES
|
||||||
AUTOGEN_BUILD_DIR ${CMAKE_CURRENT_BINARY_DIR}/qskinny_autogen)
|
AUTOGEN_BUILD_DIR ${CMAKE_CURRENT_BINARY_DIR}/qskinny_autogen)
|
||||||
|
|
||||||
|
list(TRANSFORM TARGET_HEADERS PREPEND "${CMAKE_CURRENT_LIST_DIR}/")
|
||||||
|
set_target_properties(${TARGET_NAME}
|
||||||
|
PROPERTIES
|
||||||
|
PUBLIC_HEADER "${TARGET_HEADERS}")
|
|
@ -48,7 +48,7 @@ endif()
|
||||||
|
|
||||||
target_compile_definitions(${TARGET_NAME}
|
target_compile_definitions(${TARGET_NAME}
|
||||||
PRIVATE
|
PRIVATE
|
||||||
PLUGIN_PATH=${CMAKE_INSTALL_PREFIX}/skins) # TODO this'll work only locally since CMAKE_INSTALL_PREFIX is an absolute path
|
PLUGIN_PATH=${CMAKE_INSTALL_PREFIX}/skins)
|
||||||
|
|
||||||
target_include_directories(${TARGET_NAME}
|
target_include_directories(${TARGET_NAME}
|
||||||
PUBLIC
|
PUBLIC
|
||||||
|
@ -58,13 +58,10 @@ if(ENABLE_ENSURE_SKINS)
|
||||||
target_include_directories(${TARGET_NAME} PRIVATE ${CMAKE_SOURCE_DIR}/skins)
|
target_include_directories(${TARGET_NAME} PRIVATE ${CMAKE_SOURCE_DIR}/skins)
|
||||||
target_compile_definitions(${TARGET_NAME} PRIVATE ENSURE_SKINS)
|
target_compile_definitions(${TARGET_NAME} PRIVATE ENSURE_SKINS)
|
||||||
|
|
||||||
# TODO
|
|
||||||
# use_install_rpath: QMAKE_RPATHDIR *= $${QSK_INSTALL_PLUGINS}/skins
|
|
||||||
# use_local_rpath: QMAKE_RPATHDIR *= $${QSK_PLUGIN_DIR}/skins
|
|
||||||
target_link_libraries(${TARGET_NAME}
|
target_link_libraries(${TARGET_NAME}
|
||||||
PRIVATE
|
PRIVATE
|
||||||
squiekskin
|
squiekskin
|
||||||
material3skin)
|
material3skin)
|
||||||
endif()
|
endif()
|
||||||
|
|
||||||
install(TARGETS ${TARGET_NAME} DESTINATION lib) # TODO unify lib install directory
|
install(TARGETS ${TARGET_NAME} DESTINATION ${QSK_INSTALL_LIBS})
|
Loading…
Reference in New Issue