/src/CMake/Source/cmStateDirectory.h
Line | Count | Source |
1 | | /* Distributed under the OSI-approved BSD 3-Clause License. See accompanying |
2 | | file LICENSE.rst or https://cmake.org/licensing for details. */ |
3 | | |
4 | | #pragma once |
5 | | |
6 | | #include "cmConfigure.h" // IWYU pragma: keep |
7 | | |
8 | | #include <cstddef> |
9 | | #include <string> |
10 | | #include <vector> |
11 | | |
12 | | #include "cmAlgorithms.h" |
13 | | #include "cmLinkedTree.h" |
14 | | #include "cmStatePrivate.h" |
15 | | #include "cmStateSnapshot.h" |
16 | | #include "cmValue.h" |
17 | | |
18 | | class cmListFileBacktrace; |
19 | | template <typename T> |
20 | | class BT; |
21 | | |
22 | | class cmStateDirectory |
23 | | { |
24 | | cmStateDirectory( |
25 | | cmLinkedTree<cmStateDetail::BuildsystemDirectoryStateType>::iterator iter, |
26 | | cmStateSnapshot const& snapshot); |
27 | | |
28 | | public: |
29 | | std::string const& GetCurrentSource() const; |
30 | | void SetCurrentSource(std::string const& dir); |
31 | | std::string const& GetCurrentBinary() const; |
32 | | void SetCurrentBinary(std::string const& dir); |
33 | | |
34 | | cmBTStringRange GetIncludeDirectoriesEntries() const; |
35 | | void AppendIncludeDirectoriesEntry(BT<std::string> const& vec); |
36 | | void PrependIncludeDirectoriesEntry(BT<std::string> const& vec); |
37 | | void SetIncludeDirectories(BT<std::string> const& vec); |
38 | | void ClearIncludeDirectories(); |
39 | | |
40 | | cmBTStringRange GetCompileDefinitionsEntries() const; |
41 | | void AppendCompileDefinitionsEntry(BT<std::string> const& vec); |
42 | | void SetCompileDefinitions(BT<std::string> const& vec); |
43 | | void ClearCompileDefinitions(); |
44 | | |
45 | | cmBTStringRange GetCompileOptionsEntries() const; |
46 | | void AppendCompileOptionsEntry(BT<std::string> const& vec); |
47 | | void SetCompileOptions(BT<std::string> const& vec); |
48 | | void ClearCompileOptions(); |
49 | | |
50 | | cmBTStringRange GetLinkOptionsEntries() const; |
51 | | void AppendLinkOptionsEntry(BT<std::string> const& vec); |
52 | | void PrependLinkDirectoriesEntry(BT<std::string> const& vec); |
53 | | void SetLinkOptions(BT<std::string> const& vec); |
54 | | void ClearLinkOptions(); |
55 | | |
56 | | cmBTStringRange GetLinkDirectoriesEntries() const; |
57 | | void AppendLinkDirectoriesEntry(BT<std::string> const& vec); |
58 | | void SetLinkDirectories(BT<std::string> const& vecs); |
59 | | void ClearLinkDirectories(); |
60 | | |
61 | | void SetProperty(std::string const& prop, cmValue value, |
62 | | cmListFileBacktrace const& lfbt); |
63 | | void SetProperty(std::string const& prop, std::nullptr_t, |
64 | | cmListFileBacktrace const& lfbt) |
65 | 0 | { |
66 | 0 | this->SetProperty(prop, cmValue{ nullptr }, lfbt); |
67 | 0 | } |
68 | | void AppendProperty(std::string const& prop, std::string const& value, |
69 | | bool asString, cmListFileBacktrace const& lfbt); |
70 | | cmValue GetProperty(std::string const& prop) const; |
71 | | cmValue GetProperty(std::string const& prop, bool chain) const; |
72 | | bool GetPropertyAsBool(std::string const& prop) const; |
73 | | std::vector<std::string> GetPropertyKeys() const; |
74 | | |
75 | | void AddNormalTargetName(std::string const& name); |
76 | | void AddImportedTargetName(std::string const& name); |
77 | | |
78 | | private: |
79 | | cmLinkedTree<cmStateDetail::BuildsystemDirectoryStateType>::iterator |
80 | | DirectoryState; |
81 | | cmStateSnapshot Snapshot_; |
82 | | friend class cmStateSnapshot; |
83 | | }; |