diff --git a/Source/cmLocalVisualStudio7Generator.cxx b/Source/cmLocalVisualStudio7Generator.cxx index 3af2ba4f1..fbd628a59 100644 --- a/Source/cmLocalVisualStudio7Generator.cxx +++ b/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 &) { fout << "\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\n" << "\t\t\n" << "\t\n"; diff --git a/Source/cmSetTargetPropertiesCommand.h b/Source/cmSetTargetPropertiesCommand.h index 1ae1a59d2..91eb34a88 100644 --- a/Source/cmSetTargetPropertiesCommand.h +++ b/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."; }