1 /*=========================================================================
3 Program: Insight Segmentation & Registration Toolkit
4 Module: $RCSfile: cmSourceFile.h,v $
6 Date: $Date: 2002-08-16 15:17:23 $
7 Version: $Revision: 1.9 $
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 #ifndef cmSourceFile_h
18 #define cmSourceFile_h
20 #include "cmStandardIncludes.h"
22 /** \class cmSourceFile
23 * \brief Represent a class loaded from a makefile.
25 * cmSourceFile is represents a class loaded from
32 * Construct instance as a concrete class with both a
40 * Set the name of the file, given the directory the file should be
41 * in. The various extensions provided are tried on the name
42 * (e.g., cxx, cpp) in the directory to find the actual file.
44 void SetName(const char* name
, const char* dir
,
45 const std::vector
<std::string
>& sourceExts
,
46 const std::vector
<std::string
>& headerExts
);
49 * Set the name of the file, given the directory the file should be in. IN
50 * this version the extension is provided in the call. This is useful for
51 * generated files that do not exist prior to the build.
53 void SetName(const char* name
, const char* dir
, const char *ext
,
57 * Print the structure to std::cout.
61 ///! Set/Get a property of this source file
62 void SetProperty(const char *prop
, const char *value
);
63 const char *GetProperty(const char *prop
) const;
64 bool GetPropertyAsBool(const char *prop
) const;
67 * The full path to the file.
69 const std::string
&GetFullPath() const {return m_FullPath
;}
70 void SetFullPath(const char *name
) {m_FullPath
= name
;}
73 * The file name associated with stripped off directory and extension.
74 * (In most cases this is the name of the class.)
76 const std::string
&GetSourceName() const {return m_SourceName
;}
77 void SetSourceName(const char *name
) {m_SourceName
= name
;}
80 * The file name associated with stripped off directory and extension.
81 * (In most cases this is the name of the class.)
83 const std::string
&GetSourceExtension() const {return m_SourceExtension
;}
84 void SetSourceExtension(const char *name
) {m_SourceExtension
= name
;}
87 * Return the vector that holds the list of dependencies
89 const std::vector
<std::string
> &GetDepends() const {return m_Depends
;}
90 std::vector
<std::string
> &GetDepends() {return m_Depends
;}
94 std::map
<cmStdString
,cmStdString
> m_Properties
;
95 std::string m_FullPath
;
96 std::string m_SourceName
;
97 std::string m_SourceExtension
;
98 std::vector
<std::string
> m_Depends
;