Merge pull request #245 from OdyX/dev-platform-fixes

Platform fixes (Windows Icon and Mac OSX SDL_Main fix)
dev-ui
Piotr Dziwiński 2013-10-29 14:12:07 -07:00
commit 816f4e91b9
6 changed files with 110 additions and 75 deletions

View File

@ -57,6 +57,8 @@ elseif("${CMAKE_SYSTEM_NAME}" MATCHES "Darwin")
set(PLATFORM_LINUX 0) set(PLATFORM_LINUX 0)
set(PLATFORM_MACOSX 1) set(PLATFORM_MACOSX 1)
set(PLATFORM_OTHER 0) set(PLATFORM_OTHER 0)
set(USE_SDL_MAIN 1) # fixes SDL_main
else() else()
message(STATUS "Build for other system") message(STATUS "Build for other system")
set(PLATFORM_WINDOWS 0) set(PLATFORM_WINDOWS 0)
@ -321,12 +323,8 @@ add_subdirectory(src)
add_subdirectory(po) add_subdirectory(po)
if(DESKTOP) if(DESKTOP)
if(PLATFORM_WINDOWS)
message("Desktop files ignored on Windows")
else()
add_subdirectory(desktop) add_subdirectory(desktop)
endif() endif()
endif()
## ##

View File

@ -1,5 +1,6 @@
cmake_minimum_required(VERSION 2.8) cmake_minimum_required(VERSION 2.8)
if(NOT PLATFORM_WINDOWS)
# Install Desktop Entry file # Install Desktop Entry file
set(COLOBOT_DESKTOP_FILE colobot.desktop) set(COLOBOT_DESKTOP_FILE colobot.desktop)
add_custom_command( add_custom_command(
@ -72,6 +73,11 @@ if(POD2MAN)
endif() 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 # Translate translatable material
find_program(PO4A po4a) find_program(PO4A po4a)

BIN
desktop/colobot.ico Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 345 KiB

25
desktop/colobot.rc.cmake Normal file
View File

@ -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

View File

@ -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}
) )

View File

@ -28,7 +28,6 @@
#include "common/misc.h" #include "common/misc.h"
#include "common/restext.h" #include "common/restext.h"
#include <SDL.h>
/* Doxygen main page */ /* Doxygen main page */