CMake Nightly Date Stamp
[kiteware-cmake.git] / Source / cmInstalledFile.h
blobe0d7647c0a9fd9635cddeb6699aacf1b73ba75b2
1 /* Distributed under the OSI-approved BSD 3-Clause License. See accompanying
2 file Copyright.txt or https://cmake.org/licensing for details. */
3 #pragma once
5 #include "cmConfigure.h" // IWYU pragma: keep
7 #include <map>
8 #include <memory>
9 #include <string>
10 #include <vector>
12 #include "cmGeneratorExpression.h"
14 class cmMakefile;
16 /** \class cmInstalledFile
17 * \brief Represents a file intended for installation.
19 * cmInstalledFile represents a file intended for installation.
21 class cmInstalledFile
23 public:
24 using CompiledGeneratorExpressionPtrType =
25 std::unique_ptr<cmCompiledGeneratorExpression>;
27 using ExpressionVectorType = std::vector<CompiledGeneratorExpressionPtrType>;
29 struct Property
31 Property();
32 ~Property();
34 Property(const Property&) = delete;
35 Property& operator=(const Property&) = delete;
37 ExpressionVectorType ValueExpressions;
40 using PropertyMapType = std::map<std::string, Property>;
42 cmInstalledFile();
44 ~cmInstalledFile();
46 cmInstalledFile(const cmInstalledFile&) = delete;
47 cmInstalledFile& operator=(const cmInstalledFile&) = delete;
49 void RemoveProperty(const std::string& prop);
51 void SetProperty(cmMakefile const* mf, const std::string& prop,
52 const std::string& value);
54 void AppendProperty(cmMakefile const* mf, const std::string& prop,
55 const std::string& value, bool asString = false);
57 bool HasProperty(const std::string& prop) const;
59 bool GetProperty(const std::string& prop, std::string& value) const;
61 bool GetPropertyAsBool(const std::string& prop) const;
63 std::vector<std::string> GetPropertyAsList(const std::string& prop) const;
65 void SetName(cmMakefile* mf, const std::string& name);
67 std::string const& GetName() const;
69 cmCompiledGeneratorExpression const& GetNameExpression() const;
71 PropertyMapType const& GetProperties() const { return this->Properties; }
73 private:
74 std::string Name;
75 CompiledGeneratorExpressionPtrType NameExpression;
76 PropertyMapType Properties;