diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index dfdb9fc..963dc21 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -259,6 +259,15 @@ jobs: cmake -B ${{ steps.strings.outputs.build-output-dir }}-nlohmann -DCMAKE_PREFIX_PATH=${{ steps.strings.outputs.prefix-dir }} -DCMAKE_CXX_COMPILER=${{ matrix.cpp_compiler }} -DCMAKE_C_COMPILER=${{ matrix.c_compiler }} -DCMAKE_BUILD_TYPE=${{ matrix.build_type }} -S json -DCMAKE_INSTALL_PREFIX=${{ steps.strings.outputs.prefix-dir }} -DJSON_BuildTests=OFF cmake --build ${{ steps.strings.outputs.build-output-dir }}-nlohmann --config ${{ matrix.build_type }} --target install + - name: Build Breeze Icons + if: (runner.os == 'Windows') && (steps.cache-prefix-restore.outputs.cache-hit != 'true') + continue-on-error: true + run: | + git clone https://invent.kde.org/frameworks/breeze-icons.git + cmake -B ${{ steps.strings.outputs.build-output-dir }}-breeze-icons -DCMAKE_PREFIX_PATH=${{ steps.strings.outputs.prefix-dir }} -DCMAKE_CXX_COMPILER=${{ matrix.cpp_compiler }} -DCMAKE_C_COMPILER=${{ matrix.c_compiler }} -DCMAKE_BUILD_TYPE=${{ matrix.build_type }} -S breeze-icons -DCMAKE_INSTALL_PREFIX=${{ steps.strings.outputs.prefix-dir }} -DICONS_LIBRARY=ON -DSKIP_INSTALL_ICONS=ON + cmake --build ${{ steps.strings.outputs.build-output-dir }}-breeze-icons --config ${{ matrix.build_type }} --target install + cmake --build ${{ steps.strings.outputs.build-output-dir }}-breeze-icons --config ${{ matrix.build_type }} --target install + - name: Build stb if: steps.cache-prefix-restore.outputs.cache-hit != 'true' run: | diff --git a/CMakeLists.txt b/CMakeLists.txt index 64040bd..7ce633f 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -42,6 +42,11 @@ if (NOT TARGET glm::glm) add_library(glm::glm ALIAS glm) endif () +# TODO: we should really do this on all platforms anyway +if (WIN32) + find_package(KF6BreezeIcons REQUIRED) +endif () + add_subdirectory(extern) add_subdirectory(renderer) add_subdirectory(karuku) diff --git a/common/CMakeLists.txt b/common/CMakeLists.txt index 96758d8..1ba271d 100644 --- a/common/CMakeLists.txt +++ b/common/CMakeLists.txt @@ -47,6 +47,12 @@ ecm_generate_export_header(novus-common VERSION 1.0.0 ) +if (WIN32) + target_link_libraries(novus-common PRIVATE + KF6::BreezeIcons + ) +endif () + target_include_directories(novus-common PUBLIC "$") add_library(Novus::Common ALIAS novus-common) diff --git a/common/src/aboutdata.cpp b/common/src/aboutdata.cpp index 8cf08c0..aac6faf 100644 --- a/common/src/aboutdata.cpp +++ b/common/src/aboutdata.cpp @@ -7,8 +7,19 @@ #include "novus-version.h" +#ifdef Q_OS_WIN +#include +#include +#endif + void customizeAboutData(const QString &componentName, const QString &desktopFilename, const QString &applicationTitle, const QString &applicationDescription) { + // TODO: we shouldn't do this here +#ifdef Q_OS_WIN + BreezeIcons::initIcons(); + QIcon::setThemeName(QStringLiteral("Breeze")); +#endif + KAboutData about(componentName, applicationTitle, QStringLiteral(NOVUS_VERSION_STRING), diff --git a/scripts/windows-setup.ps1 b/scripts/windows-setup.ps1 index f5678fb..aea0f7a 100644 --- a/scripts/windows-setup.ps1 +++ b/scripts/windows-setup.ps1 @@ -41,158 +41,10 @@ if (!(Test-Path $LocalDir)) { New-Item -ItemType Directory -Path $LocalDir } -# Setup Windows dependencies -Invoke-WebRequest https://xiv.zone/distrib/dependencies/gettext.zip -OutFile "$LocalDir/gettext.zip" -Expand-Archive -Path "$LocalDir/gettext.zip" -DestinationPath $PrefixDir -Force - -Invoke-WebRequest https://xiv.zone/distrib/dependencies/iconv.zip -OutFile "$LocalDir/iconv.zip" -Expand-Archive -Path "$LocalDir/iconv.zip" -DestinationPath $PrefixDir -Force - -Invoke-WebRequest https://cfhcable.dl.sourceforge.net/project/gnuwin32/gperf/3.0.1/gperf-3.0.1-bin.zip -OutFile "$LocalDir/gperf.zip" -Expand-Archive -Path "$LocalDir/gperf.zip" -DestinationPath $PrefixDir -Force - -Invoke-WebRequest https://xiv.zone/distrib/dependencies/icoutils.zip -OutFile "$LocalDir/icoutils.zip" -Expand-Archive -Path "$LocalDir/icoutils.zip" -DestinationPath $PrefixDir -Force - -# Build zlib -Clone "zlib" "https://github.com/madler/zlib.git" -Configure "zlib" "-DBUILD_TESTING=OFF" -cmake --build "$BuildDir-zlib" --config Debug --target install -CheckCompileResult "zlib" - -# Build Extra CMake Modules -Clone "extra-cmake-modules" "https://invent.kde.org/frameworks/extra-cmake-modules.git" -Configure "extra-cmake-modules" "-DBUILD_TESTING=OFF" -cmake --build "$BuildDir-extra-cmake-modules" --config Debug --target install --parallel $NumCores -cmake --install "$BuildDir-extra-cmake-modules" --config Debug -CheckCompileResult "extra-cmake-modules" - -# Build KI18n -Clone "ki18n" "https://invent.kde.org/frameworks/ki18n.git" -# Workaround for Windows -Configure "ki18n" "-DBUILD_TESTING=OFF" - -(Get-Content -ReadCount 0 "$BuildDir-ki18n/cmake/build-pofiles.cmake") -replace 'FATAL_ERROR', 'WARNING' | Set-Content "$BuildDir-ki18n/cmake/build-pofiles.cmake" -cmake --build "$BuildDir-ki18n" --config Debug --target install --parallel $NumCores -CheckCompileResult "ki18n" - -# Build KCoreAddons -Clone "kcoreaddons" "https://invent.kde.org/frameworks/kcoreaddons.git" -Configure "kcoreaddons" "-DBUILD_TESTING=OFF" -cmake --build "$BuildDir-kcoreaddons" --config Debug --target install --parallel $NumCores -CheckCompileResult "kcoreaddons" - -# Build KConfig -Clone "kconfig" "https://invent.kde.org/frameworks/kconfig.git" -Configure "kconfig" "-DBUILD_TESTING=OFF" -cmake --build "$BuildDir-kconfig" --config Debug --target install --parallel $NumCores -CheckCompileResult "kconfig" - -# Build KArchive -Clone "karchive" "https://invent.kde.org/frameworks/karchive.git" -Configure "karchive" "-DBUILD_TESTING=OFF -DWITH_BZIP2=OFF -DWITH_LIBLZMA=OFF -DWITH_LIBZSTD=OFF" -cmake --build "$BuildDir-karchive" --config Debug --target install --parallel $NumCores -CheckCompileResult "karchive" - -# Build KItemViews -Clone "kitemviews" "https://invent.kde.org/frameworks/kitemviews.git" -Configure "kitemviews" "-DBUILD_TESTING=OFF" -cmake --build "$BuildDir-kitemviews" --config Debug --target install --parallel $NumCores -CheckCompileResult "kitemviews" - -# Build KCodecs -Clone "kcodecs" "https://invent.kde.org/frameworks/kcodecs.git" -Configure "kcodecs" "-DBUILD_TESTING=OFF" -cmake --build "$BuildDir-kcodecs" --config Debug --target install --parallel $NumCores -CheckCompileResult "kcodecs" - -# Build KGuiAddons -Clone "kguiaddons" "https://invent.kde.org/frameworks/kguiaddons.git" -Configure "kguiaddons" "-DBUILD_TESTING=OFF" -cmake --build "$BuildDir-kguiaddons" --config Debug --target install --parallel $NumCores -CheckCompileResult "kguiaddons" - -# Build KWidgetsAddons -Clone "kwidgetsaddons" "https://invent.kde.org/frameworks/kwidgetsaddons.git" -Configure "kwidgetsaddons" "-DBUILD_TESTING=OFF" -cmake --build "$BuildDir-kwidgetsaddons" --config Debug --target install --parallel $NumCores -CheckCompileResult "kwidgetsaddons" - -# Build KColorScheme -Clone "kcolorscheme" "https://invent.kde.org/frameworks/kcolorscheme.git" -Configure "kcolorscheme" "-DBUILD_TESTING=OFF" -# Workaround for Windows -(Get-Content -ReadCount 0 "$PrefixDir/lib/cmake/KF6I18n/build-pofiles.cmake") -replace 'FATAL_ERROR', 'WARNING' | Set-Content "$PrefixDir/lib/cmake/KF6I18n/build-pofiles.cmake" -cmake --build "$BuildDir-kcolorscheme" --config Debug --target install --parallel $NumCores -CheckCompileResult "kcolorscheme" - -# Build KConfigWidgets -Clone "kconfigwidgets" "https://invent.kde.org/frameworks/kconfigwidgets.git" -Configure "kconfigwidgets" "-DBUILD_TESTING=OFF" -cmake --build "$BuildDir-kconfigwidgets" --config Debug --target install --parallel $NumCores -CheckCompileResult "kconfigwidgets" - -# Build KIconThemes -Clone "kiconthemes" "https://invent.kde.org/frameworks/kiconthemes.git" -Configure "kiconthemes" "-DBUILD_TESTING=OFF" -cmake --build "$BuildDir-kiconthemes" --config Debug --target install --parallel $NumCores -CheckCompileResult "kiconthemes" - -# Build Sonnet -Clone "sonnet" "https://invent.kde.org/frameworks/sonnet.git" -Configure "sonnet" "-DBUILD_TESTING=OFF" -cmake --build "$BuildDir-sonnet" --config Debug --target install --parallel $NumCores -CheckCompileResult "sonnet" - -# Build KCompletion -Clone "kcompletion" "https://invent.kde.org/frameworks/kcompletion.git" -Configure "kcompletion" "-DBUILD_TESTING=OFF" -cmake --build "$BuildDir-kcompletion" --config Debug --target install --parallel $NumCores -CheckCompileResult "kcompletion" - -# Build KTextWidgets -Clone "ktextwidgets" "https://invent.kde.org/frameworks/ktextwidgets.git" -Configure "ktextwidgets" "-DBUILD_TESTING=OFF -DWITH_TEXT_TO_SPEECH=OFF" -cmake --build "$BuildDir-ktextwidgets" --config Debug --target install --parallel $NumCores -CheckCompileResult "ktextwidgets" - -# Build KXmlGui -Clone "kxmlgui" "https://invent.kde.org/frameworks/kxmlgui.git" -Configure "kxmlgui" "-DBUILD_TESTING=OFF -DFORCE_DISABLE_KGLOBALACCEL=ON" -cmake --build "$BuildDir-kxmlgui" --config Debug --target install --parallel $NumCores -CheckCompileResult "kxmlgui" - -# Build glm -Clone "glm" "https://github.com/g-truc/glm.git" -Configure "glm" "-DGLM_BUILD_TESTS=OFF" -cmake --build "$BuildDir-glm" --config Debug --target install --parallel $NumCores -CheckCompileResult "glm" - -# Build Corrosion -Clone "corrosion" "https://github.com/corrosion-rs/corrosion.git" -Configure "corrosion" "-DCORROSION_BUILD_TESTS=OFF" -cmake --build "$BuildDir-corrosion" --config Debug --target install --parallel $NumCores -CheckCompileResult "corrosion" - -# Build nlohmann -Clone "json" "https://github.com/nlohmann/json.git" -Configure "json" "-DJSON_BuildTests=OFF" -cmake --build "$BuildDir-json" --config Debug --target install --parallel $NumCores -CheckCompileResult "json" - -# Build stb -Clone "stb" "https://github.com/nothings/stb.git" -mv $LocalDir/stb/* $PrefixDir/include -CheckCompileResult "stb" - -# Build SPIRV-Cross -Clone "SPIRV-Cross" "https://github.com/KhronosGroup/SPIRV-Cross.git" -Configure "SPIRV-Cross" -cmake --build "$BuildDir-SPIRV-Cross" --config Debug --target install --parallel $NumCores -CheckCompileResult "SPIRV-Cross" - -# Build SPIRV-Headers -Clone "SPIRV-Headers" "https://github.com/KhronosGroup/SPIRV-Headers.git" -Configure "SPIRV-Headers" -cmake --build "$BuildDir-SPIRV-Headers" --config Debug --target install --parallel $NumCores -CheckCompileResult "SPIRV-Headers" +# Build breeze icons +Clone "breeze-icons" "https://invent.kde.org/frameworks/breeze-icons.git" +Configure "breeze-icons" "-DICONS_LIBRARY=ON -DSKIP_INSTALL_ICONS=ON" +# Building it twice is intentional, the first time will always fail +cmake --build "$BuildDir-breeze-icons" --config Debug --target install --parallel $NumCores +cmake --build "$BuildDir-breeze-icons" --config Debug --target install --parallel $NumCores +CheckCompileResult "breeze-icons"