From 538324357de474756e8bb92600fc8215b70ee3d4 Mon Sep 17 00:00:00 2001 From: Olivier LDff Date: Wed, 27 Mar 2024 15:36:32 +0100 Subject: [PATCH] =?UTF-8?q?=F0=9F=90=9B=20Fix=20enable=20icons?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .github/workflows/main.yml | 11 +++++++++++ cmake/QaterialGenerateIcons.cmake | 11 +++++++++-- 2 files changed, 20 insertions(+), 2 deletions(-) diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index d9937297..6f61aa38 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -17,6 +17,16 @@ jobs: matrix: os: [ubuntu-latest, macOS-latest, windows-latest] version: ['5.15.2'] + include: + - os: ubuntu-latest + enable_icons: 'ON' + - os: ubuntu-latest + enable_icons: 'OFF' + - os: macOS-latest + enable_icons: 'ON' + - os: windows-latest + enable_icons: 'ON' + steps: - uses: actions/checkout@v2 @@ -41,6 +51,7 @@ jobs: cmake -E make_directory build cmake \ -DQATERIAL_ENABLE_TESTS=ON \ + -DQATERIAL_ENABLE_ICONS=${{ matrix.enable_icons }} \ -DCMAKE_BUILD_TYPE="Release" \ -DCPM_SOURCE_CACHE=.cpm \ -B build \ diff --git a/cmake/QaterialGenerateIcons.cmake b/cmake/QaterialGenerateIcons.cmake index d28d45d0..d7164fa1 100644 --- a/cmake/QaterialGenerateIcons.cmake +++ b/cmake/QaterialGenerateIcons.cmake @@ -200,8 +200,8 @@ function(qaterial_generate_icons_class OUTPUT_FILE_HPP OUTPUT_FILE_CPP) else() # Generate fake Qaterial.Impl.Icons.Icons.qml - message(STATUS "Generate Fake ${OUTPUT_FILE}") - file(WRITE ${OUTPUT_FILE} + message(STATUS "Generate Fake ${OUTPUT_FILE_HPP}") + file(WRITE ${OUTPUT_FILE_HPP} "// Dummy file generated with CMake to mock the absence of Mdi icons.\n" "// Everything written here will be lost.\n\n" "#ifndef __QATERIAL_ICONS_HPP__\n" @@ -221,6 +221,13 @@ function(qaterial_generate_icons_class OUTPUT_FILE_HPP OUTPUT_FILE_CPP) "#endif" ) + # Generate fake Qaterial.Impl.Icons.Icons.cpp + message(STATUS "Generate Fake ${OUTPUT_FILE_CPP}") + file(WRITE ${OUTPUT_FILE_CPP} + "// Dummy file generated with CMake to mock the absence of Mdi icons.\n" + "// Everything written here will be lost.\n\n" + ) + endif() endfunction()