Add an icon and executable information to the colobot.exe when build in MXE
parent
70af33e45d
commit
ee90f02bc4
|
@ -321,11 +321,7 @@ add_subdirectory(src)
|
|||
add_subdirectory(po)
|
||||
|
||||
if(DESKTOP)
|
||||
if(PLATFORM_WINDOWS)
|
||||
message("Desktop files ignored on Windows")
|
||||
else()
|
||||
add_subdirectory(desktop)
|
||||
endif()
|
||||
add_subdirectory(desktop)
|
||||
endif()
|
||||
|
||||
|
||||
|
|
|
@ -1,75 +1,81 @@
|
|||
cmake_minimum_required(VERSION 2.8)
|
||||
|
||||
# Install Desktop Entry file
|
||||
set(COLOBOT_DESKTOP_FILE colobot.desktop)
|
||||
add_custom_command(
|
||||
OUTPUT ${CMAKE_CURRENT_BINARY_DIR}/${COLOBOT_DESKTOP_FILE}
|
||||
COMMAND ./create_desktop_file.sh > ${CMAKE_CURRENT_BINARY_DIR}/${COLOBOT_DESKTOP_FILE}
|
||||
WORKING_DIRECTORY "${CMAKE_CURRENT_SOURCE_DIR}"
|
||||
COMMENT "Build ${COLOBOT_DESKTOP_FILE}"
|
||||
)
|
||||
add_custom_target(desktopfile ALL DEPENDS ${CMAKE_CURRENT_BINARY_DIR}/${COLOBOT_DESKTOP_FILE})
|
||||
install(
|
||||
FILES ${CMAKE_CURRENT_BINARY_DIR}/${COLOBOT_DESKTOP_FILE}
|
||||
DESTINATION ${CMAKE_INSTALL_PREFIX}/share/applications/
|
||||
)
|
||||
|
||||
# Install Icon
|
||||
set(COLOBOT_ICON_FILE colobot.svg)
|
||||
install(
|
||||
FILES ${CMAKE_CURRENT_SOURCE_DIR}/${COLOBOT_ICON_FILE}
|
||||
DESTINATION ${CMAKE_INSTALL_PREFIX}/share/icons/hicolor/scalable/apps/
|
||||
)
|
||||
|
||||
# Render SVG icon in various sizes
|
||||
find_program(RSVG_CONVERT rsvg-convert)
|
||||
if(RSVG_CONVERT)
|
||||
foreach(PNGSIZE "48" "32" "16")
|
||||
file(MAKE_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}/${PNGSIZE})
|
||||
add_custom_target(resize_icon_${PNGSIZE} ALL
|
||||
COMMAND ${RSVG_CONVERT} -w ${PNGSIZE} -h ${PNGSIZE} ${CMAKE_CURRENT_SOURCE_DIR}/${COLOBOT_ICON_FILE}
|
||||
> ${CMAKE_CURRENT_BINARY_DIR}/${PNGSIZE}/colobot.png
|
||||
)
|
||||
install(
|
||||
FILES ${CMAKE_CURRENT_BINARY_DIR}/${PNGSIZE}/colobot.png
|
||||
DESTINATION ${CMAKE_INSTALL_PREFIX}/share/icons/hicolor/${PNGSIZE}x${PNGSIZE}/apps/
|
||||
)
|
||||
endforeach()
|
||||
endif()
|
||||
|
||||
# Create manpage from pod-formatted file
|
||||
find_program(POD2MAN pod2man)
|
||||
if(POD2MAN)
|
||||
set(COLOBOT_MANPAGE_SECTION 6)
|
||||
|
||||
macro(podman)
|
||||
cmake_parse_arguments(PM "" "PODFILE;LOCALE;" "" ${ARGN})
|
||||
if(PM_LOCALE)
|
||||
# This copes with the fact that english has no "/LANG" in the paths and filenames.
|
||||
set(SLASHLOCALE /${PM_LOCALE})
|
||||
endif()
|
||||
file(MAKE_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}${SLASHLOCALE})
|
||||
add_custom_command(OUTPUT ${CMAKE_CURRENT_BINARY_DIR}${SLASHLOCALE}/colobot.${COLOBOT_MANPAGE_SECTION}
|
||||
DEPENDS ${CMAKE_CURRENT_SOURCE_DIR}/${PM_PODFILE}
|
||||
COMMAND ${POD2MAN} ARGS --section=${COLOBOT_MANPAGE_SECTION}
|
||||
--center="Colobot" --stderr --utf8
|
||||
--release="${COLOBOT_VERSION_FULL}"
|
||||
${CMAKE_CURRENT_SOURCE_DIR}/${PM_PODFILE}
|
||||
${CMAKE_CURRENT_BINARY_DIR}${SLASHLOCALE}/colobot.${COLOBOT_MANPAGE_SECTION}
|
||||
COMMENT "Create ${SLASHLOCALE}/colobot.${COLOBOT_MANPAGE_SECTION} manpage"
|
||||
)
|
||||
add_custom_target(man${PM_LOCALE} ALL DEPENDS ${CMAKE_CURRENT_BINARY_DIR}${SLASHLOCALE}/colobot.${COLOBOT_MANPAGE_SECTION})
|
||||
|
||||
install(
|
||||
FILES ${CMAKE_CURRENT_BINARY_DIR}${SLASHLOCALE}/colobot.${COLOBOT_MANPAGE_SECTION}
|
||||
DESTINATION ${CMAKE_INSTALL_PREFIX}/share/man${SLASHLOCALE}/man${COLOBOT_MANPAGE_SECTION}/ )
|
||||
|
||||
add_dependencies(man man${PM_LOCALE})
|
||||
endmacro()
|
||||
|
||||
# Create the english manpage
|
||||
podman(PODFILE colobot.pod)
|
||||
if(NOT PLATFORM_WINDOWS)
|
||||
# Install Desktop Entry file
|
||||
set(COLOBOT_DESKTOP_FILE colobot.desktop)
|
||||
add_custom_command(
|
||||
OUTPUT ${CMAKE_CURRENT_BINARY_DIR}/${COLOBOT_DESKTOP_FILE}
|
||||
COMMAND ./create_desktop_file.sh > ${CMAKE_CURRENT_BINARY_DIR}/${COLOBOT_DESKTOP_FILE}
|
||||
WORKING_DIRECTORY "${CMAKE_CURRENT_SOURCE_DIR}"
|
||||
COMMENT "Build ${COLOBOT_DESKTOP_FILE}"
|
||||
)
|
||||
add_custom_target(desktopfile ALL DEPENDS ${CMAKE_CURRENT_BINARY_DIR}/${COLOBOT_DESKTOP_FILE})
|
||||
install(
|
||||
FILES ${CMAKE_CURRENT_BINARY_DIR}/${COLOBOT_DESKTOP_FILE}
|
||||
DESTINATION ${CMAKE_INSTALL_PREFIX}/share/applications/
|
||||
)
|
||||
|
||||
# Install Icon
|
||||
set(COLOBOT_ICON_FILE colobot.svg)
|
||||
install(
|
||||
FILES ${CMAKE_CURRENT_SOURCE_DIR}/${COLOBOT_ICON_FILE}
|
||||
DESTINATION ${CMAKE_INSTALL_PREFIX}/share/icons/hicolor/scalable/apps/
|
||||
)
|
||||
|
||||
# Render SVG icon in various sizes
|
||||
find_program(RSVG_CONVERT rsvg-convert)
|
||||
if(RSVG_CONVERT)
|
||||
foreach(PNGSIZE "48" "32" "16")
|
||||
file(MAKE_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}/${PNGSIZE})
|
||||
add_custom_target(resize_icon_${PNGSIZE} ALL
|
||||
COMMAND ${RSVG_CONVERT} -w ${PNGSIZE} -h ${PNGSIZE} ${CMAKE_CURRENT_SOURCE_DIR}/${COLOBOT_ICON_FILE}
|
||||
> ${CMAKE_CURRENT_BINARY_DIR}/${PNGSIZE}/colobot.png
|
||||
)
|
||||
install(
|
||||
FILES ${CMAKE_CURRENT_BINARY_DIR}/${PNGSIZE}/colobot.png
|
||||
DESTINATION ${CMAKE_INSTALL_PREFIX}/share/icons/hicolor/${PNGSIZE}x${PNGSIZE}/apps/
|
||||
)
|
||||
endforeach()
|
||||
endif()
|
||||
|
||||
# Create manpage from pod-formatted file
|
||||
find_program(POD2MAN pod2man)
|
||||
if(POD2MAN)
|
||||
set(COLOBOT_MANPAGE_SECTION 6)
|
||||
|
||||
macro(podman)
|
||||
cmake_parse_arguments(PM "" "PODFILE;LOCALE;" "" ${ARGN})
|
||||
if(PM_LOCALE)
|
||||
# This copes with the fact that english has no "/LANG" in the paths and filenames.
|
||||
set(SLASHLOCALE /${PM_LOCALE})
|
||||
endif()
|
||||
file(MAKE_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}${SLASHLOCALE})
|
||||
add_custom_command(OUTPUT ${CMAKE_CURRENT_BINARY_DIR}${SLASHLOCALE}/colobot.${COLOBOT_MANPAGE_SECTION}
|
||||
DEPENDS ${CMAKE_CURRENT_SOURCE_DIR}/${PM_PODFILE}
|
||||
COMMAND ${POD2MAN} ARGS --section=${COLOBOT_MANPAGE_SECTION}
|
||||
--center="Colobot" --stderr --utf8
|
||||
--release="${COLOBOT_VERSION_FULL}"
|
||||
${CMAKE_CURRENT_SOURCE_DIR}/${PM_PODFILE}
|
||||
${CMAKE_CURRENT_BINARY_DIR}${SLASHLOCALE}/colobot.${COLOBOT_MANPAGE_SECTION}
|
||||
COMMENT "Create ${SLASHLOCALE}/colobot.${COLOBOT_MANPAGE_SECTION} manpage"
|
||||
)
|
||||
add_custom_target(man${PM_LOCALE} ALL DEPENDS ${CMAKE_CURRENT_BINARY_DIR}${SLASHLOCALE}/colobot.${COLOBOT_MANPAGE_SECTION})
|
||||
|
||||
install(
|
||||
FILES ${CMAKE_CURRENT_BINARY_DIR}${SLASHLOCALE}/colobot.${COLOBOT_MANPAGE_SECTION}
|
||||
DESTINATION ${CMAKE_INSTALL_PREFIX}/share/man${SLASHLOCALE}/man${COLOBOT_MANPAGE_SECTION}/ )
|
||||
|
||||
add_dependencies(man man${PM_LOCALE})
|
||||
endmacro()
|
||||
|
||||
# Create the english manpage
|
||||
podman(PODFILE colobot.pod)
|
||||
|
||||
endif()
|
||||
|
||||
else() # if(NOT PLATFORM_WINDOWS)
|
||||
set(COLOBOT_VERSION_4COMMAS "${COLOBOT_VERSION_MAJOR},${COLOBOT_VERSION_MINOR},${COLOBOT_VERSION_REVISION},0")
|
||||
configure_file(colobot.rc.cmake ${CMAKE_CURRENT_BINARY_DIR}/colobot.rc)
|
||||
endif()
|
||||
|
||||
# Translate translatable material
|
||||
|
|
Binary file not shown.
After Width: | Height: | Size: 345 KiB |
|
@ -0,0 +1,25 @@
|
|||
id ICON "@CMAKE_CURRENT_SOURCE_DIR@/colobot.ico"
|
||||
|
||||
1 VERSIONINFO
|
||||
FILEVERSION @COLOBOT_VERSION_4COMMAS@
|
||||
PRODUCTVERSION @COLOBOT_VERSION_4COMMAS@
|
||||
BEGIN
|
||||
BLOCK "StringFileInfo"
|
||||
BEGIN
|
||||
BLOCK "040904b0"
|
||||
BEGIN
|
||||
VALUE "OriginalFilename", "colobot.exe\0"
|
||||
VALUE "InternalName", "colobot\0"
|
||||
VALUE "FileDescription", "Colobot - Colonize with Bots\0"
|
||||
VALUE "ProductName", "Colobot\0"
|
||||
VALUE "CompanyName", "Polish Portal of Colobot\0"
|
||||
VALUE "LegalCopyright", "Copyright (c) 2012-2013 Polish Portal of Colobot\0"
|
||||
VALUE "FileVersion", "@COLOBOT_VERSION_FULL@\0"
|
||||
VALUE "ProductVersion", "@COLOBOT_VERSION_FULL@\0"
|
||||
END
|
||||
END
|
||||
BLOCK "VarFileInfo"
|
||||
BEGIN
|
||||
VALUE "Translation", 0x409, 1200
|
||||
END
|
||||
END
|
|
@ -50,6 +50,12 @@ if(OPENAL_SOUND)
|
|||
)
|
||||
endif()
|
||||
|
||||
set(RES_FILES "")
|
||||
|
||||
if(PLATFORM_WINDOWS)
|
||||
set(RES_FILES "../desktop/colobot.rc")
|
||||
endif()
|
||||
|
||||
# Platform-dependent implementation of system.h
|
||||
if(PLATFORM_WINDOWS)
|
||||
set(SYSTEM_CPP_MODULE "system_windows.cpp")
|
||||
|
@ -182,6 +188,7 @@ ui/studio.cpp
|
|||
ui/target.cpp
|
||||
ui/window.cpp
|
||||
${OPENAL_SRC}
|
||||
${RES_FILES}
|
||||
)
|
||||
|
||||
|
||||
|
|
Loading…
Reference in New Issue