FIX: stupid pb fixed (close to being medieval'ed by The Ken)
[cmake.git] / Source / cmGetSourceFilePropertyCommand.cxx
blob1462ef6941e60406bae6c68e01d174efafc52a35
1 /*=========================================================================
3 Program: Insight Segmentation & Registration Toolkit
4 Module: $RCSfile: cmGetSourceFilePropertyCommand.cxx,v $
5 Language: C++
6 Date: $Date: 2002-03-29 19:20:19 $
7 Version: $Revision: 1.2 $
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 "cmGetSourceFilePropertyCommand.h"
19 // cmSetSourceFilePropertyCommand
20 bool cmGetSourceFilePropertyCommand::InitialPass(std::vector<std::string> const&
21 args)
23 if(args.size() != 3 )
25 this->SetError("called with incorrect number of arguments");
26 return false;
28 const char* var = args[0].c_str();
29 const char* file = args[1].c_str();
30 cmSourceFile* sf = m_Makefile->GetSource(file);
31 if(sf)
33 if(args[2] == "ABSTRACT")
35 m_Makefile->AddDefinition(var, sf->IsAnAbstractClass());
37 if(args[2] == "WRAP_EXCLUDE")
39 m_Makefile->AddDefinition(var, sf->GetWrapExclude());
41 if(args[2] == "COMPILE_FLAGS")
43 m_Makefile->AddDefinition(var, sf->GetCompileFlags());
46 else
48 std::string m = "Could not find source file: ";
49 m += file;
50 this->SetError(m.c_str());
51 return false;
53 return true;