Skip to content

Commit

Permalink
🐛 Fix QATERIAL_ENABLE_ICONS=OFF in CMake config (#151)
Browse files Browse the repository at this point in the history
  • Loading branch information
OlivierLDff authored Mar 27, 2024
1 parent b2c8867 commit 34f7ad2
Show file tree
Hide file tree
Showing 2 changed files with 25 additions and 3 deletions.
11 changes: 11 additions & 0 deletions .github/workflows/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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 \
Expand Down
17 changes: 14 additions & 3 deletions cmake/QaterialGenerateIcons.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -199,9 +199,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"
Expand All @@ -221,6 +220,18 @@ function(qaterial_generate_icons_class OUTPUT_FILE_HPP OUTPUT_FILE_CPP)
"#endif"
)

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"
"#include <Qaterial/Display/Icons.hpp>\n"
"#include \"moc_Icons.cpp\"\n"
"void __Qaterial_registerIconsSingleton()\n"
"{\n"
" qaterial::Icons::registerSingleton();\n"
"}\n"
)

endif()

endfunction()

0 comments on commit 34f7ad2

Please sign in to comment.