FIX: stupid pb fixed (close to being medieval'ed by The Ken)
[cmake.git] / Source / cmIncludeCommand.cxx
blob3751720b2546b3a53aed562d8449aa0ebe39ed51
1 /*=========================================================================
3 Program: Insight Segmentation & Registration Toolkit
4 Module: $RCSfile: cmIncludeCommand.cxx,v $
5 Language: C++
6 Date: $Date: 2002-05-01 14:12:48 $
7 Version: $Revision: 1.10 $
9 Copyright (c) 2002 Insight Consortium. All rights reserved.
10 See ITKCopyright.txt or http://www.itk.org/HTML/Copyright.htm for details.
12 This software is distributed WITHOUT ANY WARRANTY; without even
13 the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
14 PURPOSE. See the above copyright notices for more information.
16 =========================================================================*/
17 #include "cmIncludeCommand.h"
20 // cmIncludeCommand
21 bool cmIncludeCommand::InitialPass(std::vector<std::string> const& args)
23 if (args.size()< 1 || args.size() > 2)
25 this->SetError("called with wrong number of arguments. "
26 "Include only takes one file.");
28 bool optional = false;
29 if(args.size() == 2)
31 optional = args[1] == "OPTIONAL";
34 bool readit = m_Makefile->ReadListFile( m_Makefile->GetCurrentListFile(),
35 args[0].c_str());
36 if(!optional && !readit)
38 std::string m = "Could not find include file: ";
39 m += args[0];
40 this->SetError(m.c_str());
41 return false;
43 return true;