Browse Source

ENH: add some more properties for visual studio projects

Bill Hoffman 20 years ago
parent
commit
49840778b9
2 changed files with 18 additions and 5 deletions
  1. 13 4
      Source/cmLocalVisualStudio7Generator.cxx
  2. 5 1
      Source/cmSetTargetPropertiesCommand.h

+ 13 - 4
Source/cmLocalVisualStudio7Generator.cxx

@@ -1321,7 +1321,7 @@ void cmLocalVisualStudio7Generator::OutputTargetRules(std::ostream& fout,
 void 
 cmLocalVisualStudio7Generator::WriteProjectStart(std::ostream& fout, 
                                                  const char *libName,
-                                                 cmTarget &, 
+                                                 cmTarget & target, 
                                                  std::vector<cmSourceGroup> &)
 {
   fout << "<?xml version=\"1.0\" encoding = \"Windows-1252\"?>\n"
@@ -1342,11 +1342,20 @@ cmLocalVisualStudio7Generator::WriteProjectStart(std::ostream& fout,
       fout << "\tVersion=\"7.00\"\n";
       }
     }
-  
-  fout << "\tName=\"" << libName << "\"\n"
+  const char* projLabel = target.GetProperty("PROJECT_LABEL");
+  if(!projLabel)
+    {
+    projLabel = libName;
+    }
+  const char* keyword = target.GetProperty("VS_KEYWORD");
+  if(!keyword)
+    {
+    keyword = "Win32Proj";
+    }
+  fout << "\tName=\"" << projLabel << "\"\n"
        << "\tSccProjectName=\"\"\n"
        << "\tSccLocalPath=\"\"\n"
-       << "\tKeyword=\"Win32Proj\">\n"
+       << "\tKeyword=\"" << keyword << "\">\n"
        << "\t<Platforms>\n"
        << "\t\t<Platform\n\t\t\tName=\"Win32\"/>\n"
        << "\t</Platforms>\n";

+ 5 - 1
Source/cmSetTargetPropertiesCommand.h

@@ -78,7 +78,11 @@ public:
         "used in place of the target name when creating executables. "
         "If not set here then it is set to target_EXPORTS by default "
         "(with some substitutions if the target is not a valid C "
-        "identifier).  You can use any prop value pair you want and "
+        "identifier).  PROJECT_LABEL can be used to change the name of "
+        "the target in an IDE like visual studio.  VS_KEYWORD can be set "
+        "to change the visual studio keyword, for example QT integration "
+        "works better if this is set to Qt4VSv1.0. "
+        "You can use any prop value pair you want and "
         "extract it later with the GET_TARGET_PROPERTY command.";
     }