From 2846abbdbaceee4e84f5e708b6dc1e6002602dd9 Mon Sep 17 00:00:00 2001 From: Shaun Reed Date: Sat, 21 Jan 2023 08:01:13 -0500 Subject: [PATCH] Trying to fix windows --- .github/workflows/all-builds.yml | 29 +++++++++++++++++++++++++++-- CMakeLists.txt | 15 +++++++++++---- src/app/qtkwidget.cpp | 4 ---- src/app/qtkwidget.h | 6 ------ src/app/toolbox.h | 2 +- src/app/treeview.h | 2 +- 6 files changed, 40 insertions(+), 18 deletions(-) diff --git a/.github/workflows/all-builds.yml b/.github/workflows/all-builds.yml index 01ff4ef..6f9e09d 100644 --- a/.github/workflows/all-builds.yml +++ b/.github/workflows/all-builds.yml @@ -35,9 +35,17 @@ jobs: args: install pkgconfiglite --checksum e87b5ea3c9142256af60f2d5b917aa63b571e6a0 --checksum-type sha1 - name: Build Qtk + if: matrix.os == 'windows-latest' shell: bash run: | - cmake -B build/ ${{ matrix.cmake }} -DQTK_UPDATE_SUBMODULES=ON + cmake -B build/ ${{ matrix.cmake }} -DQTK_UPDATE_SUBMODULES=ON -DQTK_DEBUG=OFF + cmake --build build/ + + - name: Build Qtk + if: matrix.os != 'windows-latest' + shell: bash + run: | + cmake -B build/ ${{ matrix.cmake }} -DQTK_UPDATE_SUBMODULES=ON -DQTK_DEBUG=OFF cmake --build build/ -- -j $(nproc) - name: Install Qtk @@ -52,6 +60,14 @@ jobs: path: install/* - name: Package Qtk + if: matrix.os == 'windows-latest' + shell: bash + run: | + cd build/ + cmake --build . --target package + + - name: Package Qtk + if: matrix.os != 'windows-latest' shell: bash run: | cd build/ @@ -104,9 +120,18 @@ jobs: sudo apt install libassimp-dev - name: Build Qtk + if: matrix.os == 'windows-latest' shell: bash run: | - cmake -B build/ ${{ matrix.cmake }} && cmake --build build/ -- -j $(nproc) + cmake -B build/ ${{ matrix.cmake }} -DQTK_DEBUG=OFF + cmake --build build/ + + - name: Build Qtk + if: matrix.os != 'windows-latest' + shell: bash + run: | + cmake -B build/ ${{ matrix.cmake }} -DQTK_DEBUG=OFF + cmake --build build/ -- -j $(nproc) # TODO: Enable with tag only when done testing # Release-Qtk: diff --git a/CMakeLists.txt b/CMakeLists.txt index 5fae330..56aecb1 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -25,7 +25,7 @@ set(CMAKE_EXPORT_COMPILE_COMMANDS ON) #set(CMAKE_MACOSX_BUNDLE ON) set(CMAKE_RUNTIME_OUTPUT_DIRECTORY ${CMAKE_BINARY_DIR}/bin) -if(MSVC) +if(WIN32) set(CMAKE_COMPILE_WARNING_AS_ERROR OFF) add_compile_options(-warnnotaserror) add_compile_options(/wd4131 /wd4127) @@ -58,6 +58,12 @@ option( OFF ) +if(NOT QTK_DEBUG) + set(CMAKE_BUILD_TYPE Release) +else() + set(CMAKE_BUILD_TYPE Debug) +endif() + set(QT_DIR "$ENV{HOME}/Qt/" CACHE PATH "Path to Qt6") # Qt Designer will look in different locations if WIN / Unix. @@ -116,12 +122,13 @@ if(NOT Qt6_FOUND) endif() # Find Assimp -set(ASSIMP_BUILD_TESTS OFF) +set(ASSIMP_BUILD_TESTS OFF CACHE STRING "Do not build assimp tests." FORCE) if(QTK_UPDATE_SUBMODULES) message(STATUS "[Qtk] Updating submodules...") - set(ASSIMP_INSTALL OFF) + set(ASSIMP_INSTALL OFF CACHE STRING "Use assimp as a submodule." FORCE) + set(ASSIMP_WARNINGS_AS_ERRORS OFF CACHE STRING "No warnings as errors." FORCE) submodule_update("${CMAKE_CURRENT_SOURCE_DIR}/extern/assimp/assimp/") - add_subdirectory("${CMAKE_CURRENT_SOURCE_DIR}/extern/assimp/assimp/") + add_subdirectory("${CMAKE_CURRENT_SOURCE_DIR}/extern/assimp/assimp/" EXCLUDE_FROM_ALL) else() find_package(assimp REQUIRED) endif() diff --git a/src/app/qtkwidget.cpp b/src/app/qtkwidget.cpp index 7824558..f3f943d 100644 --- a/src/app/qtkwidget.cpp +++ b/src/app/qtkwidget.cpp @@ -42,9 +42,7 @@ QtkWidget::QtkWidget(QWidget * parent, const QString & name, Scene * scene) : // Set the size of the depth bufer for glEnable(GL_DEPTH_TEST) format.setDepthBufferSize(16); // If QTK_DEBUG is set, enable debug context -#ifdef QTK_DEBUG format.setOption(QSurfaceFormat::DebugContext); -#endif setFormat(format); setFocusPolicy(Qt::ClickFocus); } @@ -73,7 +71,6 @@ void QtkWidget::initializeGL() { connect(this, SIGNAL(frameSwapped()), this, SLOT(update())); // Initialize OpenGL debug context -#ifdef QTK_DEBUG mDebugLogger = new QOpenGLDebugLogger(this); if(mDebugLogger->initialize()) { qDebug() << "GL_DEBUG Debug Logger" << mDebugLogger << "\n"; @@ -82,7 +79,6 @@ void QtkWidget::initializeGL() { SLOT(messageLogged(QOpenGLDebugMessage))); mDebugLogger->startLogging(); } -#endif // QTK_DEBUG printContextInformation(); diff --git a/src/app/qtkwidget.h b/src/app/qtkwidget.h index 56ac290..61b980c 100644 --- a/src/app/qtkwidget.h +++ b/src/app/qtkwidget.h @@ -156,7 +156,6 @@ namespace Qtk { */ void update(); -#ifdef QTK_DEBUG /** * Called when the `messageLogged` signal is caught. * See definition of initializeGL() @@ -164,7 +163,6 @@ namespace Qtk { * @param msg The message logged. */ void messageLogged(const QOpenGLDebugMessage & msg); -#endif private: /************************************************************************* @@ -181,20 +179,16 @@ namespace Qtk { */ static void updateCameraInput(); -#ifdef QTK_DEBUG /** * Prints OpenGL context information at start of debug session. */ void printContextInformation(); -#endif /************************************************************************* * Private Members ************************************************************************/ -#ifdef QTK_DEBUG QOpenGLDebugLogger * mDebugLogger; -#endif Qtk::Scene * mScene; Qtk::DebugConsole * mConsole; bool mConsoleActive = false; diff --git a/src/app/toolbox.h b/src/app/toolbox.h index a3c7e1c..601d4d5 100644 --- a/src/app/toolbox.h +++ b/src/app/toolbox.h @@ -18,7 +18,7 @@ namespace Ui { } namespace Qtk { - class QDESIGNER_WIDGET_EXPORT ToolBox : public QDockWidget { + class ToolBox : public QDockWidget { Q_OBJECT public: diff --git a/src/app/treeview.h b/src/app/treeview.h index d1bdba9..6c24211 100644 --- a/src/app/treeview.h +++ b/src/app/treeview.h @@ -22,7 +22,7 @@ namespace Ui { } namespace Qtk { - class QDESIGNER_WIDGET_EXPORT TreeView : public QDockWidget { + class TreeView : public QDockWidget { Q_OBJECT public: