VS2010: Honor PROJECT_LABEL target property (#10611)

This commit is contained in:
David Cole 2010-09-09 16:21:57 -04:00
parent 530ade6677
commit e79e412e70
2 changed files with 15 additions and 0 deletions

View File

@ -155,6 +155,13 @@ void cmVisualStudio10TargetGenerator::Generate()
this->WriteString("<Keyword>Win32Proj</Keyword>\n", 2); this->WriteString("<Keyword>Win32Proj</Keyword>\n", 2);
this->WriteString("<Platform>", 2); this->WriteString("<Platform>", 2);
(*this->BuildFileStream) << this->Platform << "</Platform>\n"; (*this->BuildFileStream) << this->Platform << "</Platform>\n";
const char* projLabel = this->Target->GetProperty("PROJECT_LABEL");
if(!projLabel)
{
projLabel = this->Name.c_str();
}
this->WriteString("<ProjectName>", 2);
(*this->BuildFileStream) << projLabel << "</ProjectName>\n";
this->WriteString("</PropertyGroup>\n", 1); this->WriteString("</PropertyGroup>\n", 1);
this->WriteString("<Import Project=" this->WriteString("<Import Project="
"\"$(VCTargetsPath)\\Microsoft.Cpp.Default.props\" />\n", "\"$(VCTargetsPath)\\Microsoft.Cpp.Default.props\" />\n",

View File

@ -166,3 +166,11 @@ ELSE(DEFINED SUBDIR_DEFINED)
ENDIF(DEFINED SUBDIR_DEFINED) ENDIF(DEFINED SUBDIR_DEFINED)
ADD_EXECUTABLE(FunctionTest functionTest.c) ADD_EXECUTABLE(FunctionTest functionTest.c)
# Use the PROJECT_LABEL property: in IDEs, the project label should appear
# in the UI rather than the target name. If this were a good test of the
# property rather than just a smoke test, it would verify that the label
# actually appears in the UI of the IDE... Or at least that the text appears
# somewhere in the generated project files.
SET_PROPERTY(TARGET miniFunctionTest
PROPERTY PROJECT_LABEL "Test de Fonctionnement")