mirror of
https://github.com/Kitware/CMake.git
synced 2026-05-01 03:29:18 -05:00
ENH: Adding image version number (major.minor) property to windows binaries. Default is 0.0, but the VERSION target property may change the value. Windows now has first-class support for dll and exe versioning. This addresses bug#1219.
This commit is contained in:
@@ -1131,6 +1131,20 @@ void cmLocalVisualStudio6Generator
|
||||
}
|
||||
}
|
||||
|
||||
// Compute version number information.
|
||||
std::string targetVersionFlag;
|
||||
if(target.GetType() == cmTarget::EXECUTABLE ||
|
||||
target.GetType() == cmTarget::SHARED_LIBRARY ||
|
||||
target.GetType() == cmTarget::MODULE_LIBRARY)
|
||||
{
|
||||
int major;
|
||||
int minor;
|
||||
target.GetTargetVersion(major, minor);
|
||||
cmOStringStream targetVersionStream;
|
||||
targetVersionStream << "/version:" << major << "." << minor;
|
||||
targetVersionFlag = targetVersionStream.str();
|
||||
}
|
||||
|
||||
// Compute the real name of the target.
|
||||
std::string outputName =
|
||||
"(OUTPUT_NAME is for libraries and executables only)";
|
||||
@@ -1279,6 +1293,8 @@ void cmLocalVisualStudio6Generator
|
||||
|
||||
cmSystemTools::ReplaceString(line, "BUILD_INCLUDES",
|
||||
this->IncludeOptions.c_str());
|
||||
cmSystemTools::ReplaceString(line, "TARGET_VERSION_FLAG",
|
||||
targetVersionFlag.c_str());
|
||||
cmSystemTools::ReplaceString(line, "OUTPUT_LIBNAME",libName);
|
||||
// because LIBRARY_OUTPUT_PATH and EXECUTABLE_OUTPUT_PATH
|
||||
// are already quoted in the template file,
|
||||
|
||||
Reference in New Issue
Block a user