How to Generate Windows DLL versioning information with CMake
You could use your CMake variable values in conjunction with a version.rc.in file and the configure_file command. // version.rc.in #define VER_FILEVERSION @MY_PRODUCT_NUMBER@,@MY_PRODUCT_VERSION@,@MY_BUILD_NUMBER@,0 #define VER_FILEVERSION_STR “@MY_PRODUCT_NUMBER@.@MY_PRODUCT_VERSION@.@MY_BUILD_NUMBER@.0\0” #define VER_PRODUCTVERSION @MY_PRODUCT_NUMBER@,@MY_PRODUCT_VERSION@,@MY_BUILD_NUMBER@,0 #define VER_PRODUCTVERSION_STR “@MY_PRODUCT_NUMBER@.@MY_PRODUCT_VERSION@.@MY_BUILD_NUMBER@\0” // // …along with the rest of the file from your “manual methods” reference And then, in your CMakeLists.txt file: # CMakeLists.txt set(MY_PRODUCT_NUMBER 3) … Read more