mirror of
https://github.com/JGRennison/OpenTTD-patches.git
synced 2024-11-11 13:10:45 +00:00
Codefix: [Win32] Use correct range for version in rc file
This commit is contained in:
parent
5ed2fcfb53
commit
b52f778f20
@ -57,7 +57,6 @@ if(GIT_FOUND AND EXISTS "${CMAKE_SOURCE_DIR}/.git")
|
|||||||
)
|
)
|
||||||
string(REGEX REPLACE "([0-9]+)-([0-9]+)-([0-9]+).*" "\\1\\2\\3" COMMITDATE "${COMMITDATE}")
|
string(REGEX REPLACE "([0-9]+)-([0-9]+)-([0-9]+).*" "\\1\\2\\3" COMMITDATE "${COMMITDATE}")
|
||||||
set(REV_ISODATE "${COMMITDATE}")
|
set(REV_ISODATE "${COMMITDATE}")
|
||||||
string(SUBSTRING "${REV_ISODATE}" 0 4 REV_YEAR)
|
|
||||||
|
|
||||||
# Get the branch
|
# Get the branch
|
||||||
execute_process(COMMAND ${GIT_EXECUTABLE} symbolic-ref -q HEAD
|
execute_process(COMMAND ${GIT_EXECUTABLE} symbolic-ref -q HEAD
|
||||||
@ -114,7 +113,6 @@ elseif(EXISTS "${CMAKE_SOURCE_DIR}/.ottdrev")
|
|||||||
list(GET OTTDREV 3 REV_HASH)
|
list(GET OTTDREV 3 REV_HASH)
|
||||||
list(GET OTTDREV 4 REV_ISTAG)
|
list(GET OTTDREV 4 REV_ISTAG)
|
||||||
list(GET OTTDREV 5 REV_ISSTABLETAG)
|
list(GET OTTDREV 5 REV_ISSTABLETAG)
|
||||||
list(GET OTTDREV 6 REV_YEAR)
|
|
||||||
else()
|
else()
|
||||||
message(WARNING "No version detected; this build will NOT be network compatible")
|
message(WARNING "No version detected; this build will NOT be network compatible")
|
||||||
set(REV_VERSION "norev0000")
|
set(REV_VERSION "norev0000")
|
||||||
@ -123,14 +121,19 @@ else()
|
|||||||
set(REV_HASH "unknown")
|
set(REV_HASH "unknown")
|
||||||
set(REV_ISTAG 0)
|
set(REV_ISTAG 0)
|
||||||
set(REV_ISSTABLETAG 0)
|
set(REV_ISSTABLETAG 0)
|
||||||
set(REV_YEAR "1970")
|
|
||||||
endif()
|
endif()
|
||||||
|
|
||||||
|
# Extract REV_YEAR and REV_DATE from REV_ISODATE
|
||||||
|
string(SUBSTRING "${REV_ISODATE}" 0 4 REV_YEAR)
|
||||||
|
string(SUBSTRING "${REV_ISODATE}" 4 4 REV_DATE)
|
||||||
|
# Drop leading 0 in REV_DATE if any
|
||||||
|
string(REGEX REPLACE "^0?([0-9]+)" "\\1" REV_DATE "${REV_DATE}")
|
||||||
|
|
||||||
message(STATUS "Version string: ${REV_VERSION}")
|
message(STATUS "Version string: ${REV_VERSION}")
|
||||||
|
|
||||||
if(GENERATE_OTTDREV)
|
if(GENERATE_OTTDREV)
|
||||||
message(STATUS "Generating .ottdrev")
|
message(STATUS "Generating .ottdrev")
|
||||||
file(WRITE ${CMAKE_SOURCE_DIR}/.ottdrev "${REV_VERSION}\t${REV_ISODATE}\t${REV_MODIFIED}\t${REV_HASH}\t${REV_ISTAG}\t${REV_ISSTABLETAG}\t${REV_YEAR}\n")
|
file(WRITE ${CMAKE_SOURCE_DIR}/.ottdrev "${REV_VERSION}\t${REV_ISODATE}\t${REV_MODIFIED}\t${REV_HASH}\t${REV_ISTAG}\t${REV_ISSTABLETAG}\n")
|
||||||
else()
|
else()
|
||||||
message(STATUS "Generating rev.cpp")
|
message(STATUS "Generating rev.cpp")
|
||||||
configure_file("${CMAKE_SOURCE_DIR}/src/rev.cpp.in"
|
configure_file("${CMAKE_SOURCE_DIR}/src/rev.cpp.in"
|
||||||
|
@ -76,8 +76,8 @@ END
|
|||||||
//
|
//
|
||||||
|
|
||||||
VS_VERSION_INFO VERSIONINFO
|
VS_VERSION_INFO VERSIONINFO
|
||||||
FILEVERSION ${REV_MAJOR},${REV_MINOR},0,${REV_ISODATE}
|
FILEVERSION ${REV_MAJOR},${REV_MINOR},${REV_YEAR},${REV_DATE}
|
||||||
PRODUCTVERSION ${REV_MAJOR},${REV_MINOR},0,${REV_ISODATE}
|
PRODUCTVERSION ${REV_MAJOR},${REV_MINOR},${REV_YEAR},${REV_DATE}
|
||||||
FILEFLAGSMASK 0x3fL
|
FILEFLAGSMASK 0x3fL
|
||||||
#ifdef _DEBUG
|
#ifdef _DEBUG
|
||||||
FILEFLAGS 0x1L
|
FILEFLAGS 0x1L
|
||||||
|
Loading…
Reference in New Issue
Block a user