summaryrefslogtreecommitdiffstats
path: root/Source/cmSourceFile.h
diff options
context:
space:
mode:
authorSebastian Holtermann <sebholt@xwmw.org>2019-02-01 15:28:21 (GMT)
committerSebastian Holtermann <sebholt@xwmw.org>2019-02-01 15:55:35 (GMT)
commit2ddf3f4467bdd600027dd3532515d05d44996871 (patch)
tree204493c5498596b8e14b196d47adbc4da4dc2acf /Source/cmSourceFile.h
parentb9d44fc35081a3354429137dff09a8959d8a2a92 (diff)
downloadCMake-2ddf3f4467bdd600027dd3532515d05d44996871.zip
CMake-2ddf3f4467bdd600027dd3532515d05d44996871.tar.gz
CMake-2ddf3f4467bdd600027dd3532515d05d44996871.tar.bz2
cmSourceFile: Add IsGenerated method
All cmSourceFiles are checked at least once whether they're `GENERATED` or not. This adds a convenience method `GetIsGenerated` that returns a private boolean cache variable `IsGenerated`. `IsGenerated` is updated every time the `GENERATED` property is written.
Diffstat (limited to 'Source/cmSourceFile.h')
-rw-r--r--Source/cmSourceFile.h9
1 files changed, 7 insertions, 2 deletions
diff --git a/Source/cmSourceFile.h b/Source/cmSourceFile.h
index 9936e5a..7f37ef3 100644
--- a/Source/cmSourceFile.h
+++ b/Source/cmSourceFile.h
@@ -55,6 +55,10 @@ public:
command like get_property or get_source_file_property. */
const char* GetPropertyForUser(const std::string& prop);
+ ///! Checks is the GENERATED property is set and true
+ /// @return Equivalent to GetPropertyAsBool("GENERATED")
+ bool GetIsGenerated() const { return this->IsGenerated; }
+
/**
* The full path to the file. The non-const version of this method
* may attempt to locate the file on disk and finalize its location.
@@ -106,13 +110,14 @@ public:
private:
cmSourceFileLocation Location;
cmPropertyMap Properties;
- cmCustomCommand* CustomCommand;
+ cmCustomCommand* CustomCommand = nullptr;
std::string Extension;
std::string Language;
std::string FullPath;
std::string ObjectLibrary;
std::vector<std::string> Depends;
- bool FindFullPathFailed;
+ bool FindFullPathFailed = false;
+ bool IsGenerated = false;
bool FindFullPath(std::string* error);
bool TryFullPath(const std::string& path, const std::string& ext);