diff options
author | Brad King <brad.king@kitware.com> | 2006-10-16 22:17:14 (GMT) |
---|---|---|
committer | Brad King <brad.king@kitware.com> | 2006-10-16 22:17:14 (GMT) |
commit | b155f3aa1c4bb503557bda801059e0b6a28898cf (patch) | |
tree | ab38724144a719aefc05faa830e004f967ade52d /Source/cmLocalVisualStudio6Generator.cxx | |
parent | 30235517f81ed7ef8ff8e58685e786da472bf0d6 (diff) | |
download | CMake-b155f3aa1c4bb503557bda801059e0b6a28898cf.zip CMake-b155f3aa1c4bb503557bda801059e0b6a28898cf.tar.gz CMake-b155f3aa1c4bb503557bda801059e0b6a28898cf.tar.bz2 |
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.
Diffstat (limited to 'Source/cmLocalVisualStudio6Generator.cxx')
-rw-r--r-- | Source/cmLocalVisualStudio6Generator.cxx | 16 |
1 files changed, 16 insertions, 0 deletions
diff --git a/Source/cmLocalVisualStudio6Generator.cxx b/Source/cmLocalVisualStudio6Generator.cxx index 4295ce8..a24b14b 100644 --- a/Source/cmLocalVisualStudio6Generator.cxx +++ b/Source/cmLocalVisualStudio6Generator.cxx @@ -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, |