summaryrefslogtreecommitdiff
path: root/CMake/Modules/generate_version_info.cmake
diff options
context:
space:
mode:
Diffstat (limited to 'CMake/Modules/generate_version_info.cmake')
-rw-r--r--CMake/Modules/generate_version_info.cmake8
1 files changed, 5 insertions, 3 deletions
diff --git a/CMake/Modules/generate_version_info.cmake b/CMake/Modules/generate_version_info.cmake
index b746aaba..e309ef51 100644
--- a/CMake/Modules/generate_version_info.cmake
+++ b/CMake/Modules/generate_version_info.cmake
@@ -115,7 +115,7 @@ function(generate_version_info outfiles)
endif()
endif()
- if (NOT PROJECT_VERSION_REVISION AND BUILD_TYPE_REVISION)
+ if (NOT PRODUCT_VERSION_REVISION AND BUILD_TYPE_REVISION)
set (PRODUCT_VERSION_REVISION ${BUILD_TYPE_REVISION})
endif ()
@@ -167,14 +167,16 @@ set_source_files_properties("${CMAKE_BINARY_DIR}/${_VersionInfoFile}" PROPERTIES
# generate_version_info.cmake
if(WIN32)
- # Emit a short, unambiguous name in the current target's binary dir
- set(_RC_SHORT "wsprd.rc")
+ set(_RC_SHORT "${PRODUCT_NAME}.rc")
configure_file(
${_THIS_MODULE_BASE_DIR}/VersionResource.rc.in
${CMAKE_CURRENT_BINARY_DIR}/${_RC_SHORT}
@ONLY
)
file(TO_CMAKE_PATH "${CMAKE_CURRENT_BINARY_DIR}/${_RC_SHORT}" _RC_FWD)
+ # windres doesn't track the ICON directive configure_file wrote into this .rc as a dependency, so an icon-only edit needs this to trigger a rebuild.
+ get_filename_component(_PRODUCT_ICON_ABS "${PRODUCT_ICON}" ABSOLUTE BASE_DIR "${CMAKE_SOURCE_DIR}")
+ set_source_files_properties("${_RC_FWD}" PROPERTIES OBJECT_DEPENDS "${_PRODUCT_ICON_ABS}")
set(${outfiles} "${_RC_FWD}" PARENT_SCOPE)
else()
set(${outfiles} "" PARENT_SCOPE)