diff options
author | Bill Hoffman <bill.hoffman@kitware.com> | 2002-04-11 21:02:10 (GMT) |
---|---|---|
committer | Bill Hoffman <bill.hoffman@kitware.com> | 2002-04-11 21:02:10 (GMT) |
commit | 789267c94903f23d231e16de6ff50a2926dcf8e4 (patch) | |
tree | 8effdfe67c6a239421ca6977ff21675de2552bff /Source/cmIncludeCommand.cxx | |
parent | cdc65cfebfc0a2f5b0ecbc0a61d3f14c4989955a (diff) | |
download | CMake-789267c94903f23d231e16de6ff50a2926dcf8e4.zip CMake-789267c94903f23d231e16de6ff50a2926dcf8e4.tar.gz CMake-789267c94903f23d231e16de6ff50a2926dcf8e4.tar.bz2 |
ENH: speed improvements
Diffstat (limited to 'Source/cmIncludeCommand.cxx')
-rw-r--r-- | Source/cmIncludeCommand.cxx | 18 |
1 files changed, 10 insertions, 8 deletions
diff --git a/Source/cmIncludeCommand.cxx b/Source/cmIncludeCommand.cxx index 6cda4a5..54308e4 100644 --- a/Source/cmIncludeCommand.cxx +++ b/Source/cmIncludeCommand.cxx @@ -25,19 +25,21 @@ bool cmIncludeCommand::InitialPass(std::vector<std::string> const& args) this->SetError("called with wrong number of arguments. " "Include only takes one file."); } - bool exists = cmSystemTools::FileExists(args[0].c_str()); - if(args.size() == 2 && args[1] == "OPTIONAL" && !exists) + bool optional = false; + if(args.size() == 2) { - return true; + optional = args[1] == "OPTIONAL"; } - if(!exists) + + bool readit = m_Makefile->ReadListFile( m_Makefile->GetCurrentListFile(), + args[0].c_str()); + if(!optional && !readit) { - std::string error = "Include file not found: " + args[0] + "\n"; - this->SetError(error.c_str()); + std::string m = "Could not find include file:"; + m += args[0]; + this->SetError(m.c_str()); return false; } - m_Makefile->ReadListFile( m_Makefile->GetCurrentListFile(), - args[0].c_str()); return true; } |