-
Notifications
You must be signed in to change notification settings - Fork 150
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
Jan Wilmans
committed
Feb 22, 2024
1 parent
91d63ac
commit c9ee1f7
Showing
4 changed files
with
32 additions
and
22 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
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 |
---|---|---|
@@ -1,2 +1,2 @@ | ||
#define VERSION 1,9,0,0 | ||
#define VERSION_STR "1.9.0.0" | ||
#define VERSION 1,9,0,24 | ||
#define VERSION_STR "1.9.0.24" |
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 |
---|---|---|
@@ -1,8 +1,8 @@ | ||
<?xml version="1.0" encoding="utf-8"?> | ||
<Include> | ||
<?define ProductVersion.Major="1" ?> | ||
<?define ProductVersion.Minor="8" ?> | ||
<?define ProductVersion.Revision="0" ?> | ||
<?define ProductVersion.Build="103" ?> | ||
<?define ProductVersion="1.8.0.103" ?> | ||
</Include> | ||
<?xml version="1.0" encoding="utf-8"?> | ||
<Include> | ||
<?define ProductVersion.Major="1" ?> | ||
<?define ProductVersion.Minor="9" ?> | ||
<?define ProductVersion.Revision="0" ?> | ||
<?define ProductVersion.Build="24" ?> | ||
<?define ProductVersion="1.9.0.24" ?> | ||
</Include> |
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 |
---|---|---|
@@ -1,17 +1,23 @@ | ||
# Set the initial build number | ||
set(BUILD_NUMBER 0) | ||
|
||
# Check if the build number file exists | ||
if(EXISTS ${CMAKE_SOURCE_DIR}/cmake/build_number.txt) | ||
# If it exists, read the current build number from the file | ||
file(READ ${CMAKE_SOURCE_DIR}/cmake/build_number.txt BUILD_NUMBER) | ||
endif() | ||
execute_process( | ||
COMMAND cmd /C UpdateBuildNr.cmd version.h version.wxi | ||
WORKING_DIRECTORY "${CMAKE_SOURCE_DIR}/Application/DebugviewPP/" | ||
COMMAND_ERROR_IS_FATAL ANY | ||
) | ||
|
||
file(READ "${CMAKE_SOURCE_DIR}/application/DebugViewpp/version.h" VERSION_FILE_CONTENTS) | ||
|
||
# Increment the build number | ||
math(EXPR BUILD_NUMBER "${BUILD_NUMBER} + 1") | ||
# Regular expression to extract VERSION_STR | ||
string(REGEX MATCH "#define VERSION_STR \"([0-9]+\\.[0-9]+\\.[0-9]+\\.[0-9]+)\"" VERSION_STR_MATCH "${VERSION_FILE_CONTENTS}") | ||
|
||
# Write the updated build number to the file | ||
file(WRITE ${CMAKE_SOURCE_DIR}/cmake/build_number.txt ${BUILD_NUMBER}) | ||
# Extract the version string from the matched content | ||
if(VERSION_STR_MATCH) | ||
set(VERSION_STR ${CMAKE_MATCH_1}) | ||
else() | ||
message(FATAL_ERROR "Failed to extract VERSION_STR from version.h") | ||
endif() | ||
|
||
# Set the build number as a CMake variable | ||
set(DEBUGVIEW_VERSION "1.9.0.${BUILD_NUMBER}" CACHE INTERNAL "") | ||
set(DEBUGVIEW_VERSION "${VERSION_STR}" CACHE INTERNAL "") | ||
|
||
MESSAGE("Retrieved version: ${VERSION_STR} from version.h") |