Add icon to exe file as resource.

It's hard to test for me because currently I can compile it only on virtual machine and it takes long time.
But it should work.
This commit is contained in:
Deve 2014-08-21 21:38:59 +02:00
parent 78df1bf371
commit 4584464798
3 changed files with 6 additions and 2 deletions

View File

@ -173,6 +173,9 @@ endif()
# TODO: remove this switch
add_definitions(-DHAVE_OGGVORBIS)
if(WIN32)
configure_file("${STK_SOURCE_DIR}/windows_installer/icon_rc.template" "${PROJECT_BINARY_DIR}/tmp/icon.rc")
endif()
# Provides list of source and header files (STK_SOURCES and STK_HEADERS)
include(sources.cmake)
@ -228,7 +231,7 @@ else()
endif()
# Build the final executable
add_executable(supertuxkart ${STK_SOURCES} ${STK_HEADERS})
add_executable(supertuxkart ${STK_SOURCES} ${STK_RESOURCES} ${STK_HEADERS})
target_link_libraries(supertuxkart ${PTHREAD_LIBRARY})
endif()
@ -369,7 +372,6 @@ install(FILES ${PROJECT_BINARY_DIR}/supertuxkart.desktop DESTINATION share/appli
install(FILES data/supertuxkart_32.png data/supertuxkart_128.png DESTINATION share/pixmaps)
install(FILES data/supertuxkart.appdata DESTINATION share/appdata)
set(PREFIX ${CMAKE_INSTALL_PREFIX})
configure_file(data/supertuxkart_desktop.template supertuxkart.desktop)
add_dependencies(supertuxkart supertuxkart.desktop)

View File

@ -3,3 +3,4 @@
file(GLOB_RECURSE STK_HEADERS RELATIVE ${CMAKE_CURRENT_SOURCE_DIR} "src/*.hpp")
file(GLOB_RECURSE STK_SOURCES RELATIVE ${CMAKE_CURRENT_SOURCE_DIR} "src/*.cpp")
file(GLOB_RECURSE STK_SHADERS RELATIVE ${CMAKE_CURRENT_SOURCE_DIR} "data/shaders/*")
file(GLOB_RECURSE STK_RESOURCES RELATIVE ${CMAKE_CURRENT_SOURCE_DIR} "${PROJECT_BINARY_DIR}/tmp/*.rc")

View File

@ -0,0 +1 @@
100 ICON "@PROJECT_SOURCE_DIR@/src/windows_installer/icon.ico"