Silence VS generator for missing CMakeLists.txt

CMake Makefile generators silently ignore missing CMakeLists.txt files
and just treat the source directory as if it had an empty input file.
This will be addressed with a new CMake Policy, but for now we make the
VS generator consistent with the Makefile generator behavior.  The VS
generator will need to handle the OLD behavior of the policy anyway.
This commit is contained in:
Brad King 2009-09-02 16:07:12 -04:00
parent 0af3b3b802
commit 0e8c7859c8
2 changed files with 8 additions and 0 deletions

View File

@ -266,6 +266,10 @@ void cmLocalVisualStudio6Generator::AddDSPBuildRule(cmTarget& tgt)
std::string makefileIn = this->Makefile->GetStartDirectory();
makefileIn += "/";
makefileIn += "CMakeLists.txt";
if(!cmSystemTools::FileExists(makefileIn.c_str()))
{
return;
}
std::string comment = "Building Custom Rule ";
comment += makefileIn;
std::string args;

View File

@ -246,6 +246,10 @@ cmSourceFile* cmLocalVisualStudio7Generator::CreateVCProjBuildRule()
makefileIn += "/";
makefileIn += "CMakeLists.txt";
makefileIn = cmSystemTools::CollapseFullPath(makefileIn.c_str());
if(!cmSystemTools::FileExists(makefileIn.c_str()))
{
return 0;
}
std::string comment = "Building Custom Rule ";
comment += makefileIn;
std::string args;