Give the API its own resource file

This commit is contained in:
Oliver Hamlet
2017-02-06 18:03:18 +00:00
parent 673dca39d4
commit d981b29438
5 changed files with 36 additions and 9 deletions
+3 -3
View File
@@ -187,7 +187,8 @@ set (LOOT_API_SRC "${CMAKE_BINARY_DIR}/generated/loot_version.cpp"
"${CMAKE_SOURCE_DIR}/src/api/helpers/crc.cpp"
"${CMAKE_SOURCE_DIR}/src/api/helpers/git_helper.cpp"
"${CMAKE_SOURCE_DIR}/src/api/helpers/language.cpp"
"${CMAKE_SOURCE_DIR}/src/api/helpers/version.cpp")
"${CMAKE_SOURCE_DIR}/src/api/helpers/version.cpp"
"${CMAKE_SOURCE_DIR}/src/api/resource.rc")
set (LOOT_API_HEADERS "${CMAKE_SOURCE_DIR}/include/loot/api.h"
"${CMAKE_SOURCE_DIR}/include/loot/api_decorator.h"
@@ -251,7 +252,7 @@ set (LOOT_GUI_SRC "${CMAKE_SOURCE_DIR}/src/gui/main.cpp"
"${CMAKE_SOURCE_DIR}/src/gui/state/loot_paths.cpp"
"${CMAKE_SOURCE_DIR}/src/gui/state/loot_settings.cpp"
"${CMAKE_SOURCE_DIR}/src/gui/state/loot_state.cpp"
"${CMAKE_SOURCE_DIR}/src/resource.rc")
"${CMAKE_SOURCE_DIR}/src/gui/resource.rc")
set (LOOT_GUI_HEADERS "${CMAKE_SOURCE_DIR}/src/gui/editor_message.h"
"${CMAKE_SOURCE_DIR}/src/gui/helpers.h"
@@ -385,7 +386,6 @@ include_directories ("${CMAKE_SOURCE_DIR}/src"
# Settings when compiling for Windows.
IF (CMAKE_SYSTEM_NAME MATCHES "Windows")
add_definitions (-DUNICODE -D_UNICODE -DLIBLO_STATIC)
set (LOOT_API_SRC ${LOOT_API_SRC} "${CMAKE_SOURCE_DIR}/src/resource.rc")
ENDIF ()
IF (CMAKE_COMPILER_IS_GNUCXX)
+8 -5
View File
@@ -48,21 +48,24 @@ function updateCppFile(version) {
});
}
function updateResourceFile(version) {
const file = path.join('src', 'resource.rc');
function updateResourceFiles(version) {
const files = [
path.join('src', 'api', 'resource.rc'),
path.join('src', 'gui', 'resource.rc'),
];
const commaSeparatedVersion = version.replace(/\./g, ', ');
replace({
regex: /VERSION \d+, \d+, \d+/g,
replacement: `VERSION ${commaSeparatedVersion}`,
paths: [file],
paths: files,
silent: true,
});
replace({
regex: /Version", "\d+\.\d+\.\d+"/g,
replacement: `Version", "${version}"`,
paths: [file],
paths: files,
silent: true,
});
}
@@ -83,7 +86,7 @@ function main() {
updatePreCommitHookScript(newVersion);
updateInstallerScript(newVersion);
updateCppFile(newVersion);
updateResourceFile(newVersion);
updateResourceFiles(newVersion);
}
main();
+25
View File
@@ -0,0 +1,25 @@
#ifdef _WIN32
#include <windows.h>
1 VERSIONINFO
FILEVERSION 0, 10, 3, 0
PRODUCTVERSION 0, 10, 3, 0
FILEOS VOS__WINDOWS32
FILETYPE VFT_APP
BEGIN
BLOCK "StringFileInfo"
BEGIN
BLOCK "040904b0"
BEGIN
VALUE "FileVersion", "0.10.3"
VALUE "LegalCopyright", "Copyright (C) 2013-2016 WrinklyNinja"
VALUE "ProductVersion", "0.10.3"
END
END
BLOCK "VarFileInfo"
BEGIN
VALUE "Translation", 0x409, 1200
END
END
#endif
-1
View File
@@ -68,7 +68,6 @@
#include "gui/query/save_filter_state_query.h"
#include "gui/query/sort_plugins_query.h"
#include "gui/query/update_masterlist_query.h"
#include "gui/resource.h"
#include "gui/yaml_simple_message_helpers.h"