Add win32 VERSION_INFO resource blocks for the DLLs

This commit is contained in:
Marek Roszko 2021-12-28 23:54:27 -05:00
parent 426f6dd485
commit 3f711b8958
16 changed files with 143 additions and 47 deletions

View File

@ -26,11 +26,13 @@ set_source_files_properties( bitmap2cmp_gui.cpp PROPERTIES
COMPILE_DEFINITIONS "COMPILING_DLL"
)
if( MINGW )
# BITMAP2COMPONENT_RESOURCES variable is set by the macro.
mingw_resource_compiler( bitmap2component )
else()
set( BITMAP2COMPONENT_RESOURCES ${CMAKE_SOURCE_DIR}/resources/msw/bitmap2component.rc )
if( WIN32 )
if( MINGW )
# BITMAP2COMPONENT_RESOURCES variable is set by the macro.
mingw_resource_compiler( bitmap2component )
else()
set( BITMAP2COMPONENT_RESOURCES ${CMAKE_SOURCE_DIR}/resources/msw/bitmap2component.rc )
endif()
endif()
if( APPLE )

View File

@ -46,12 +46,13 @@ set( CVPCB_SRCS
tools/cvpcb_fpviewer_selection_tool.cpp
)
if( MINGW )
# CVPCB_RESOURCES variable is set by the macro.
mingw_resource_compiler( cvpcb )
else()
set( CVPCB_RESOURCES ${CMAKE_SOURCE_DIR}/resources/msw/cvpcb.rc )
if( WIN32 )
if( MINGW )
# CVPCB_RESOURCES variable is set by the macro.
mingw_resource_compiler( cvpcb-dll )
else()
set( CVPCB_RESOURCES ${CMAKE_SOURCE_DIR}/resources/msw/cvpcb-dll.rc )
endif()
endif()
@ -60,6 +61,7 @@ add_library( cvpcb_kiface MODULE
cvpcb.cpp
${CVPCB_SRCS}
${CVPCB_DIALOGS}
${CVPCB_RESOURCES}
)
set_target_properties( cvpcb_kiface PROPERTIES

View File

@ -305,12 +305,13 @@ if( KICAD_SPICE )
)
endif()
if( MINGW )
# EESCHEMA_RESOURCES variable is set by the macro.
mingw_resource_compiler( eeschema )
else()
set( EESCHEMA_RESOURCES ${CMAKE_SOURCE_DIR}/resources/msw/eeschema.rc )
if( WIN32 )
if( MINGW )
# EESCHEMA_RESOURCES variable is set by the macro.
mingw_resource_compiler( eeschema )
else()
set( EESCHEMA_RESOURCES ${CMAKE_SOURCE_DIR}/resources/msw/eeschema.rc )
endif()
endif()
# Create a C++ compilable string initializer containing markdown text into a *.h file:
@ -487,6 +488,10 @@ if( APPLE )
DESTINATION "${OSX_BUNDLE_INSTALL_PLUGIN_DIR}/sim" )
endif()
else()
if( MSVC )
target_sources( eeschema_kiface PRIVATE ${CMAKE_SOURCE_DIR}/resources/msw/eeschema-dll.rc )
endif()
install( TARGETS eeschema
DESTINATION ${KICAD_BIN}
COMPONENT binary

View File

@ -80,11 +80,13 @@ set( GERBVIEW_EXTRA_SRCS
${CMAKE_SOURCE_DIR}/common/page_info.cpp
)
if( MINGW )
# GERBVIEW_RESOURCES variable is set by the macro.
mingw_resource_compiler( gerbview )
else()
set( GERBVIEW_RESOURCES ${CMAKE_SOURCE_DIR}/resources/msw/gerbview.rc )
if( WIN32 )
if( MINGW )
# GERBVIEW_RESOURCES variable is set by the macro.
mingw_resource_compiler( gerbview )
else()
set( GERBVIEW_RESOURCES ${CMAKE_SOURCE_DIR}/resources/msw/gerbview.rc )
endif()
endif()
if( APPLE )
@ -203,6 +205,10 @@ if( APPLE )
" COMPONENT Runtime
)
else()
if( MSVC )
target_sources( gerbview_kiface PRIVATE ${CMAKE_SOURCE_DIR}/resources/msw/gerbview-dll.rc )
endif()
install( TARGETS gerbview
DESTINATION ${KICAD_BIN}
COMPONENT binary

View File

@ -38,11 +38,13 @@ set( KICAD_SRCS
tools/kicad_manager_control.cpp
)
if( MINGW )
# KICAD_RESOURCES variable is set by the macro.
mingw_resource_compiler( kicad )
else()
set( KICAD_RESOURCES ${CMAKE_SOURCE_DIR}/resources/msw/kicad.rc )
if( WIN32 )
if( MINGW )
# KICAD_RESOURCES variable is set by the macro.
mingw_resource_compiler( kicad )
else()
set( KICAD_RESOURCES ${CMAKE_SOURCE_DIR}/resources/msw/kicad.rc )
endif()
endif()
if( APPLE )

View File

@ -52,12 +52,13 @@ set( PL_EDITOR_EXTRA_SRCS
${CMAKE_SOURCE_DIR}/common/page_info.cpp
)
if( MINGW )
# PL_EDITOR_RESOURCES variable is set by the macro.
mingw_resource_compiler( pl_editor )
else()
set( PL_EDITOR_RESOURCES ${CMAKE_SOURCE_DIR}/resources/msw/pl_editor.rc )
if( WIN32 )
if( MINGW )
# PL_EDITOR_RESOURCES variable is set by the macro.
mingw_resource_compiler( pl_editor )
else()
set( PL_EDITOR_RESOURCES ${CMAKE_SOURCE_DIR}/resources/msw/pl_editor.rc )
endif()
endif()
@ -158,6 +159,10 @@ if( APPLE )
" COMPONENT Runtime
)
else()
if( MSVC )
target_sources( pl_editor_kiface PRIVATE ${CMAKE_SOURCE_DIR}/resources/msw/pl_editor-dll.rc )
endif()
install( TARGETS pl_editor
DESTINATION ${KICAD_BIN}
COMPONENT binary

View File

@ -49,11 +49,13 @@ set( PCB_CALCULATOR_SRCS
../common/env_vars.cpp # needed on MSW to avoid a link issue (a symbol not found)
)
if( MINGW )
# PCB_CALCULATOR_RESOURCES variable is set by the macro.
mingw_resource_compiler( pcb_calculator )
else()
set( PCB_CALCULATOR_RESOURCES ${CMAKE_SOURCE_DIR}/resources/msw/pcb_calculator.rc )
if( WIN32 )
if( MINGW )
# PCB_CALCULATOR_RESOURCES variable is set by the macro.
mingw_resource_compiler( pcb_calculator )
else()
set( PCB_CALCULATOR_RESOURCES ${CMAKE_SOURCE_DIR}/resources/msw/pcb_calculator.rc )
endif()
endif()
if( APPLE )
@ -92,6 +94,7 @@ add_library( pcb_calculator_kiface MODULE
pcb_calculator.cpp
${PCB_CALCULATOR_SRCS}
)
set_target_properties( pcb_calculator_kiface PROPERTIES
OUTPUT_NAME pcb_calculator
PREFIX ${KIFACE_PREFIX}
@ -145,6 +148,10 @@ if( APPLE )
" COMPONENT Runtime
)
else()
if( MSVC )
target_sources( pcb_calculator_kiface PRIVATE ${CMAKE_SOURCE_DIR}/resources/msw/pcb_calculator-dll.rc )
endif()
install( TARGETS pcb_calculator
DESTINATION ${KICAD_BIN}
COMPONENT binary

View File

@ -554,12 +554,13 @@ if( DOXYGEN_FOUND )
)
endif()
if( MINGW )
# PCBNEW_RESOURCES variable is set by the macro.
mingw_resource_compiler( pcbnew )
else()
set( PCBNEW_RESOURCES ${CMAKE_SOURCE_DIR}/resources/msw/pcbnew.rc )
if( WIN32 )
if( MINGW )
# PCBNEW_RESOURCES variable is set by the macro.
mingw_resource_compiler( pcbnew )
else()
set( PCBNEW_RESOURCES ${CMAKE_SOURCE_DIR}/resources/msw/pcbnew.rc )
endif()
endif()
@ -773,6 +774,10 @@ if( APPLE )
" COMPONENT Runtime
)
else()
if( MSVC )
target_sources( pcbnew_kiface PRIVATE ${CMAKE_SOURCE_DIR}/resources/msw/pcbnew-dll.rc )
endif()
install( TARGETS pcbnew
DESTINATION ${KICAD_BIN}
COMPONENT binary

View File

@ -0,0 +1,5 @@
#define RC_VER_FILE_DESCRIPTION "KiCad Dynamic Link Library " KICAD_WIN32_RC_PRODVER_STR
#define RC_VER_INTERNALNAME "_cvpcb"
#define RC_VER_ORIGINALFILENAME "_cvpcb.kiface"
#include "kiwin32-dll.rc"

View File

@ -1,3 +0,0 @@
icon_cvpcb ICON "../bitmaps_png/icons/icon_cvpcb.ico"
#include "kiwin32.rc"

View File

@ -0,0 +1,4 @@
#define RC_VER_FILE_DESCRIPTION "KiCad Schematic Editor " KICAD_WIN32_RC_PRODVER_STR
#define RC_VER_INTERNALNAME "_eeschema"
#define RC_VER_ORIGINALFILENAME "_eeschema.kiface"
#include "kiwin32-dll.rc"

View File

@ -0,0 +1,4 @@
#define RC_VER_FILE_DESCRIPTION "KiCad Gerber Viewer " KICAD_WIN32_RC_PRODVER_STR
#define RC_VER_INTERNALNAME "_gerbview"
#define RC_VER_ORIGINALFILENAME "_gerbview.kiface"
#include "kiwin32-dll.rc"

View File

@ -0,0 +1,40 @@
#include <winver.h> // defines VS_VERSION_INFO
#include <kicad_build_version.h>
#ifndef DEBUG
#define VER_DEBUG 0
#else
#define VER_DEBUG VS_FF_DEBUG
#endif
VS_VERSION_INFO VERSIONINFO
FILEVERSION KICAD_WIN32_RC_FILEVER
PRODUCTVERSION KICAD_WIN32_RC_PRODVER
FILEFLAGSMASK VS_FFI_FILEFLAGSMASK
FILEFLAGS (VER_DEBUG)
FILEOS VOS__WINDOWS32
FILETYPE VFT_DLL
FILESUBTYPE 0x0L
BEGIN
BLOCK "StringFileInfo"
BEGIN
BLOCK "040904E4"
BEGIN
// this gets dispalyed in the windows 10 task manager
VALUE "FileDescription", RC_VER_FILE_DESCRIPTION
VALUE "FileVersion", KICAD_WIN32_RC_FILEVER_STR
//original filename without extension
VALUE "InternalName", RC_VER_INTERNALNAME
VALUE "LegalCopyright", "Copyright (C) 2021 KiCad Developers"
// the exe name
VALUE "OriginalFilename", RC_VER_ORIGINALFILENAME
// name of distributed package
VALUE "ProductName", "KiCad EDA"
VALUE "ProductVersion", KICAD_WIN32_RC_PRODVER_STR
END
END
BLOCK "VarFileInfo"
BEGIN
VALUE "Translation", 0x409, 1252
END
END

View File

@ -0,0 +1,4 @@
#define RC_VER_FILE_DESCRIPTION "KiCad PCB Calculator " KICAD_WIN32_RC_PRODVER_STR
#define RC_VER_INTERNALNAME "_pcb_calculator"
#define RC_VER_ORIGINALFILENAME "_pcb_calculator.kiface"
#include "kiwin32-dll.rc"

View File

@ -0,0 +1,4 @@
#define RC_VER_FILE_DESCRIPTION "KiCad PCB Editor " KICAD_WIN32_RC_PRODVER_STR
#define RC_VER_INTERNALNAME "_pcbnew"
#define RC_VER_ORIGINALFILENAME "_pcbnew.kiface"
#include "kiwin32-dll.rc"

View File

@ -0,0 +1,4 @@
#define RC_VER_FILE_DESCRIPTION "KiCad Drawing Sheet Editor " KICAD_WIN32_RC_PRODVER_STR
#define RC_VER_INTERNALNAME "_pl_editor"
#define RC_VER_ORIGINALFILENAME "_pl_editor.kiface"
#include "kiwin32-dll.rc"