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)
|
add_subdirectory(po)
|
||||||
|
|
||||||
if(DESKTOP)
|
if(DESKTOP)
|
||||||
if(PLATFORM_WINDOWS)
|
add_subdirectory(desktop)
|
||||||
message("Desktop files ignored on Windows")
|
|
||||||
else()
|
|
||||||
add_subdirectory(desktop)
|
|
||||||
endif()
|
|
||||||
endif()
|
endif()
|
||||||
|
|
||||||
|
|
||||||
|
|
|
@ -1,75 +1,81 @@
|
||||||
cmake_minimum_required(VERSION 2.8)
|
cmake_minimum_required(VERSION 2.8)
|
||||||
|
|
||||||
# Install Desktop Entry file
|
if(NOT PLATFORM_WINDOWS)
|
||||||
set(COLOBOT_DESKTOP_FILE colobot.desktop)
|
# Install Desktop Entry file
|
||||||
add_custom_command(
|
set(COLOBOT_DESKTOP_FILE colobot.desktop)
|
||||||
OUTPUT ${CMAKE_CURRENT_BINARY_DIR}/${COLOBOT_DESKTOP_FILE}
|
add_custom_command(
|
||||||
COMMAND ./create_desktop_file.sh > ${CMAKE_CURRENT_BINARY_DIR}/${COLOBOT_DESKTOP_FILE}
|
OUTPUT ${CMAKE_CURRENT_BINARY_DIR}/${COLOBOT_DESKTOP_FILE}
|
||||||
WORKING_DIRECTORY "${CMAKE_CURRENT_SOURCE_DIR}"
|
COMMAND ./create_desktop_file.sh > ${CMAKE_CURRENT_BINARY_DIR}/${COLOBOT_DESKTOP_FILE}
|
||||||
COMMENT "Build ${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(
|
add_custom_target(desktopfile ALL DEPENDS ${CMAKE_CURRENT_BINARY_DIR}/${COLOBOT_DESKTOP_FILE})
|
||||||
FILES ${CMAKE_CURRENT_BINARY_DIR}/${COLOBOT_DESKTOP_FILE}
|
install(
|
||||||
DESTINATION ${CMAKE_INSTALL_PREFIX}/share/applications/
|
FILES ${CMAKE_CURRENT_BINARY_DIR}/${COLOBOT_DESKTOP_FILE}
|
||||||
)
|
DESTINATION ${CMAKE_INSTALL_PREFIX}/share/applications/
|
||||||
|
)
|
||||||
# Install Icon
|
|
||||||
set(COLOBOT_ICON_FILE colobot.svg)
|
# Install Icon
|
||||||
install(
|
set(COLOBOT_ICON_FILE colobot.svg)
|
||||||
FILES ${CMAKE_CURRENT_SOURCE_DIR}/${COLOBOT_ICON_FILE}
|
install(
|
||||||
DESTINATION ${CMAKE_INSTALL_PREFIX}/share/icons/hicolor/scalable/apps/
|
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)
|
# Render SVG icon in various sizes
|
||||||
if(RSVG_CONVERT)
|
find_program(RSVG_CONVERT rsvg-convert)
|
||||||
foreach(PNGSIZE "48" "32" "16")
|
if(RSVG_CONVERT)
|
||||||
file(MAKE_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}/${PNGSIZE})
|
foreach(PNGSIZE "48" "32" "16")
|
||||||
add_custom_target(resize_icon_${PNGSIZE} ALL
|
file(MAKE_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}/${PNGSIZE})
|
||||||
COMMAND ${RSVG_CONVERT} -w ${PNGSIZE} -h ${PNGSIZE} ${CMAKE_CURRENT_SOURCE_DIR}/${COLOBOT_ICON_FILE}
|
add_custom_target(resize_icon_${PNGSIZE} ALL
|
||||||
> ${CMAKE_CURRENT_BINARY_DIR}/${PNGSIZE}/colobot.png
|
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
|
install(
|
||||||
DESTINATION ${CMAKE_INSTALL_PREFIX}/share/icons/hicolor/${PNGSIZE}x${PNGSIZE}/apps/
|
FILES ${CMAKE_CURRENT_BINARY_DIR}/${PNGSIZE}/colobot.png
|
||||||
)
|
DESTINATION ${CMAKE_INSTALL_PREFIX}/share/icons/hicolor/${PNGSIZE}x${PNGSIZE}/apps/
|
||||||
endforeach()
|
)
|
||||||
endif()
|
endforeach()
|
||||||
|
endif()
|
||||||
# Create manpage from pod-formatted file
|
|
||||||
find_program(POD2MAN pod2man)
|
# Create manpage from pod-formatted file
|
||||||
if(POD2MAN)
|
find_program(POD2MAN pod2man)
|
||||||
set(COLOBOT_MANPAGE_SECTION 6)
|
if(POD2MAN)
|
||||||
|
set(COLOBOT_MANPAGE_SECTION 6)
|
||||||
macro(podman)
|
|
||||||
cmake_parse_arguments(PM "" "PODFILE;LOCALE;" "" ${ARGN})
|
macro(podman)
|
||||||
if(PM_LOCALE)
|
cmake_parse_arguments(PM "" "PODFILE;LOCALE;" "" ${ARGN})
|
||||||
# This copes with the fact that english has no "/LANG" in the paths and filenames.
|
if(PM_LOCALE)
|
||||||
set(SLASHLOCALE /${PM_LOCALE})
|
# This copes with the fact that english has no "/LANG" in the paths and filenames.
|
||||||
endif()
|
set(SLASHLOCALE /${PM_LOCALE})
|
||||||
file(MAKE_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}${SLASHLOCALE})
|
endif()
|
||||||
add_custom_command(OUTPUT ${CMAKE_CURRENT_BINARY_DIR}${SLASHLOCALE}/colobot.${COLOBOT_MANPAGE_SECTION}
|
file(MAKE_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}${SLASHLOCALE})
|
||||||
DEPENDS ${CMAKE_CURRENT_SOURCE_DIR}/${PM_PODFILE}
|
add_custom_command(OUTPUT ${CMAKE_CURRENT_BINARY_DIR}${SLASHLOCALE}/colobot.${COLOBOT_MANPAGE_SECTION}
|
||||||
COMMAND ${POD2MAN} ARGS --section=${COLOBOT_MANPAGE_SECTION}
|
DEPENDS ${CMAKE_CURRENT_SOURCE_DIR}/${PM_PODFILE}
|
||||||
--center="Colobot" --stderr --utf8
|
COMMAND ${POD2MAN} ARGS --section=${COLOBOT_MANPAGE_SECTION}
|
||||||
--release="${COLOBOT_VERSION_FULL}"
|
--center="Colobot" --stderr --utf8
|
||||||
${CMAKE_CURRENT_SOURCE_DIR}/${PM_PODFILE}
|
--release="${COLOBOT_VERSION_FULL}"
|
||||||
${CMAKE_CURRENT_BINARY_DIR}${SLASHLOCALE}/colobot.${COLOBOT_MANPAGE_SECTION}
|
${CMAKE_CURRENT_SOURCE_DIR}/${PM_PODFILE}
|
||||||
COMMENT "Create ${SLASHLOCALE}/colobot.${COLOBOT_MANPAGE_SECTION} manpage"
|
${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})
|
)
|
||||||
|
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}
|
install(
|
||||||
DESTINATION ${CMAKE_INSTALL_PREFIX}/share/man${SLASHLOCALE}/man${COLOBOT_MANPAGE_SECTION}/ )
|
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()
|
add_dependencies(man man${PM_LOCALE})
|
||||||
|
endmacro()
|
||||||
# Create the english manpage
|
|
||||||
podman(PODFILE colobot.pod)
|
# 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()
|
endif()
|
||||||
|
|
||||||
# Translate translatable material
|
# 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()
|
endif()
|
||||||
|
|
||||||
|
set(RES_FILES "")
|
||||||
|
|
||||||
|
if(PLATFORM_WINDOWS)
|
||||||
|
set(RES_FILES "../desktop/colobot.rc")
|
||||||
|
endif()
|
||||||
|
|
||||||
# Platform-dependent implementation of system.h
|
# Platform-dependent implementation of system.h
|
||||||
if(PLATFORM_WINDOWS)
|
if(PLATFORM_WINDOWS)
|
||||||
set(SYSTEM_CPP_MODULE "system_windows.cpp")
|
set(SYSTEM_CPP_MODULE "system_windows.cpp")
|
||||||
|
@ -182,6 +188,7 @@ ui/studio.cpp
|
||||||
ui/target.cpp
|
ui/target.cpp
|
||||||
ui/window.cpp
|
ui/window.cpp
|
||||||
${OPENAL_SRC}
|
${OPENAL_SRC}
|
||||||
|
${RES_FILES}
|
||||||
)
|
)
|
||||||
|
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue