Skip to content

Commit

Permalink
Add version details to pkcs11 module and ykhsmauth library files on W…
Browse files Browse the repository at this point in the history
…indows
  • Loading branch information
aveenismail authored Oct 25, 2021
1 parent dfdbbd9 commit 9eb34b3
Show file tree
Hide file tree
Showing 4 changed files with 88 additions and 1 deletion.
6 changes: 5 additions & 1 deletion pkcs11/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ set(
)

if(WIN32)
set(SOURCE ${SOURCE} cmdline.c ../common/time_win.c)
set(SOURCE ${SOURCE} cmdline.c ../common/time_win.c ${CMAKE_CURRENT_BINARY_DIR}/version.rc)
include(${CMAKE_SOURCE_DIR}/cmake/getopt.cmake)
find_getopt()
else(WIN32)
Expand Down Expand Up @@ -85,6 +85,10 @@ target_link_libraries(
${GETOPT_LIBS}
)

if(WIN32)
configure_file(${CMAKE_CURRENT_SOURCE_DIR}/version.rc.in ${CMAKE_CURRENT_BINARY_DIR}/version.rc @ONLY)
endif(WIN32)

install(
TARGETS yubihsm_pkcs11
ARCHIVE DESTINATION "${YUBIHSM_INSTALL_LIB_DIR}/pkcs11"
Expand Down
38 changes: 38 additions & 0 deletions pkcs11/version.rc.in
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@

#include <winresrc.h>

#define VER_FILEVERSION @yubihsm_shell_VERSION_MAJOR@,@yubihsm_shell_VERSION_MINOR@,@yubihsm_shell_VERSION_PATCH@,0
#define VER_FILEVERSION_STR "@yubihsm_shell_VERSION_MAJOR@.@yubihsm_shell_VERSION_MINOR@.@[email protected]"

VS_VERSION_INFO VERSIONINFO
FILEVERSION VER_FILEVERSION
PRODUCTVERSION VER_FILEVERSION
FILEFLAGSMASK 0x3fL
#ifdef _DEBUG
FILEFLAGS 0x1L
#else
FILEFLAGS 0x0L
#endif
FILEOS 0x40004L
FILETYPE 0x2L
FILESUBTYPE 0x0L
BEGIN
BLOCK "StringFileInfo"
BEGIN
BLOCK "040904b0"
BEGIN
VALUE "CompanyName", "Yubico AB"
VALUE "FileDescription", "YubiHSM PKCS11 Module"
VALUE "FileVersion", VER_FILEVERSION_STR
VALUE "InternalName", "yubihsm_pkcs11.dll"
VALUE "LegalCopyright", "\xa9 Yubico AB"
VALUE "OriginalFilename", "yubihsm_pkcs11.dll"
VALUE "ProductName", "YubiHSM"
VALUE "ProductVersion", VER_FILEVERSION_STR
END
END
BLOCK "VarFileInfo"
BEGIN
VALUE "Translation", 0x409, 1200
END
END
7 changes: 7 additions & 0 deletions ykhsmauth/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,10 @@ set (
ykhsmauth.c
)

if(WIN32)
set(SOURCE ${SOURCE} ${CMAKE_CURRENT_BINARY_DIR}/version.rc)
endif(WIN32)

include_directories (
${LIBPCSC_INCLUDEDIR}
)
Expand All @@ -41,6 +45,9 @@ set_target_properties (ykhsmauth_static PROPERTIES COMPILE_FLAGS "-DSTATIC")
target_link_libraries (ykhsmauth_static ${LIBPCSC_LDFLAGS})

configure_file(${CMAKE_CURRENT_SOURCE_DIR}/ykhsmauth.pc.in ${CMAKE_CURRENT_BINARY_DIR}/ykhsmauth.pc @ONLY)
if(WIN32)
configure_file(${CMAKE_CURRENT_SOURCE_DIR}/version.rc.in ${CMAKE_CURRENT_BINARY_DIR}/version.rc @ONLY)
endif(WIN32)

install(
TARGETS ykhsmauth
Expand Down
38 changes: 38 additions & 0 deletions ykhsmauth/version.rc.in
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@

#include <winresrc.h>

#define VER_FILEVERSION @yubihsm_shell_VERSION_MAJOR@,@yubihsm_shell_VERSION_MINOR@,@yubihsm_shell_VERSION_PATCH@,0
#define VER_FILEVERSION_STR "@yubihsm_shell_VERSION_MAJOR@.@yubihsm_shell_VERSION_MINOR@.@[email protected]"

VS_VERSION_INFO VERSIONINFO
FILEVERSION VER_FILEVERSION
PRODUCTVERSION VER_FILEVERSION
FILEFLAGSMASK 0x3fL
#ifdef _DEBUG
FILEFLAGS 0x1L
#else
FILEFLAGS 0x0L
#endif
FILEOS 0x40004L
FILETYPE 0x2L
FILESUBTYPE 0x0L
BEGIN
BLOCK "StringFileInfo"
BEGIN
BLOCK "040904b0"
BEGIN
VALUE "CompanyName", "Yubico AB"
VALUE "FileDescription", "YubiAuth Interface Library"
VALUE "FileVersion", VER_FILEVERSION_STR
VALUE "InternalName", "ykhsmauth.dll"
VALUE "LegalCopyright", "\xa9 Yubico AB"
VALUE "OriginalFilename", "ykhsmauth.dll"
VALUE "ProductName", "YubiHSM"
VALUE "ProductVersion", VER_FILEVERSION_STR
END
END
BLOCK "VarFileInfo"
BEGIN
VALUE "Translation", 0x409, 1200
END
END

0 comments on commit 9eb34b3

Please sign in to comment.