1 /*=========================================================================
3 Program: Insight Segmentation & Registration Toolkit
4 Module: $RCSfile: cmGetSourceFilePropertyCommand.cxx,v $
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&
25 this->SetError("called with incorrect number of arguments");
28 const char* var
= args
[0].c_str();
29 const char* file
= args
[1].c_str();
30 cmSourceFile
* sf
= m_Makefile
->GetSource(file
);
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());
48 std::string m
= "Could not find source file: ";
50 this->SetError(m
.c_str());