VS: Teach include_external_msproject about non-C++ projects (#14661)
Teach CMake to guess the project type guid based on the project file extension. This allows non-C++ projects like *.vbproj or *.csproj to be included.
This commit is contained in:
parent
6820882be5
commit
a79cbdc068
|
@ -240,7 +240,7 @@ void cmGlobalVisualStudio71Generator
|
||||||
const std::set<cmStdString>& depends)
|
const std::set<cmStdString>& depends)
|
||||||
{
|
{
|
||||||
fout << "Project(\"{"
|
fout << "Project(\"{"
|
||||||
<< (typeGuid ? typeGuid : "8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942")
|
<< (typeGuid ? typeGuid : this->ExternalProjectType(location))
|
||||||
<< "}\") = \""
|
<< "}\") = \""
|
||||||
<< name << "\", \""
|
<< name << "\", \""
|
||||||
<< this->ConvertToSolutionPath(location) << "\", \"{"
|
<< this->ConvertToSolutionPath(location) << "\", \"{"
|
||||||
|
|
|
@ -145,6 +145,41 @@ std::string cmGlobalVisualStudio7Generator::FindDevEnvCommand()
|
||||||
return vscmd;
|
return vscmd;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
//----------------------------------------------------------------------------
|
||||||
|
const char* cmGlobalVisualStudio7Generator::ExternalProjectType(
|
||||||
|
const char* location)
|
||||||
|
{
|
||||||
|
std::string extension = cmSystemTools::GetFilenameLastExtension(location);
|
||||||
|
if (extension == ".vbproj")
|
||||||
|
{
|
||||||
|
return "F184B08F-C81C-45F6-A57F-5ABD9991F28F";
|
||||||
|
}
|
||||||
|
else if (extension == ".csproj")
|
||||||
|
{
|
||||||
|
return "FAE04EC0-301F-11D3-BF4B-00C04F79EFBC";
|
||||||
|
}
|
||||||
|
else if (extension == ".fsproj")
|
||||||
|
{
|
||||||
|
return "F2A71F9B-5D33-465A-A702-920D77279786";
|
||||||
|
}
|
||||||
|
else if (extension == ".vdproj")
|
||||||
|
{
|
||||||
|
return "54435603-DBB4-11D2-8724-00A0C9A8B90C";
|
||||||
|
}
|
||||||
|
else if (extension == ".dbproj")
|
||||||
|
{
|
||||||
|
return "C8D11400-126E-41CD-887F-60BD40844F9E";
|
||||||
|
}
|
||||||
|
else if (extension == ".wixproj")
|
||||||
|
{
|
||||||
|
return "930C7802-8A8C-48F9-8165-68863BCCD9DD";
|
||||||
|
}
|
||||||
|
else if (extension == ".pyproj")
|
||||||
|
{
|
||||||
|
return "888888A0-9F3D-457C-B088-3A5042F75D52";
|
||||||
|
}
|
||||||
|
return "8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942";
|
||||||
|
}
|
||||||
//----------------------------------------------------------------------------
|
//----------------------------------------------------------------------------
|
||||||
void cmGlobalVisualStudio7Generator::GenerateBuildCommand(
|
void cmGlobalVisualStudio7Generator::GenerateBuildCommand(
|
||||||
std::vector<std::string>& makeCommand,
|
std::vector<std::string>& makeCommand,
|
||||||
|
@ -730,7 +765,7 @@ void cmGlobalVisualStudio7Generator::WriteExternalProject(std::ostream& fout,
|
||||||
std::string d = cmSystemTools::ConvertToOutputPath(location);
|
std::string d = cmSystemTools::ConvertToOutputPath(location);
|
||||||
fout << "Project("
|
fout << "Project("
|
||||||
<< "\"{"
|
<< "\"{"
|
||||||
<< (typeGuid ? typeGuid : "8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942")
|
<< (typeGuid ? typeGuid : this->ExternalProjectType(location))
|
||||||
<< "}\") = \""
|
<< "}\") = \""
|
||||||
<< name << "\", \""
|
<< name << "\", \""
|
||||||
<< this->ConvertToSolutionPath(location) << "\", \"{"
|
<< this->ConvertToSolutionPath(location) << "\", \"{"
|
||||||
|
|
|
@ -115,6 +115,8 @@ protected:
|
||||||
std::string const& GetDevEnvCommand();
|
std::string const& GetDevEnvCommand();
|
||||||
virtual std::string FindDevEnvCommand();
|
virtual std::string FindDevEnvCommand();
|
||||||
|
|
||||||
|
static const char* ExternalProjectType(const char* location);
|
||||||
|
|
||||||
static cmIDEFlagTable const* GetExtraFlagTableVS7();
|
static cmIDEFlagTable const* GetExtraFlagTableVS7();
|
||||||
virtual void OutputSLNFile(cmLocalGenerator* root,
|
virtual void OutputSLNFile(cmLocalGenerator* root,
|
||||||
std::vector<cmLocalGenerator*>& generators);
|
std::vector<cmLocalGenerator*>& generators);
|
||||||
|
|
Loading…
Reference in New Issue