Skip to content

Commit 356a320

Browse files
committed
feat: generate lua icon (#12)
Icon (#13) * generate lua icon * imagemagick is already installed in github runners
1 parent 7ad9e80 commit 356a320

File tree

4 files changed

+18
-3
lines changed

4 files changed

+18
-3
lines changed

.github/workflows/reusable-package.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,8 +6,8 @@ jobs:
66
runs-on: windows-latest
77
steps:
88
- uses: actions/checkout@v3
9-
- name: Install Ninja
10-
run: choco install ninja
9+
- name: Install required tools
10+
run: choco install ninja ghostscript
1111
- name: Generate Ninja build
1212
run: cmake -B build -G Ninja -D CMAKE_BUILD_TYPE=RelWithDebInfo -D CMAKE_C_COMPILER=clang
1313
- name: Package

.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,3 +16,4 @@ lua-*/
1616
luarocks-*/
1717
*.gz
1818
*.zip
19+
lua-logo-nolabel.ps

CMakeLists.txt

Lines changed: 15 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -32,6 +32,20 @@ if(WIN32)
3232
DESTINATION ${CMAKE_CURRENT_LIST_DIR}
3333
)
3434
endif()
35+
36+
set(LUA_LOGO lua-logo-nolabel.ps)
37+
if(NOT EXISTS ${CMAKE_CURRENT_LIST_DIR}/${LUA_LOGO})
38+
file(DOWNLOAD https://www.lua.org/images/${LUA_LOGO}
39+
${CMAKE_CURRENT_LIST_DIR}/${LUA_LOGO}
40+
)
41+
endif()
42+
43+
add_custom_command(OUTPUT lua.ico
44+
COMMAND magick ${CMAKE_CURRENT_LIST_DIR}/${LUA_LOGO} -resize 256x256 lua.ico
45+
MAIN_DEPENDENCY ${CMAKE_CURRENT_LIST_DIR}/${LUA_LOGO}
46+
COMMENT Generating Lua icon
47+
)
48+
add_custom_target(luaicon ALL DEPENDS lua.ico)
3549
endif()
3650

3751
set(LUA_SRC lua-${CMAKE_PROJECT_VERSION}/src)
@@ -117,7 +131,7 @@ install(TARGETS lualib FILE_SET include)
117131
if(WIN32)
118132
set(CPACK_GENERATOR ZIP WIX)
119133
set(CPACK_WIX_UPGRADE_GUID "3e5a792d-9d31-41d5-a93f-629ab7c7683d")
120-
set(CPACK_WIX_PRODUCT_ICON ${CMAKE_CURRENT_LIST_DIR}/lua.ico)
134+
set(CPACK_WIX_PRODUCT_ICON lua.ico)
121135
list(APPEND CPACK_WIX_EXTENSIONS WixUtilExtension)
122136
list(APPEND CPACK_WIX_PATCH_FILE ${CMAKE_CURRENT_LIST_DIR}/WixPatch.xml)
123137
else()

lua.ico

-200 KB
Binary file not shown.

0 commit comments

Comments
 (0)