Set executable icon in windows CMake build. (#2443)

This commit is contained in:
karliss 2020-10-10 13:52:56 +03:00 committed by GitHub
parent de74675861
commit d971f30d25
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 7 additions and 1 deletions

View File

@ -169,6 +169,11 @@ if (TARGET Graphviz::GVC)
list(APPEND HEADER_FILES ${CUTTER_PRO_GRAPHVIZ_HEADERS}) list(APPEND HEADER_FILES ${CUTTER_PRO_GRAPHVIZ_HEADERS})
endif() endif()
if (WIN32)
set(PLATFORM_RESOURCES "img/cutter.rc")
else()
set(PLATFORM_RESOURCES "")
endif()
if(CMAKE_CXX_COMPILER_ID STREQUAL "GNU" if(CMAKE_CXX_COMPILER_ID STREQUAL "GNU"
OR CMAKE_CXX_COMPILER_ID STREQUAL "Clang") OR CMAKE_CXX_COMPILER_ID STREQUAL "Clang")
@ -177,7 +182,7 @@ if(CMAKE_CXX_COMPILER_ID STREQUAL "GNU"
endif() endif()
add_executable(Cutter MACOSX_BUNDLE ${UI_FILES} ${QRC_FILES} ${SOURCE_FILES} ${HEADER_FILES} ${BINDINGS_SOURCE}) add_executable(Cutter MACOSX_BUNDLE ${UI_FILES} ${QRC_FILES} ${PLATFORM_RESOURCES} ${SOURCE_FILES} ${HEADER_FILES} ${BINDINGS_SOURCE})
set_target_properties(Cutter PROPERTIES set_target_properties(Cutter PROPERTIES
ENABLE_EXPORTS ON ENABLE_EXPORTS ON
CXX_VISIBILITY_PRESET hidden CXX_VISIBILITY_PRESET hidden

1
src/img/cutter.rc Normal file
View File

@ -0,0 +1 @@
IDR_MAINFRAME ICON "cutter.ico"