summaryrefslogtreecommitdiffstats
path: root/Source/cmMakefileExecutableTargetGenerator.cxx
diff options
context:
space:
mode:
authorBrad King <brad.king@kitware.com>2006-10-16 22:17:14 (GMT)
committerBrad King <brad.king@kitware.com>2006-10-16 22:17:14 (GMT)
commitb155f3aa1c4bb503557bda801059e0b6a28898cf (patch)
treeab38724144a719aefc05faa830e004f967ade52d /Source/cmMakefileExecutableTargetGenerator.cxx
parent30235517f81ed7ef8ff8e58685e786da472bf0d6 (diff)
downloadCMake-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/cmMakefileExecutableTargetGenerator.cxx')
-rw-r--r--Source/cmMakefileExecutableTargetGenerator.cxx18
1 files changed, 18 insertions, 0 deletions
diff --git a/Source/cmMakefileExecutableTargetGenerator.cxx b/Source/cmMakefileExecutableTargetGenerator.cxx
index 65e2877..4b24a19a 100644
--- a/Source/cmMakefileExecutableTargetGenerator.cxx
+++ b/Source/cmMakefileExecutableTargetGenerator.cxx
@@ -372,6 +372,24 @@ void cmMakefileExecutableTargetGenerator::WriteExecutableRule(bool relink)
vars.Objects = buildObjs.c_str();
vars.Target = targetOutPathReal.c_str();
vars.TargetPDB = targetOutPathPDB.c_str();
+
+ // Setup the target version.
+ std::string targetVersionMajor;
+ std::string targetVersionMinor;
+ {
+ cmOStringStream majorStream;
+ cmOStringStream minorStream;
+ int major;
+ int minor;
+ this->Target->GetTargetVersion(major, minor);
+ majorStream << major;
+ minorStream << minor;
+ targetVersionMajor = majorStream.str();
+ targetVersionMinor = minorStream.str();
+ }
+ vars.TargetVersionMajor = targetVersionMajor.c_str();
+ vars.TargetVersionMinor = targetVersionMinor.c_str();
+
std::string linkString = linklibs.str();
vars.LinkLibraries = linkString.c_str();
vars.Flags = flags.c_str();