Skip to content

Commit

Permalink
Merge pull request #1 from ZEISS/jbl/add_versioninfo
Browse files Browse the repository at this point in the history
add resource
  • Loading branch information
ptahmose authored Apr 25, 2024
2 parents b255d6b + 93ac509 commit daed3b5
Show file tree
Hide file tree
Showing 5 changed files with 104 additions and 1 deletion.
10 changes: 9 additions & 1 deletion warpaffine/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,8 @@ set(WARPAFFINE_SRCFILES
"inc_libwarpaffine.h"
"main.cpp"
"warpaffine-longpaths.manifest" # the manifest is needed to allow long paths on windows, see https://docs.microsoft.com/en-us/windows/win32/fileio/maximum-file-path-limitation?tabs=cmd
# CMake will merge the manifest with a linker generated one (and ignore it on non-windows platforms)
# CMake will merge the manifest with a linker generated one (and ignore it on non-Windows platforms)
"warpaffine.rc" # the rc file (containing version information, only relevant for Windows))
)

add_executable(warpaffine ${WARPAFFINE_SRCFILES} $<TARGET_OBJECTS:libwarpaffine>)
Expand Down Expand Up @@ -52,6 +53,13 @@ configure_file (
"${CMAKE_CURRENT_BINARY_DIR}/WarpAffine_Config.h"
)

set(warpaffine_PROJECT_DESCRIPTION ${CMAKE_PROJECT_DESCRIPTION}) # the string given for the project description in the main CMakeLists.txt

configure_file (
"${CMAKE_CURRENT_SOURCE_DIR}/resource_data.h.in"
"${CMAKE_CURRENT_BINARY_DIR}/resource_data.h"
)

# On Windows, we want to copy the tbb-runtime to the destination folder. There is no
# supported way to link it statically, so this DLL needs to be provided with the executable.
IF(WIN32)
Expand Down
18 changes: 18 additions & 0 deletions warpaffine/resource_data.h.in
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
// SPDX-FileCopyrightText: 2024 Carl Zeiss Microscopy GmbH
//
// SPDX-License-Identifier: MIT

#define RC_FILEVERSION_1ST_NUMBER @warpaffine_VERSION_MAJOR@
#define RC_FILEVERSION_2ND_NUMBER @warpaffine_VERSION_MINOR@
#define RC_FILEVERSION_3RD_NUMBER @warpaffine_VERSION_PATCH@
#define RC_FILEVERSION_4TH_NUMBER 0

#define RC_PRODUCTVERSION_1ST_NUMBER @warpaffine_VERSION_MAJOR@
#define RC_PRODUCTVERSION_2ND_NUMBER @warpaffine_VERSION_MINOR@
#define RC_PRODUCTVERSION_3RD_NUMBER @warpaffine_VERSION_PATCH@
#define RC_PRODUCTVERSION_4TH_NUMBER 0

#define RC_FILEVERSION_STRING "@warpaffine_VERSION_MAJOR@.@warpaffine_VERSION_MINOR@.@[email protected]"
#define RC_PRODUCTVERSION_STRING "@warpaffine_VERSION_MAJOR@.@warpaffine_VERSION_MINOR@.@[email protected]"

#define RC_FILEDESCRIPTION_STR "@warpaffine_PROJECT_DESCRIPTION@"
Binary file added warpaffine/warpaffine.ico
Binary file not shown.
3 changes: 3 additions & 0 deletions warpaffine/warpaffine.ico.license
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
SPDX-FileCopyrightText: 2024 Carl Zeiss Microscopy GmbH

SPDX-License-Identifier: MIT
74 changes: 74 additions & 0 deletions warpaffine/warpaffine.rc
Original file line number Diff line number Diff line change
@@ -0,0 +1,74 @@
// SPDX-FileCopyrightText: 2024 Carl Zeiss Microscopy GmbH
//
// SPDX-License-Identifier: MIT

#include <resource_data.h>

#define APSTUDIO_READONLY_SYMBOLS
/////////////////////////////////////////////////////////////////////////////
//
// Generated from the TEXTINCLUDE 2 resource.
//
#include "winres.h"

/////////////////////////////////////////////////////////////////////////////
#undef APSTUDIO_READONLY_SYMBOLS

/////////////////////////////////////////////////////////////////////////////
// English (United States) resources

#if !defined(AFX_RESOURCE_DLL) || defined(AFX_TARG_ENU)
LANGUAGE LANG_ENGLISH, SUBLANG_ENGLISH_US


/////////////////////////////////////////////////////////////////////////////
//
// Version
//

VS_VERSION_INFO VERSIONINFO
FILEVERSION RC_FILEVERSION_1ST_NUMBER, RC_FILEVERSION_2ND_NUMBER, RC_FILEVERSION_3RD_NUMBER, RC_FILEVERSION_4TH_NUMBER
PRODUCTVERSION RC_PRODUCTVERSION_1ST_NUMBER, RC_PRODUCTVERSION_2ND_NUMBER, RC_PRODUCTVERSION_3RD_NUMBER, RC_PRODUCTVERSION_4TH_NUMBER
FILEFLAGSMASK 0x3fL
#ifdef _DEBUG
FILEFLAGS 0x1L
#else
FILEFLAGS 0x0L
#endif
FILEOS 0x40004L
FILETYPE 0x0L
FILESUBTYPE 0x0L
BEGIN
BLOCK "StringFileInfo"
BEGIN
BLOCK "0c0004b0"
BEGIN
VALUE "CompanyName", "Carl Zeiss Microscopy GmbH"
VALUE "FileDescription", RC_FILEDESCRIPTION_STR
VALUE "FileVersion", RC_FILEVERSION_STRING
VALUE "InternalName", "warpaffine.exe"
VALUE "LegalCopyright", "Copyright (C) 2024"
VALUE "OriginalFilename", "warpaffine.exe"
VALUE "ProductName", "warpaffine - an experimental implementation of Deskew operation"
VALUE "ProductVersion", RC_PRODUCTVERSION_STRING
END
END
BLOCK "VarFileInfo"
BEGIN
VALUE "Translation", 0xc00, 1200
END
END


/////////////////////////////////////////////////////////////////////////////
//
// Icon
//

// Icon with lowest ID value placed first to ensure application icon
// remains consistent on all systems.
IDI_APPLICATION_ICON ICON "warpaffine.ico"

#endif // English (United States) resources
/////////////////////////////////////////////////////////////////////////////

0 comments on commit daed3b5

Please sign in to comment.