Skip to content

Commit 8701b15

Browse files
committed
cmake: Automatically build tesseract.rc with version from file
Signed-off-by: Stefan Weil <[email protected]>
1 parent 2cc46fa commit 8701b15

File tree

2 files changed

+7
-4
lines changed

2 files changed

+7
-4
lines changed

CMakeLists.txt

+3
Original file line numberDiff line numberDiff line change
@@ -123,6 +123,9 @@ set(INCLUDE_DIR "${CMAKE_INSTALL_PREFIX}/include" "${CMAKE_INSTALL_PREFIX}/inclu
123123
configure_file(
124124
${CMAKE_SOURCE_DIR}/api/version.h.in
125125
${CMAKE_BINARY_DIR}/api/version.h @ONLY)
126+
configure_file(
127+
${CMAKE_SOURCE_DIR}/vs2010/tesseract/tesseract.rc.in
128+
${CMAKE_BINARY_DIR}/vs2010/tesseract/tesseract.rc @ONLY)
126129
configure_file(
127130
${CMAKE_SOURCE_DIR}/cmake/templates/TesseractConfig-version.cmake.in
128131
${CMAKE_BINARY_DIR}/TesseractConfig-version.cmake @ONLY)

vs2010/tesseract/tesseract.rc renamed to vs2010/tesseract/tesseract.rc.in

+4-4
Original file line numberDiff line numberDiff line change
@@ -53,8 +53,8 @@ END
5353
//
5454

5555
VS_VERSION_INFO VERSIONINFO
56-
FILEVERSION 4,0,0,0
57-
PRODUCTVERSION 4,0,0,0
56+
FILEVERSION @GENERIC_MAJOR_VERSION@,@GENERIC_MINOR_VERSION@,@GENERIC_MICRO_VERSION@,0
57+
PRODUCTVERSION @GENERIC_MAJOR_VERSION@,@GENERIC_MINOR_VERSION@,@GENERIC_MICRO_VERSION@,0
5858
FILEFLAGSMASK 0x17L
5959
#ifdef _DEBUG
6060
FILEFLAGS 0x1L
@@ -70,12 +70,12 @@ BEGIN
7070
BLOCK "040904b0"
7171
BEGIN
7272
VALUE "FileDescription", "Tesseract command-line OCR engine"
73-
VALUE "FileVersion", "4,0,0,0"
73+
VALUE "FileVersion", "@GENERIC_MAJOR_VERSION@,@GENERIC_MINOR_VERSION@,@GENERIC_MICRO_VERSION@,0"
7474
VALUE "InternalName", "tesseract"
7575
VALUE "LegalCopyright", "Copyright (C) 2016 Google, Inc. Licensed under the Apache License, Version 2.0"
7676
VALUE "OriginalFilename", "tesseract.exe"
7777
VALUE "ProductName", "Tesseract-OCR"
78-
VALUE "ProductVersion", "4.0.0-beta.1"
78+
VALUE "ProductVersion", "@PACKAGE_VERSION@"
7979
END
8080
END
8181
BLOCK "VarFileInfo"

0 commit comments

Comments
 (0)