build: windows icon

IMPORTANT: Windows users will have to execute clean, setup and cmake after this commit.

* added script to generate the program icon on windows.
* modified setup script to execute icon generator.
* modified CMakeLists to automatically generate the resource file required for windows builds and link it to the visual studio project.
This commit is contained in:
malte_langkabel
2015-04-14 14:30:35 +02:00
parent bdbd266a67
commit 4692ca961a
3 changed files with 33 additions and 2 deletions
+10 -2
View File
@@ -109,8 +109,16 @@ set(CMAKE_PREFIX_PATH "$ENV{QT_DIR}/")
find_package(Qt5Widgets)
find_package(Qt5PrintSupport)
add_executable(${APP_PROJECT_NAME} ${APP_FILES})
if (WIN32)
file(WRITE ${CMAKE_SOURCE_DIR}/build/Coati.rc
"// Icon with lowest ID value placed first to ensure application icon\n"
"// remains consistent on all systems.\n"
"IDI_ICON1 ICON \"${CMAKE_SOURCE_DIR}/build/coati.ico\"\n"
)
add_executable(${APP_PROJECT_NAME} ${APP_FILES} ${CMAKE_SOURCE_DIR}/build/Coati.rc)
else ()
add_executable(${APP_PROJECT_NAME} ${APP_FILES})
endif ()
create_source_groups(${APP_FILES})
+20
View File
@@ -0,0 +1,20 @@
MY_PATH=`dirname "$0"`
ICON_INPUT_PATH=$MY_PATH/../bin/app/data/gui/icon
ICON_OUTPUT_PATH=$MY_PATH/../build
ICON_SIZES_PATH=$ICON_INPUT_PATH/sizes
mkdir -p $ICON_SIZES_PATH
convert $ICON_INPUT_PATH/logo_1024_1024.png -resize 16x16 $ICON_SIZES_PATH/icon_16.png
convert $ICON_INPUT_PATH/logo_1024_1024.png -resize 24x24 $ICON_SIZES_PATH/icon_24.png
convert $ICON_INPUT_PATH/logo_1024_1024.png -resize 32x32 $ICON_SIZES_PATH/icon_32.png
convert $ICON_INPUT_PATH/logo_1024_1024.png -resize 40x40 $ICON_SIZES_PATH/icon_40.png
convert $ICON_INPUT_PATH/logo_1024_1024.png -resize 48x48 $ICON_SIZES_PATH/icon_48.png
convert $ICON_INPUT_PATH/logo_1024_1024.png -resize 64x64 $ICON_SIZES_PATH/icon_64.png
convert $ICON_INPUT_PATH/logo_1024_1024.png -resize 128x128 $ICON_SIZES_PATH/icon_128.png
convert $ICON_INPUT_PATH/logo_1024_1024.png -resize 256x256 $ICON_SIZES_PATH/icon_256.png
convert $ICON_SIZES_PATH/icon_16.png $ICON_SIZES_PATH/icon_24.png $ICON_SIZES_PATH/icon_32.png $ICON_SIZES_PATH/icon_40.png $ICON_SIZES_PATH/icon_48.png $ICON_SIZES_PATH/icon_64.png $ICON_SIZES_PATH/icon_128.png $ICON_SIZES_PATH/icon_256.png -colors 256 $ICON_OUTPUT_PATH/coati.ico
rm -rf $ICON_SIZES_PATH
+3
View File
@@ -48,6 +48,9 @@ if [ $PLATFORM == "Windows" ]; then
echo -e $INFO "copy test_main file"
cp -u setup/cxx_test/windows/test_main.cpp build
echo -e $INFO "creating program icon"
sh script/create_windows_icon.sh
fi
# Setup both Debug and Release configuration