-
-
Notifications
You must be signed in to change notification settings - Fork 6
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
3 changed files
with
69 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,27 @@ | ||
find_package(Git) | ||
|
||
function(get_git_version var1 var2) | ||
if(GIT_EXECUTABLE) | ||
execute_process( | ||
COMMAND ${GIT_EXECUTABLE} describe --tags --match "[0-9]*.[0-9]*.[0-9]*" --abbrev=8 | ||
WORKING_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR} | ||
RESULT_VARIABLE status | ||
OUTPUT_VARIABLE GIT_VERSION | ||
) | ||
if (${status}) | ||
set(GIT_VERSION "0.0.0") | ||
else() | ||
string(STRIP ${GIT_VERSION} GIT_VERSION) | ||
string(REGEX REPLACE "-[0-9]+-g" "-" GIT_VERSION ${GIT_VERSION}) | ||
endif() | ||
else() | ||
set(GIT_VERSION "0.0.0") | ||
endif() | ||
|
||
string(REGEX MATCH "^[0-9]+.[0-9]+.[0-9]+" SEM_VER "${GIT_VERSION}") | ||
|
||
message("-- Git Tag: ${GIT_VERSION}, Sem Ver: ${SEM_VER}") | ||
|
||
set(${var1} ${GIT_VERSION} PARENT_SCOPE) | ||
set(${var2} ${SEM_VER} PARENT_SCOPE) | ||
endfunction() |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,32 @@ | ||
#include <winver.h> | ||
|
||
#define VERSION @PROJECT_VERSION_MAJOR@,@PROJECT_VERSION_MINOR@,@PROJECT_VERSION_PATCH@,0 | ||
#define VERSION_STR "@PROJECT_VERSION_MAJOR@.@PROJECT_VERSION_MINOR@.@[email protected]\0" | ||
|
||
VS_VERSION_INFO VERSIONINFO | ||
FILEVERSION VERSION | ||
PRODUCTVERSION VERSION | ||
FILEFLAGSMASK VS_FFI_FILEFLAGSMASK | ||
FILEFLAGS 0 | ||
FILEOS VOS__WINDOWS32 | ||
FILETYPE VFT_DLL | ||
BEGIN | ||
BLOCK "StringFileInfo" | ||
BEGIN | ||
BLOCK "040904b0" | ||
BEGIN | ||
VALUE "FileDescription", "mpv-menu-plugin\0" | ||
VALUE "ProductName", "mpv-menu-plugin\0" | ||
VALUE "ProductVersion", VERSION_STR | ||
VALUE "FileVersion", VERSION_STR | ||
VALUE "InternalName", "menu\0" | ||
VALUE "OriginalFilename", "menu.dll\0" | ||
VALUE "LegalCopyright", "Copyright (C) 2023-2024 tsl0922\0" | ||
VALUE "Comment", "\0" | ||
END | ||
END | ||
BLOCK "VarFileInfo" | ||
BEGIN | ||
VALUE "Translation", 0x409, 1200 | ||
END | ||
END |