Skip to content

Commit

Permalink
🪩 main: v1.2.0-alpha.4 (#71)
Browse files Browse the repository at this point in the history
Win executable with icon
  • Loading branch information
Sclafus authored Jun 12, 2023
2 parents 953ae4d + 21ddc01 commit 0daf493
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 2 deletions.
10 changes: 9 additions & 1 deletion CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -80,7 +80,15 @@ set(CMAKE_AUTORCC ON)

# Add the executable
if (WIN32)
add_executable(miraya WIN32 ${SOURCES})
add_custom_command(
OUTPUT ${CMAKE_CURRENT_BINARY_DIR}/icon.o
COMMAND windres icon.rc -o ${CMAKE_CURRENT_BINARY_DIR}/icon.o
WORKING_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR}
DEPENDS icon.rc
)
add_custom_target(icon ALL DEPENDS ${CMAKE_CURRENT_BINARY_DIR}/icon.o)

add_executable(miraya WIN32 ${SOURCES} ${CMAKE_CURRENT_BINARY_DIR}/icon.o)
if (CMAKE_BUILD_TYPE STREQUAL "Release")
set_property(TARGET miraya PROPERTY WIN32_EXECUTABLE true)
endif()
Expand Down
1 change: 1 addition & 0 deletions icon.rc
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
IDI_ICON1 ICON DISCARDABLE "./resources/logo/logo.ico"
2 changes: 1 addition & 1 deletion src/main.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ int main(int argc, char **argv) {
app.setOrganizationName("miraya");
app.setOrganizationDomain("github.com/MirayaProject");
app.setApplicationName("bot");
app.setApplicationVersion("1.2.0-alpha.3");
app.setApplicationVersion("1.2.0-alpha.4");
app.setWindowIcon(QIcon(":/resources/logo/logo.png"));
MainWindow mw;
mw.show();
Expand Down

0 comments on commit 0daf493

Please sign in to comment.