Compare commits
2 Commits
259e4d1455
...
432bf9919c
Author | SHA1 | Date |
---|---|---|
Shaun Reed | 432bf9919c | |
Shaun Reed | 52521dc331 |
|
@ -6,21 +6,69 @@ on:
|
||||||
workflow_dispatch:
|
workflow_dispatch:
|
||||||
|
|
||||||
jobs:
|
jobs:
|
||||||
Ubuntu:
|
Build-Qtk:
|
||||||
runs-on: ubuntu-latest
|
strategy:
|
||||||
|
fail-fast: false
|
||||||
|
matrix:
|
||||||
|
os: [ubuntu-latest, windows-latest, macos-latest]
|
||||||
|
include:
|
||||||
|
- os: ubuntu-latest
|
||||||
|
cmake: -DCMAKE_PREFIX_PATH="/home/runner/work/qtk/Qt/6.3.1/gcc_64/;../assimp"
|
||||||
|
- os: windows-latest
|
||||||
|
cmake: -DCMAKE_PREFIX_PATH="D:/a/qtk/qtk/Qt/6.3.1/mingw81_64/;../assimp" -DASSIMP_NEW_INTERFACE=on
|
||||||
|
- os: macos-latest
|
||||||
|
cmake: -DCMAKE_PREFIX_PATH="/home/runner/work/qtk/Qt/6.3.1/gcc_64/;../assimp" -DASSIMP_NEW_INTERFACE=on
|
||||||
|
|
||||||
|
runs-on: ${{ matrix.os }}
|
||||||
steps:
|
steps:
|
||||||
- uses: actions/checkout@v3
|
- uses: actions/checkout@v3
|
||||||
|
|
||||||
|
- name: Clone Assimp
|
||||||
|
uses: actions/checkout@v3
|
||||||
|
with:
|
||||||
|
repository: 'assimp/assimp'
|
||||||
|
path: 'assimp'
|
||||||
|
|
||||||
|
- name: Build Assimp
|
||||||
|
shell: bash
|
||||||
|
run: |
|
||||||
|
pwd
|
||||||
|
ls
|
||||||
|
cmake -S assimp/ -B assimp/build/ -DCMAKE_INSTALL_PREFIX=../assimp && cmake --build assimp/build
|
||||||
- name: Install Qt
|
- name: Install Qt
|
||||||
uses: jurplel/install-qt-action@v2
|
uses: jurplel/install-qt-action@v2
|
||||||
with:
|
with:
|
||||||
version: '6.2.3'
|
version: '6.3.1'
|
||||||
|
|
||||||
- name: Install Assimp
|
# - name: Install Assimp Linux
|
||||||
|
# if: matrix.os == 'ubuntu-latest'
|
||||||
|
# shell: bash
|
||||||
|
# run: |
|
||||||
|
# sudo apt install libassimp-dev -y
|
||||||
|
#
|
||||||
|
# - name: Install Assimp MacOS
|
||||||
|
# if: matrix.os == 'macos-latest'
|
||||||
|
# shell: bash
|
||||||
|
# run: |
|
||||||
|
# brew install assimp
|
||||||
|
#
|
||||||
|
# - name: Install Assimp Windows
|
||||||
|
# if: matrix.os == 'windows-latest'
|
||||||
|
# shell: bash
|
||||||
|
# run: |
|
||||||
|
# git clone https://github.com/Microsoft/vcpkg.git
|
||||||
|
# cd vcpkg
|
||||||
|
# ./bootstrap-vcpkg.sh
|
||||||
|
# ./vcpkg integrate install
|
||||||
|
# vcpkg install assimp
|
||||||
|
|
||||||
|
- name: Install Assimp MacOS
|
||||||
|
if: matrix.os == 'macos-latest'
|
||||||
|
shell: bash
|
||||||
run: |
|
run: |
|
||||||
sudo apt install libassimp-dev -y
|
brew install assimp
|
||||||
|
|
||||||
- name: Build Qtk
|
- name: Build Qtk
|
||||||
|
shell: bash
|
||||||
run: |
|
run: |
|
||||||
mkdir build && cd build
|
cmake -S . -B build/ ${{ matrix.cmake }} && cmake --build build/
|
||||||
cmake .. -DCMAKE_PREFIX_PATH=/home/runner/work/qtk/Qt/6.2.3/gcc_64/ && cmake --build .
|
|
||||||
|
|
|
@ -27,30 +27,25 @@ if (NOT Qt6_FOUND)
|
||||||
message(FATAL_ERROR "Specify path to Qt6 with `cmake -DCMAKE_PREFIX_PATH=/path/to/Qt/6.x.x/gcc_64 -S /path/to/qtk -B /path/to/qtk/build && cmake --build /path/to/qtk/build -j $(nprocs)`")
|
message(FATAL_ERROR "Specify path to Qt6 with `cmake -DCMAKE_PREFIX_PATH=/path/to/Qt/6.x.x/gcc_64 -S /path/to/qtk -B /path/to/qtk/build && cmake --build /path/to/qtk/build -j $(nprocs)`")
|
||||||
endif()
|
endif()
|
||||||
|
|
||||||
# Add our Qt resources.qrc file to our application
|
|
||||||
set(SOURCES app/main.cpp)
|
|
||||||
qt6_add_big_resources(SOURCES resources.qrc)
|
|
||||||
|
|
||||||
add_executable(
|
|
||||||
qtk # Executable name
|
|
||||||
${SOURCES} # Executable source code
|
|
||||||
)
|
|
||||||
|
|
||||||
################################################################################
|
################################################################################
|
||||||
# External Libraries
|
# External Libraries
|
||||||
################################################################################
|
################################################################################
|
||||||
|
|
||||||
# https://github.com/assimp/assimp/commit/6ac8279977c3a54118551e549d77329497116f66
|
# https://github.com/assimp/assimp/commit/6ac8279977c3a54118551e549d77329497116f66
|
||||||
find_package(assimp REQUIRED)
|
find_package(assimp REQUIRED)
|
||||||
|
option(ASSIMP_NEW_INTERFACE "Use assimp::assimp as target instead of assimp" OFF)
|
||||||
|
|
||||||
################################################################################
|
|
||||||
# Custom Libraries
|
|
||||||
################################################################################
|
|
||||||
|
|
||||||
# Mainwidget
|
|
||||||
include(GenerateExportHeader)
|
include(GenerateExportHeader)
|
||||||
add_library(main-widget STATIC
|
|
||||||
|
################################################################################
|
||||||
|
# Final Application
|
||||||
|
################################################################################
|
||||||
|
|
||||||
|
# Add our Qt resources.qrc file to our application
|
||||||
|
set(SOURCES app/main.cpp)
|
||||||
|
qt6_add_big_resources(SOURCES resources.qrc)
|
||||||
|
qt_add_executable(qtk ${SOURCES})
|
||||||
|
|
||||||
|
set(SOURCES
|
||||||
src/mainwidget.cpp src/mainwidget.h
|
src/mainwidget.cpp src/mainwidget.h
|
||||||
src/mainwindow.cpp src/mainwindow.h src/mainwindow.ui
|
src/mainwindow.cpp src/mainwindow.h src/mainwindow.ui
|
||||||
src/input.cpp src/input.h
|
src/input.cpp src/input.h
|
||||||
|
@ -65,29 +60,28 @@ add_library(main-widget STATIC
|
||||||
src/scene.cpp src/scene.h
|
src/scene.cpp src/scene.h
|
||||||
src/resourcemanager.cpp src/resourcemanager.h
|
src/resourcemanager.cpp src/resourcemanager.h
|
||||||
)
|
)
|
||||||
|
qt_add_library(main-widget STATIC ${SOURCES})
|
||||||
|
|
||||||
target_include_directories(main-widget PUBLIC src/)
|
target_include_directories(main-widget PUBLIC src/)
|
||||||
#if(TARGET assimp)
|
if(ASSIMP_NEW_INTERFACE)
|
||||||
target_link_libraries(main-widget PRIVATE assimp)
|
target_link_libraries(main-widget PRIVATE assimp::assimp)
|
||||||
#else()
|
else()
|
||||||
# target_link_libraries(main-widget PRIVATE assimp::assimp)
|
target_link_libraries(main-widget PRIVATE assimp)
|
||||||
#endif()
|
endif()
|
||||||
target_link_libraries(main-widget PUBLIC Qt6::OpenGLWidgets)
|
target_link_libraries(main-widget PUBLIC Qt6::OpenGLWidgets)
|
||||||
if(WIN32)
|
if(WIN32)
|
||||||
find_package(OpenGL REQUIRED)
|
find_package(OpenGL REQUIRED)
|
||||||
target_link_libraries(main-widget PUBLIC OpenGL::GL)
|
target_link_libraries(main-widget PUBLIC OpenGL::GL)
|
||||||
endif()
|
endif()
|
||||||
|
|
||||||
################################################################################
|
|
||||||
# Final Application
|
|
||||||
################################################################################
|
|
||||||
|
|
||||||
# Link qtk executable to main main-widget library
|
|
||||||
target_link_libraries(qtk PUBLIC main-widget)
|
target_link_libraries(qtk PUBLIC main-widget)
|
||||||
|
|
||||||
|
# Link qtk executable to main main-widget library
|
||||||
set_target_properties(qtk PROPERTIES
|
set_target_properties(qtk PROPERTIES
|
||||||
WIN32_EXECUTABLE TRUE
|
WIN32_EXECUTABLE TRUE
|
||||||
MACOSX_BUNDLE TRUE
|
MACOSX_BUNDLE TRUE
|
||||||
|
MACOSX_BUNDLE_BUNDLE_VERSION ${PROJECT_VERSION}
|
||||||
|
MACOSX_BUNDLE_SHORT_VERSION_STRING ${PROJECT_VERSION_MAJOR}.${PROJECT_VERSION_MINOR}
|
||||||
)
|
)
|
||||||
|
|
||||||
generate_export_header(main-widget)
|
generate_export_header(main-widget)
|
||||||
|
|
Loading…
Reference in New Issue