diff --git a/CMakeLists.txt b/CMakeLists.txt index 66a258d2..984df14e 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -1,6 +1,6 @@ cmake_minimum_required(VERSION 3.13) -project(magicseteditor) +project(magicseteditor VERSION 2.0.2) set(CMAKE_CXX_STANDARD 17) set(CMAKE_CXX_STANDARD_REQUIRED True) @@ -32,6 +32,8 @@ list(FILTER sources EXCLUDE REGEX win32_cli_wrapper.cpp) target_sources(magicseteditor PRIVATE ${sources}) target_precompile_headers(magicseteditor PRIVATE src/util/prec.hpp) +configure_file(src/config.hpp.in src/config.hpp) + # resource file target_sources(magicseteditor PRIVATE resource/win32_res.rc) diff --git a/resource/win32_res.rc b/resource/win32_res.rc index 7f019221..4bdffc33 100644 --- a/resource/win32_res.rc +++ b/resource/win32_res.rc @@ -5,6 +5,7 @@ //+----------------------------------------------------------------------------+ #include // include for version info constants +#include // -------------------------------------------------------- : Icons @@ -192,16 +193,16 @@ message_error IMAGE "message_error.png" // -------------------------------------------------------- : Version info -1 VERSIONINFO -FILEVERSION 2,0,2,0 -PRODUCTVERSION 2,0,2,0 +VS_VERSION_INFO VERSIONINFO +FILEVERSION MSE_VERSION_RESOURCE +PRODUCTVERSION MSE_VERSION_RESOURCE FILETYPE VFT_APP { BLOCK "StringFileInfo" { BLOCK "040904E4" { - VALUE "FileVersion", "2.0.2" + VALUE "FileVersion", MSE_VERSION_STRING VALUE "License", "GNU General Public License 2 or later; This is free software, and you are welcome to redistribute it under certain conditions; See the help file for details" VALUE "FileDescription", "Magic Set Editor" VALUE "InternalName", "magicseteditor" diff --git a/src/config.hpp.in b/src/config.hpp.in new file mode 100644 index 00000000..2c43cb79 --- /dev/null +++ b/src/config.hpp.in @@ -0,0 +1,15 @@ +//+----------------------------------------------------------------------------+ +//| Description: Magic Set Editor - Program to make Magic (tm) cards | +//| Copyright: (C) 2001 - 2017 Twan van Laarhoven and Sean Hunt | +//| License: GNU General Public License 2 or later (see file COPYING) | +//+----------------------------------------------------------------------------+ + +#pragma once + +#define MSE_VERSION_MAJOR @magicseteditor_VERSION_MAJOR@ +#define MSE_VERSION_MINOR @magicseteditor_VERSION_MINOR@ +#define MSE_VERSION_PATCH @magicseteditor_VERSION_PATCH@ + +// version number for .rc file +#define MSE_VERSION_RESOURCE @magicseteditor_VERSION_MAJOR@,@magicseteditor_VERSION_MINOR@,@magicseteditor_VERSION_PATCH@,0 +#define MSE_VERSION_STRING "@magicseteditor_VERSION_MAJOR@.@magicseteditor_VERSION_MINOR@.@magicseteditor_VERSION_PATCH@" \ No newline at end of file diff --git a/src/util/version.cpp b/src/util/version.cpp index 343b329f..91b3ed4d 100644 --- a/src/util/version.cpp +++ b/src/util/version.cpp @@ -9,6 +9,7 @@ #include #include #include +#include // ----------------------------------------------------------------------------- : Version @@ -50,7 +51,7 @@ template <> void GetDefaultMember::handle(const Version& v) { // ----------------------------------------------------------------------------- : Versions // NOTE: Don't use leading zeroes, they mean octal -const Version app_version = 20000; // 2.0.0 +const Version app_version = 10000 * MSE_VERSION_MAJOR + 100 * MSE_VERSION_MINOR + MSE_VERSION_PATCH; #ifdef UNICODE const Char* version_suffix = _(""); #else @@ -82,7 +83,7 @@ const Char* version_suffix = _(" (ascii build)"); * 0.3.9 : bugfix release mostly, a few new script functions * 2.0.0 : bugfix release mostly, added error console */ -const Version file_version_locale = 20000; // 2.0.0 +const Version file_version_locale = 20002; // 2.0.2 const Version file_version_set = 308; // 0.3.8 const Version file_version_game = 308; // 0.3.8 const Version file_version_stylesheet = 308; // 0.3.8