Skip to content

Commit

Permalink
CMake: Compile meta-data information and icon file on Windows
Browse files Browse the repository at this point in the history
The meta-data will give information about the program, such as its
license, version, and description.

Signed-off-by: Paul Cercueil <[email protected]>
  • Loading branch information
pcercuei committed Dec 12, 2018
1 parent 5003ec2 commit 9cdecc8
Show file tree
Hide file tree
Showing 2 changed files with 36 additions and 1 deletion.
8 changes: 7 additions & 1 deletion CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -175,7 +175,13 @@ endif (NOT USE_SYSTEM_LIBLUA)

add_library(pioneerLib STATIC ${CXX_FILES})

add_executable(${PROJECT_NAME} WIN32 src/main.cpp)
if (WIN32)
string(TIMESTAMP BUILD_YEAR "%Y")
set(RESOURCES ${CMAKE_BINARY_DIR}/pioneer.rc)
configure_file(pioneer.rc.cmakein ${RESOURCES} @ONLY)
endif()

add_executable(${PROJECT_NAME} WIN32 src/main.cpp ${RESOURCES})
add_executable(modelcompiler WIN32 src/modelcompiler.cpp)
add_executable(savegamedump WIN32
src/savegamedump.cpp
Expand Down
29 changes: 29 additions & 0 deletions pioneer.rc.cmakein
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
#include <windows.h>
AppIcon ICON DISCARDABLE "@CMAKE_SOURCE_DIR@/application-icon/pioneer.ico"

LANGUAGE LANG_ENGLISH, SUBLANG_DEFAULT

VS_VERSION_INFO VERSIONINFO
FILEVERSION @PROJECT_VERSION@
BEGIN
BLOCK "StringFileInfo"
BEGIN
BLOCK "040904E4"
BEGIN
VALUE "FileVersion", "@PROJECT_VERSION@"
VALUE "CompanyName", "Pioneer developers"
VALUE "FileDescription", "Pioneer Space Simulator"
VALUE "InternalName", "Pioneer"
VALUE "LegalCopyright", "Copyright 2008-@BUILD_YEAR@ Pioneer developers"
VALUE "LegalTrademarks", "https://www.gnu.org/licenses/gpl-3.0.en.html"
VALUE "OriginalFilename", "pioneer.exe"
VALUE "ProductName", "Pioneer"
VALUE "ProductVersion", "@PROJECT_VERSION@"
END
END

BLOCK "VarFileInfo"
BEGIN
VALUE "Translation", 0x409, 1252
END
END

0 comments on commit 9cdecc8

Please sign in to comment.