Skip to content

Commit 04362f5

Browse files
committed
Add Windows resource file
1 parent 46f4bda commit 04362f5

File tree

3 files changed

+59
-1
lines changed

3 files changed

+59
-1
lines changed

src/CMakeLists.txt

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -63,7 +63,15 @@ target_link_libraries(CupCalculator_Common
6363
)
6464

6565

66-
add_executable(CupCalculator WIN32 main.cpp)
66+
set(resources )
67+
if(MINGW)
68+
enable_language(RC)
69+
set(EXECUTABLE "CupCalculator")
70+
configure_file("win32/resources.rc.in" "${EXECUTABLE}.rc" @ONLY)
71+
configure_file("win32/control.ico" "${EXECUTABLE}.ico" COPYONLY)
72+
list(APPEND resources "${CMAKE_CURRENT_BINARY_DIR}/${EXECUTABLE}.rc")
73+
endif()
74+
add_executable(CupCalculator WIN32 main.cpp ${resources})
6775
target_link_libraries(CupCalculator
6876
PUBLIC
6977
CupCalculator_Common
File renamed without changes.

src/win32/resources.rc.in

Lines changed: 50 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,50 @@
1+
/*
2+
* Copyright 2012 Thomas Schöps
3+
* Copyright 2019 Kai Pastor
4+
*
5+
* This file is part of OpenOrienteering.
6+
*
7+
* OpenOrienteering is free software: you can redistribute it and/or modify
8+
* it under the terms of the GNU General Public License as published by
9+
* the Free Software Foundation, either version 3 of the License, or
10+
* (at your option) any later version.
11+
*
12+
* OpenOrienteering is distributed in the hope that it will be useful,
13+
* but WITHOUT ANY WARRANTY; without even the implied warranty of
14+
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
15+
* GNU General Public License for more details.
16+
*
17+
* You should have received a copy of the GNU General Public License
18+
* along with OpenOrienteering. If not, see <http://www.gnu.org/licenses/>.
19+
*/
20+
21+
// Do not edit resources.rc! Edit resources.rc.in instead.
22+
23+
// Cf. http://msdn.microsoft.com/en-us/library/aa381058%28v=vs.85%29
24+
25+
IDI_ICON1 ICON "@[email protected]"
26+
27+
1 VERSIONINFO
28+
FILEVERSION @PROJECT_VERSION_MAJOR@,@PROJECT_VERSION_MINOR@,@PROJECT_VERSION_PATCH@,0
29+
PRODUCTVERSION @PROJECT_VERSION_MAJOR@,@PROJECT_VERSION_MINOR@,@PROJECT_VERSION_PATCH@,0
30+
BEGIN
31+
BLOCK "StringFileInfo"
32+
BEGIN
33+
BLOCK "080904E4"
34+
BEGIN
35+
VALUE "CompanyName", "OpenOrienteering"
36+
VALUE "FileDescription", "OpenOrienteering @PROJECT_NAME@ @PROJECT_VERSION@"
37+
VALUE "FileVersion", "@PROJECT_VERSION_DISPLAY@"
38+
VALUE "InternalName", "@APP_NAME@"
39+
VALUE "LegalCopyright", "@PROJECT_VERSION_DISPLAY@"
40+
VALUE "OriginalFilename", "@[email protected]"
41+
VALUE "ProductName", "OpenOrienteering @PROJECT_NAME@"
42+
VALUE "ProductVersion", "@PROJECT_VERSION_DISPLAY@"
43+
END
44+
END
45+
46+
BLOCK "VarFileInfo"
47+
BEGIN
48+
VALUE "Translation", 0x809, 1252
49+
END
50+
END

0 commit comments

Comments
 (0)