Skip to content

Commit 0daf493

Browse files
authored
🪩 main: v1.2.0-alpha.4 (#71)
Win executable with icon
2 parents 953ae4d + 21ddc01 commit 0daf493

File tree

3 files changed

+11
-2
lines changed

3 files changed

+11
-2
lines changed

‎CMakeLists.txt‎

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -80,7 +80,15 @@ set(CMAKE_AUTORCC ON)
8080

8181
# Add the executable
8282
if (WIN32)
83-
add_executable(miraya WIN32 ${SOURCES})
83+
add_custom_command(
84+
OUTPUT ${CMAKE_CURRENT_BINARY_DIR}/icon.o
85+
COMMAND windres icon.rc -o ${CMAKE_CURRENT_BINARY_DIR}/icon.o
86+
WORKING_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR}
87+
DEPENDS icon.rc
88+
)
89+
add_custom_target(icon ALL DEPENDS ${CMAKE_CURRENT_BINARY_DIR}/icon.o)
90+
91+
add_executable(miraya WIN32 ${SOURCES} ${CMAKE_CURRENT_BINARY_DIR}/icon.o)
8492
if (CMAKE_BUILD_TYPE STREQUAL "Release")
8593
set_property(TARGET miraya PROPERTY WIN32_EXECUTABLE true)
8694
endif()

‎icon.rc‎

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
IDI_ICON1 ICON DISCARDABLE "./resources/logo/logo.ico"

‎src/main.cpp‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ int main(int argc, char **argv) {
88
app.setOrganizationName("miraya");
99
app.setOrganizationDomain("github.com/MirayaProject");
1010
app.setApplicationName("bot");
11-
app.setApplicationVersion("1.2.0-alpha.3");
11+
app.setApplicationVersion("1.2.0-alpha.4");
1212
app.setWindowIcon(QIcon(":/resources/logo/logo.png"));
1313
MainWindow mw;
1414
mw.show();

0 commit comments

Comments
 (0)