diff --git a/CMakeLists.txt b/CMakeLists.txt index d490b6bb7..16759b88f 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -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) diff --git a/sources.cmake b/sources.cmake index 595e1c12f..d4f28ae4d 100644 --- a/sources.cmake +++ b/sources.cmake @@ -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") diff --git a/src/windows_installer/icon_rc.template b/src/windows_installer/icon_rc.template new file mode 100644 index 000000000..d9cc5fd32 --- /dev/null +++ b/src/windows_installer/icon_rc.template @@ -0,0 +1 @@ +100 ICON "@PROJECT_SOURCE_DIR@/src/windows_installer/icon.ico"