ENH: mark some vars as advanced (and resort the list)
[cmake.git] / Source / cmSourceFile.h
blob097a13ee5960cc1a655c56867092832f5ae13a7f
1 /*=========================================================================
3 Program: Insight Segmentation & Registration Toolkit
4 Module: $RCSfile: cmSourceFile.h,v $
5 Language: C++
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
26 * a makefile.
28 class cmSourceFile
30 public:
31 /**
32 * Construct instance as a concrete class with both a
33 * .h and .cxx file.
35 cmSourceFile()
39 /**
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);
48 /**
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,
54 bool headerFileOnly);
56 /**
57 * Print the structure to std::cout.
59 void Print() const;
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;
66 /**
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;}
72 /**
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;}
79 /**
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;}
86 /**
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;}
92 private:
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;
101 #endif