Skip to content

Commit

Permalink
Merge pull request #232 from gdt050579/230-add-version-details-to-bin…
Browse files Browse the repository at this point in the history
…aries-starting-with-windows-binaries

Added initial variant for resource file GView and GViewCore #230
  • Loading branch information
rzaharia authored Feb 28, 2024
2 parents 31db0e6 + 573a67d commit 5279628
Show file tree
Hide file tree
Showing 5 changed files with 47 additions and 0 deletions.
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -14,3 +14,4 @@ vcpkg_installed/
.DS_Store
*.db
CMakeUserPresets.json
cmake/windows.rc
6 changes: 6 additions & 0 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,12 @@ string(REGEX MATCH "#define GVIEW_VERSION \"([0-9]+.[0-9]+.[0-9]+)\"" _ ${GView_
set(GVIEW_VERSION ${CMAKE_MATCH_1})
message("${PROJECT_NAME} version: ${GVIEW_VERSION}")

if (MSVC)
set(GVIEW_RESOURCE_FILES "${CMAKE_CURRENT_SOURCE_DIR}/cmake/windows.rc")
message("Setting version to ${GVIEW_RESOURCE_FILES}")
configure_file("cmake/windows.rc.in" ${GVIEW_RESOURCE_FILES} @ONLY)
endif()

set(CMAKE_MODULE_PATH "${CMAKE_MODULE_PATH};${CMAKE_CURRENT_SOURCE_DIR}/cmake")
include(core_testing)

Expand Down
5 changes: 5 additions & 0 deletions GView/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -32,3 +32,8 @@ if (APPLE)
RUNTIME_OUTPUT_DIRECTORY_RELEASE "${CMAKE_BINARY_DIR}/../bin/${CMAKE_BUILD_TYPE}")
endif()
endif()

if(DEFINED GVIEW_RESOURCE_FILES)
message("Adding resource files to project: ${PROJECT_NAME}")
target_sources(${PROJECT_NAME} PRIVATE ${GVIEW_RESOURCE_FILES})
endif()
5 changes: 5 additions & 0 deletions GViewCore/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -125,3 +125,8 @@ if (APPLE)
RUNTIME_OUTPUT_DIRECTORY_RELEASE "${CMAKE_BINARY_DIR}/../bin/${CMAKE_BUILD_TYPE}")
endif()
endif()

if(DEFINED GVIEW_RESOURCE_FILES)
message("Adding resource files to project: ${PROJECT_NAME}")
target_sources(${PROJECT_NAME} PRIVATE ${GVIEW_RESOURCE_FILES})
endif()
30 changes: 30 additions & 0 deletions cmake/windows.rc.in
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
VS_VERSION_INFO VERSIONINFO
FILEVERSION 0,0,0,0
PRODUCTVERSION 0,0,0,0
FILEFLAGSMASK 0x3fL
#ifdef _DEBUG
FILEFLAGS 0x1L
#else
FILEFLAGS 0x0L
#endif
FILEOS 0x40004L
FILETYPE 0x2L
FILESUBTYPE 0x0L
{
BLOCK "StringFileInfo"
{
BLOCK "040904E4"
{
VALUE "CompanyName", "GView Group (2021-2024)"
VALUE "FileDescription", "GView Framework library"
VALUE "FileVersion", "@GVIEW_VERSION@"
VALUE "ProductVersion", "@GVIEW_VERSION@"
VALUE "LegalCopyright", "Copyright various authors. Released under the MIT License."
VALUE "ProductName", "GView"
}
}
BLOCK "VarFileInfo"
{
VALUE "Translation", 0x0409, 1252
}
}

0 comments on commit 5279628

Please sign in to comment.