Add Windows version resource

This commit is contained in:
Marius Greuel 2021-12-20 17:51:44 +01:00
parent fbdb6a98c0
commit e4ebfe420c
2 changed files with 97 additions and 0 deletions

View File

@ -184,6 +184,7 @@ endif()
if(WIN32) if(WIN32)
set(HAVE_LIBWS2_32 1) set(HAVE_LIBWS2_32 1)
set(EXTRA_WINDOWS_SOURCES "${PROJECT_BINARY_DIR}/windows.rc")
set(EXTRA_WINDOWS_LIBRARIES setupapi ws2_32) set(EXTRA_WINDOWS_LIBRARIES setupapi ws2_32)
add_compile_definitions(WIN32NATIVE=1) add_compile_definitions(WIN32NATIVE=1)
endif() endif()
@ -320,6 +321,9 @@ message(STATUS "----------------------")
configure_file(cmake_config.h.in ac_cfg.h) configure_file(cmake_config.h.in ac_cfg.h)
configure_file(avrdude.conf.in avrdude.conf) configure_file(avrdude.conf.in avrdude.conf)
configure_file(avrdude.spec.in avrdude.spec) configure_file(avrdude.spec.in avrdude.spec)
if(WIN32)
configure_file(windows.rc.in windows.rc)
endif()
# ===================================== # =====================================
# Project # Project
@ -445,6 +449,7 @@ add_executable(avrdude
main.c main.c
term.c term.c
term.h term.h
"${EXTRA_WINDOWS_SOURCES}"
) )
target_link_libraries(avrdude PUBLIC libavrdude) target_link_libraries(avrdude PUBLIC libavrdude)

92
src/windows.rc.in Normal file
View File

@ -0,0 +1,92 @@
//
// avrdude - A Downloader / Uploader for AVR device programmers
// Copyright(C) 2021 Marius Greuel
//
// This program is free software; you can redistribute itand /or modify
// it under the terms of the GNU General Public License as published by
// the Free Software Foundation; either version 2 of the License, or
// (at your option) any later version.
//
// This program is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.See the
// GNU General Public License for more details.
//
// You should have received a copy of the GNU General Public License
// along with this program.If not, see < http://www.gnu.org/licenses/>.
//
#include "winres.h"
#pragma code_page(1252)
LANGUAGE LANG_ENGLISH, SUBLANG_ENGLISH_US
STRINGTABLE
BEGIN
100 "AVRDUDE"
END
#define VER_MAJOR @PROJECT_VERSION_MAJOR@
#define VER_MINOR @PROJECT_VERSION_MINOR@
#define VER_BUILD @PROJECT_VERSION_PATCH@
#define VER_REVISION @PROJECT_VERSION_TWEAK@
#define _STR(s) #s
#define _VER_STR(a, b, c, d) _STR(a) "." _STR(b) "." _STR(c) "." _STR(d)
#define VER_FILEVERSION VER_MAJOR,VER_MINOR,VER_BUILD,VER_REVISION
#define VER_FILEVERSION_STR _VER_STR(VER_MAJOR, VER_MINOR, VER_BUILD, VER_REVISION)
#define VER_PRODUCTVERSION VER_FILEVERSION
#define VER_PRODUCTVERSION_STR VER_FILEVERSION_STR
#define VER_COMPANYNAME_STR "The AVRDUDE authors"
#define VER_FILEDESCRIPTION_STR "AVRDUDE"
#define VER_PRODUCTNAME_STR "AVRDUDE"
#define VER_INTERNALNAME_STR "avrdude.exe"
#define VER_LEGALCOPYRIGHT_STR "\251 2021 The AVRDUDE authors"
#define VER_ORIGINALFILENAME_STR VER_INTERNALNAME_STR
#define VER_COMMENTS_STR "https://github.com/avrdudes/avrdude"
#define VER_FILETYPE VFT_APP
#define VER_FILESUBTYPE 0
#ifdef DEBUG
#define VER_DEBUG VS_FF_DEBUG
#else
#define VER_DEBUG 0
#endif
#define VER_FILEFLAGSMASK VS_FFI_FILEFLAGSMASK
#define VER_FILEOS VOS__WINDOWS32
#define VER_FILEFLAGS (VER_DEBUG)
VS_VERSION_INFO VERSIONINFO
FILEVERSION VER_FILEVERSION
PRODUCTVERSION VER_PRODUCTVERSION
FILEFLAGSMASK VER_FILEFLAGSMASK
FILEFLAGS VER_FILEFLAGS
FILEOS VER_FILEOS
FILETYPE VER_FILETYPE
FILESUBTYPE VER_FILESUBTYPE
BEGIN
BLOCK "StringFileInfo"
BEGIN
BLOCK "040904b0" // LANG_ENGLISH/SUBLANG_ENGLISH_US, Unicode CP
BEGIN
#ifdef VER_COMMENTS_STR
VALUE "Comments", VER_COMMENTS_STR
#endif
VALUE "CompanyName", VER_COMPANYNAME_STR
VALUE "FileDescription", VER_FILEDESCRIPTION_STR
VALUE "FileVersion", VER_FILEVERSION_STR
VALUE "InternalName", VER_INTERNALNAME_STR
VALUE "LegalCopyright", VER_LEGALCOPYRIGHT_STR
VALUE "OriginalFilename", VER_ORIGINALFILENAME_STR
VALUE "ProductName", VER_PRODUCTNAME_STR
VALUE "ProductVersion", VER_PRODUCTVERSION_STR
END
END
BLOCK "VarFileInfo"
BEGIN
VALUE "Translation", 0x0409, 1200 //LANG_ENGLISH/SUBLANG_ENGLISH_US, Unicode CP
END
END