MantisBT - CMake
View Issue Details
0014499CMakeCMakepublic2013-10-21 07:542014-03-05 09:58
mar-na 
Brad King 
normalminoralways
closedfixed 
CMake 2.8.12 
CMake 3.0CMake 3.0 
0014499: Add support for .NET target framework version for VS 2008
I want set the .net target framework for a managed C++ project. I use VS 2008 but cmake currently support the target property VS_DOTNET_TARGET_FRAMEWORK_VERSION only for VS 2010.
No tags attached.
related to 0014216closed Brad King Add support for .NET target framework version 
patch set-target-framework-version-vs2008.patch (2,188) 2013-10-21 07:58
https://public.kitware.com/Bug/file/4913/set-target-framework-version-vs2008.patch
patch 0001-VS-Set-.NET-target-framework-version-for-VS-7-9-1449.patch (1,372) 2013-10-21 09:39
https://public.kitware.com/Bug/file/4914/0001-VS-Set-.NET-target-framework-version-for-VS-7-9-1449.patch
Issue History
2013-10-21 07:54mar-naNew Issue
2013-10-21 07:58mar-naFile Added: set-target-framework-version-vs2008.patch
2013-10-21 07:59mar-naNote Added: 0034179
2013-10-21 08:56Brad KingRelationship addedrelated to 0014216
2013-10-21 09:34Brad KingNote Added: 0034184
2013-10-21 09:39Brad KingFile Added: 0001-VS-Set-.NET-target-framework-version-for-VS-7-9-1449.patch
2013-10-21 09:39Brad KingNote Added: 0034185
2013-10-21 10:34mar-naNote Added: 0034195
2013-10-21 10:39Brad KingNote Added: 0034198
2013-10-21 10:39Brad KingAssigned To => Brad King
2013-10-21 10:39Brad KingStatusnew => resolved
2013-10-21 10:39Brad KingResolutionopen => fixed
2013-10-21 10:39Brad KingFixed in Version => CMake 3.0
2013-10-21 10:39Brad KingTarget Version => CMake 3.0
2014-03-05 09:58Robert MaynardNote Added: 0035292
2014-03-05 09:58Robert MaynardStatusresolved => closed

Notes
(0034179)
mar-na   
2013-10-21 07:59   
added patch

It does the same as for VS 2010. Issue 0014216
(0034184)
Brad King   
2013-10-21 09:34   
The patch appears to close the element attribute list with ">" twice if the framework version property is set. Why not simply:
diff --git a/Source/cmLocalVisualStudio7Generator.cxx b/Source/cmLocalVisualStudio7Generator.cxx
index f21abc3..30c3d73 100644
--- a/Source/cmLocalVisualStudio7Generator.cxx
+++ b/Source/cmLocalVisualStudio7Generator.cxx
@@ -2050,6 +2050,11 @@ cmLocalVisualStudio7Generator::WriteProjectStart(std::ostream& fout,
     fout << "\tProjectGUID=\"{" << gg->GetGUID(libName) << "}\"\n";
     
}
   this->WriteProjectSCC(fout, target);
+  if(const char* targetFrameworkVersion =
+     target.GetProperty("VS_DOTNET_TARGET_FRAMEWORK_VERSION"))
+    {
+    fout << "\tTargetFrameworkVersion=\"" << targetFrameworkVersion << 
"\"\n";
+    }
   fout << "\tKeyword=\"" << keyword << "\">\n"
        << "\t<Platforms>\n"
        << "\t\t<Platform\n\t\t\tName=\"" << this->PlatformName << 
"\"/>\n"

?
(0034185)
Brad King   
2013-10-21 09:39   
Please try 0001-VS-Set-.NET-target-framework-version-for-VS-7-9-1449.patch
(0034195)
mar-na   
2013-10-21 10:34   
Sorry, I uploaded the wrong patch file.

Yes the patch 0001-VS-Set-.NET-target-framework-version-for-VS-7-9-1449 worked. Thank you!
(0034198)
Brad King   
2013-10-21 10:39   
Thanks for testing!

http://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=0698714c [^]
(0035292)
Robert Maynard   
2014-03-05 09:58   
Closing resolved issues that have not been updated in more than 4 months