packaging: Initial packaging
[platform/upstream/cmake.git] / Source / cmTargetPropCommandBase.h
1 /*============================================================================
2   CMake - Cross Platform Makefile Generator
3   Copyright 2013 Stephen Kelly <steveire@gmail.com>
4
5   Distributed under the OSI-approved BSD License (the "License");
6   see accompanying file Copyright.txt for details.
7
8   This software is distributed WITHOUT ANY WARRANTY; without even the
9   implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
10   See the License for more information.
11 ============================================================================*/
12
13 #ifndef cmTargetPropCommandBase_h
14 #define cmTargetPropCommandBase_h
15
16 #include "cmCommand.h"
17 #include "cmDocumentGeneratorExpressions.h"
18
19 class cmTarget;
20
21 //----------------------------------------------------------------------------
22 class cmTargetPropCommandBase : public cmCommand
23 {
24 public:
25
26   enum ArgumentFlags {
27     NO_FLAGS = 0,
28     PROCESS_BEFORE = 1,
29     PROCESS_SYSTEM = 2
30   };
31
32   bool HandleArguments(std::vector<std::string> const& args,
33                            const char *prop, ArgumentFlags flags = NO_FLAGS);
34
35   cmTypeMacro(cmTargetPropCommandBase, cmCommand);
36 protected:
37   std::string Property;
38   cmTarget *Target;
39
40   virtual void HandleInterfaceContent(cmTarget *tgt,
41                                    const std::vector<std::string> &content,
42                                    bool prepend, bool system);
43 private:
44   virtual void HandleImportedTarget(const std::string &tgt) = 0;
45   virtual void HandleMissingTarget(const std::string &name) = 0;
46
47   virtual void HandleDirectContent(cmTarget *tgt,
48                                    const std::vector<std::string> &content,
49                                    bool prepend, bool system) = 0;
50
51   virtual std::string Join(const std::vector<std::string> &content) = 0;
52
53   bool ProcessContentArgs(std::vector<std::string> const& args,
54                           unsigned int &argIndex, bool prepend, bool system);
55   void PopulateTargetProperies(const std::string &scope,
56                                const std::vector<std::string> &content,
57                                bool prepend, bool system);
58 };
59
60 #endif