From 3f711b89588f5fe7f62915ea0079788d1c1ffd5e Mon Sep 17 00:00:00 2001 From: Marek Roszko Date: Tue, 28 Dec 2021 23:54:27 -0500 Subject: [PATCH] Add win32 VERSION_INFO resource blocks for the DLLs --- bitmap2component/CMakeLists.txt | 12 +++++---- cvpcb/CMakeLists.txt | 14 +++++----- eeschema/CMakeLists.txt | 17 +++++++----- gerbview/CMakeLists.txt | 16 ++++++++---- kicad/CMakeLists.txt | 12 +++++---- pagelayout_editor/CMakeLists.txt | 17 +++++++----- pcb_calculator/CMakeLists.txt | 17 ++++++++---- pcbnew/CMakeLists.txt | 17 +++++++----- resources/msw/cvpcb-dll.rc | 5 ++++ resources/msw/cvpcb.rc | 3 --- resources/msw/eeschema-dll.rc | 4 +++ resources/msw/gerbview-dll.rc | 4 +++ resources/msw/kiwin32-dll.rc | 40 +++++++++++++++++++++++++++++ resources/msw/pcb_calculator-dll.rc | 4 +++ resources/msw/pcbnew-dll.rc | 4 +++ resources/msw/pl_editor-dll.rc | 4 +++ 16 files changed, 143 insertions(+), 47 deletions(-) create mode 100644 resources/msw/cvpcb-dll.rc delete mode 100644 resources/msw/cvpcb.rc create mode 100644 resources/msw/eeschema-dll.rc create mode 100644 resources/msw/gerbview-dll.rc create mode 100644 resources/msw/kiwin32-dll.rc create mode 100644 resources/msw/pcb_calculator-dll.rc create mode 100644 resources/msw/pcbnew-dll.rc create mode 100644 resources/msw/pl_editor-dll.rc diff --git a/bitmap2component/CMakeLists.txt b/bitmap2component/CMakeLists.txt index 6abea125b2..3b45e9d348 100644 --- a/bitmap2component/CMakeLists.txt +++ b/bitmap2component/CMakeLists.txt @@ -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 ) diff --git a/cvpcb/CMakeLists.txt b/cvpcb/CMakeLists.txt index a98f64af98..eb68a4f6a4 100644 --- a/cvpcb/CMakeLists.txt +++ b/cvpcb/CMakeLists.txt @@ -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 diff --git a/eeschema/CMakeLists.txt b/eeschema/CMakeLists.txt index 380467a017..3b10742688 100644 --- a/eeschema/CMakeLists.txt +++ b/eeschema/CMakeLists.txt @@ -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 diff --git a/gerbview/CMakeLists.txt b/gerbview/CMakeLists.txt index e1e0c987ab..9c68ab4c0d 100644 --- a/gerbview/CMakeLists.txt +++ b/gerbview/CMakeLists.txt @@ -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 diff --git a/kicad/CMakeLists.txt b/kicad/CMakeLists.txt index ec1d89c243..04edf80fb3 100644 --- a/kicad/CMakeLists.txt +++ b/kicad/CMakeLists.txt @@ -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 ) diff --git a/pagelayout_editor/CMakeLists.txt b/pagelayout_editor/CMakeLists.txt index 24e5245989..b3c940aabb 100644 --- a/pagelayout_editor/CMakeLists.txt +++ b/pagelayout_editor/CMakeLists.txt @@ -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 diff --git a/pcb_calculator/CMakeLists.txt b/pcb_calculator/CMakeLists.txt index caabda4846..2069c9e835 100644 --- a/pcb_calculator/CMakeLists.txt +++ b/pcb_calculator/CMakeLists.txt @@ -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 diff --git a/pcbnew/CMakeLists.txt b/pcbnew/CMakeLists.txt index 1ac3a4b688..b58cc1ecb5 100644 --- a/pcbnew/CMakeLists.txt +++ b/pcbnew/CMakeLists.txt @@ -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 diff --git a/resources/msw/cvpcb-dll.rc b/resources/msw/cvpcb-dll.rc new file mode 100644 index 0000000000..0d4f6053f2 --- /dev/null +++ b/resources/msw/cvpcb-dll.rc @@ -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" diff --git a/resources/msw/cvpcb.rc b/resources/msw/cvpcb.rc deleted file mode 100644 index ffb4fa77b8..0000000000 --- a/resources/msw/cvpcb.rc +++ /dev/null @@ -1,3 +0,0 @@ -icon_cvpcb ICON "../bitmaps_png/icons/icon_cvpcb.ico" - -#include "kiwin32.rc" diff --git a/resources/msw/eeschema-dll.rc b/resources/msw/eeschema-dll.rc new file mode 100644 index 0000000000..2f45bb269e --- /dev/null +++ b/resources/msw/eeschema-dll.rc @@ -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" diff --git a/resources/msw/gerbview-dll.rc b/resources/msw/gerbview-dll.rc new file mode 100644 index 0000000000..3d0f6503cd --- /dev/null +++ b/resources/msw/gerbview-dll.rc @@ -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" diff --git a/resources/msw/kiwin32-dll.rc b/resources/msw/kiwin32-dll.rc new file mode 100644 index 0000000000..94df28dad9 --- /dev/null +++ b/resources/msw/kiwin32-dll.rc @@ -0,0 +1,40 @@ +#include // defines VS_VERSION_INFO +#include + +#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 diff --git a/resources/msw/pcb_calculator-dll.rc b/resources/msw/pcb_calculator-dll.rc new file mode 100644 index 0000000000..d9a3f9b811 --- /dev/null +++ b/resources/msw/pcb_calculator-dll.rc @@ -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" diff --git a/resources/msw/pcbnew-dll.rc b/resources/msw/pcbnew-dll.rc new file mode 100644 index 0000000000..932ecfea69 --- /dev/null +++ b/resources/msw/pcbnew-dll.rc @@ -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" \ No newline at end of file diff --git a/resources/msw/pl_editor-dll.rc b/resources/msw/pl_editor-dll.rc new file mode 100644 index 0000000000..d84cef94e4 --- /dev/null +++ b/resources/msw/pl_editor-dll.rc @@ -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"