-
Notifications
You must be signed in to change notification settings - Fork 133
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
1 parent
12885af
commit a0f7c83
Showing
4 changed files
with
338 additions
and
257 deletions.
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,25 @@ | ||
# SPDX-License-Identifier: MIT | ||
if(NOT BUILD_VERSION OR NOT OUTPUT_PATH) | ||
message(FATAL_ERROR "BUILD_VERSION and OUTPUT_PATH are required") | ||
endif() | ||
|
||
message(STATUS "Build version: '${BUILD_VERSION}'") | ||
if(BUILD_VERSION MATCHES "^([0-9]+)\\.([0-9]+)\\.([0-9]+)") | ||
set(server "${CMAKE_MATCH_1}") | ||
set(major "${CMAKE_MATCH_2}") | ||
set(minor "${CMAKE_MATCH_3}") | ||
|
||
if(BUILD_VERSION MATCHES "-beta\\.([0-9]+)") | ||
set(beta "${CMAKE_MATCH_1}") | ||
else() | ||
set(beta 0) | ||
endif() | ||
|
||
set(PRODUCT_VERSION "${server}.${major}.${minor}.${beta}") | ||
message(STATUS "Product version: '${PRODUCT_VERSION}'") | ||
file(APPEND "${OUTPUT_PATH}" "WINDOWS_PRODUCT_VERSION=${PRODUCT_VERSION}\n") | ||
else() | ||
message(FATAL_ERROR "Unable to determine product version") | ||
endif() | ||
|
||
|
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,25 @@ | ||
# SPDX-License-Identifier: MIT | ||
if(NOT PRODUCT_NAME OR NOT PRODUCT_VERSION OR NOT SEARCH_PATHS) | ||
message(FATAL_ERROR "PRODUCT_NAME, PRODUCT_VERSION and SEARCH_PATHS are required") | ||
endif() | ||
|
||
find_program(RCEDIT_COMMAND rcedit REQUIRED) | ||
|
||
unset(globs) | ||
foreach(search_path IN LISTS SEARCH_PATHS) | ||
list(APPEND globs "${search_path}/*.dll" "${search_path}/*.exe") | ||
endforeach() | ||
|
||
message(STATUS "Looking for PE files: ${globs}") | ||
file(GLOB_RECURSE pe_paths FOLLOW_SYMLINKS ${globs}) | ||
foreach(pe_path IN LISTS pe_paths) | ||
execute_process( | ||
COMMAND | ||
${RCEDIT_COMMAND} | ||
"${pe_path}" | ||
--set-version-string ProductName "${PRODUCT_NAME}" | ||
--set-version-string ProductVersion "${PRODUCT_VERSION}" | ||
COMMAND_ECHO STDOUT | ||
COMMAND_ERROR_IS_FATAL ANY | ||
) | ||
endforeach() |
Oops, something went wrong.