mirror of
https://github.com/tesseract-ocr/tesseract.git
synced 2024-11-27 12:49:35 +08:00
fix cmake windows version info for tesseract library and executable
This commit is contained in:
parent
d28439c375
commit
f8e26eedff
@ -126,6 +126,9 @@ configure_file(
|
||||
configure_file(
|
||||
${CMAKE_SOURCE_DIR}/vs2010/tesseract/tesseract.rc.in
|
||||
${CMAKE_BINARY_DIR}/vs2010/tesseract/tesseract.rc @ONLY)
|
||||
configure_file(
|
||||
${CMAKE_SOURCE_DIR}/vs2010/tesseract/libtesseract.rc.in
|
||||
${CMAKE_BINARY_DIR}/vs2010/tesseract/libtesseract.rc @ONLY)
|
||||
configure_file(
|
||||
${CMAKE_SOURCE_DIR}/cmake/templates/TesseractConfig-version.cmake.in
|
||||
${CMAKE_BINARY_DIR}/TesseractConfig-version.cmake @ONLY)
|
||||
@ -214,6 +217,11 @@ set(tesseract_src ${tesseract_src}
|
||||
|
||||
if (WIN32)
|
||||
if (MSVC)
|
||||
include_directories(vs2010/tesseract)
|
||||
set(tesseract_hdr
|
||||
${tesseract_hdr}
|
||||
${CMAKE_CURRENT_SOURCE_DIR}/vs2010/tesseract/resource.h)
|
||||
set(tesseract_rsc ${CMAKE_BINARY_DIR}/vs2010/tesseract/libtesseract.rc)
|
||||
set_source_files_properties(
|
||||
${CMAKE_CURRENT_SOURCE_DIR}/arch/dotproductsse.cpp
|
||||
PROPERTIES COMPILE_DEFINITIONS __SSE4_1__)
|
||||
@ -242,7 +250,9 @@ else()
|
||||
PROPERTIES COMPILE_FLAGS "-mavx2")
|
||||
endif()
|
||||
|
||||
add_library (libtesseract ${LIBRARY_TYPE} ${tesseract_src} ${tesseract_hdr})
|
||||
add_library (libtesseract ${LIBRARY_TYPE} ${tesseract_src} ${tesseract_hdr}
|
||||
${tesseract_rsc}
|
||||
)
|
||||
if (NOT STATIC)
|
||||
target_compile_definitions (libtesseract
|
||||
PRIVATE -DTESS_EXPORTS
|
||||
@ -273,12 +283,12 @@ endif()
|
||||
# EXECUTABLE tesseractmain
|
||||
########################################
|
||||
|
||||
set(tesseractmain_src
|
||||
api/tesseractmain.cpp
|
||||
vs2010/tesseract/resource.h
|
||||
vs2010/tesseract/tesseract.rc
|
||||
)
|
||||
add_executable (tesseract ${tesseractmain_src})
|
||||
set(tesseractmain_src api/tesseractmain.cpp)
|
||||
if (MSVC)
|
||||
set(tesseractmain_rsc ${CMAKE_BINARY_DIR}/vs2010/tesseract/tesseract.rc)
|
||||
endif()
|
||||
|
||||
add_executable (tesseract ${tesseractmain_src} ${tesseractmain_rsc})
|
||||
target_link_libraries (tesseract libtesseract)
|
||||
|
||||
########################################
|
||||
|
101
vs2010/tesseract/libtesseract.rc.in
Normal file
101
vs2010/tesseract/libtesseract.rc.in
Normal file
@ -0,0 +1,101 @@
|
||||
// Microsoft Visual C++ generated resource script.
|
||||
//
|
||||
#include "resource.h"
|
||||
|
||||
#define APSTUDIO_READONLY_SYMBOLS
|
||||
/////////////////////////////////////////////////////////////////////////////
|
||||
//
|
||||
// Generated from the TEXTINCLUDE 2 resource.
|
||||
//
|
||||
#include "windows.h"
|
||||
|
||||
/////////////////////////////////////////////////////////////////////////////
|
||||
#undef APSTUDIO_READONLY_SYMBOLS
|
||||
|
||||
/////////////////////////////////////////////////////////////////////////////
|
||||
// English (U.S.) resources
|
||||
|
||||
#if !defined(AFX_RESOURCE_DLL) || defined(AFX_TARG_ENU)
|
||||
#ifdef _WIN32
|
||||
LANGUAGE LANG_ENGLISH, SUBLANG_ENGLISH_US
|
||||
#pragma code_page(1252)
|
||||
#endif //_WIN32
|
||||
|
||||
#ifdef APSTUDIO_INVOKED
|
||||
/////////////////////////////////////////////////////////////////////////////
|
||||
//
|
||||
// TEXTINCLUDE
|
||||
//
|
||||
|
||||
1 TEXTINCLUDE
|
||||
BEGIN
|
||||
"resource.h\0"
|
||||
END
|
||||
|
||||
2 TEXTINCLUDE
|
||||
BEGIN
|
||||
"#include ""afxres.h""\r\n"
|
||||
"\0"
|
||||
END
|
||||
|
||||
3 TEXTINCLUDE
|
||||
BEGIN
|
||||
"\r\n"
|
||||
"\0"
|
||||
END
|
||||
|
||||
#endif // APSTUDIO_INVOKED
|
||||
|
||||
|
||||
/////////////////////////////////////////////////////////////////////////////
|
||||
//
|
||||
// Version
|
||||
//
|
||||
|
||||
VS_VERSION_INFO VERSIONINFO
|
||||
FILEVERSION @GENERIC_MAJOR_VERSION@,@GENERIC_MINOR_VERSION@,@GENERIC_MICRO_VERSION@,0
|
||||
PRODUCTVERSION @GENERIC_MAJOR_VERSION@,@GENERIC_MINOR_VERSION@,@GENERIC_MICRO_VERSION@,0
|
||||
FILEFLAGSMASK 0x17L
|
||||
#ifdef _DEBUG
|
||||
FILEFLAGS 0x1L
|
||||
#else
|
||||
FILEFLAGS 0x0L
|
||||
#endif
|
||||
FILEOS 0x4L
|
||||
FILETYPE 0x7L
|
||||
FILESUBTYPE 0x0L
|
||||
BEGIN
|
||||
BLOCK "StringFileInfo"
|
||||
BEGIN
|
||||
BLOCK "040904b0"
|
||||
BEGIN
|
||||
VALUE "FileDescription", "Tesseract OCR library"
|
||||
VALUE "FileVersion", "@GENERIC_MAJOR_VERSION@,@GENERIC_MINOR_VERSION@,@GENERIC_MICRO_VERSION@,0"
|
||||
VALUE "InternalName", "libtesseract"
|
||||
VALUE "LegalCopyright", "Copyright (C) 2018 Google, Inc. Licensed under the Apache License, Version 2.0"
|
||||
VALUE "OriginalFilename", "tesseract@GENERIC_MAJOR_VERSION@@GENERIC_MINOR_VERSION@.dll"
|
||||
VALUE "ProductName", "Tesseract OCR Library"
|
||||
VALUE "ProductVersion", "@PACKAGE_VERSION@"
|
||||
END
|
||||
END
|
||||
BLOCK "VarFileInfo"
|
||||
BEGIN
|
||||
VALUE "Translation", 0x409, 1200
|
||||
END
|
||||
END
|
||||
|
||||
#endif // English (U.S.) resources
|
||||
/////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
|
||||
|
||||
#ifndef APSTUDIO_INVOKED
|
||||
/////////////////////////////////////////////////////////////////////////////
|
||||
//
|
||||
// Generated from the TEXTINCLUDE 3 resource.
|
||||
//
|
||||
|
||||
|
||||
/////////////////////////////////////////////////////////////////////////////
|
||||
#endif // not APSTUDIO_INVOKED
|
||||
|
@ -72,7 +72,7 @@ BEGIN
|
||||
VALUE "FileDescription", "Tesseract command-line OCR engine"
|
||||
VALUE "FileVersion", "@GENERIC_MAJOR_VERSION@,@GENERIC_MINOR_VERSION@,@GENERIC_MICRO_VERSION@,0"
|
||||
VALUE "InternalName", "tesseract"
|
||||
VALUE "LegalCopyright", "Copyright (C) 2016 Google, Inc. Licensed under the Apache License, Version 2.0"
|
||||
VALUE "LegalCopyright", "Copyright (C) 2018 Google, Inc. Licensed under the Apache License, Version 2.0"
|
||||
VALUE "OriginalFilename", "tesseract.exe"
|
||||
VALUE "ProductName", "Tesseract-OCR"
|
||||
VALUE "ProductVersion", "@PACKAGE_VERSION@"
|
||||
|
Loading…
Reference in New Issue
Block a user