mirror of
https://github.com/loot/libloot.git
synced 2026-07-27 14:16:01 -07:00
Give the API its own resource file
This commit is contained in:
+3
-3
@@ -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)
|
||||
|
||||
@@ -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();
|
||||
|
||||
@@ -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
|
||||
@@ -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"
|
||||
|
||||
|
||||
|
||||
Reference in New Issue
Block a user