Imported Upstream version 2.8.12.2
[platform/upstream/cmake.git] / Source / cmAddDependenciesCommand.h
1 /*============================================================================
2   CMake - Cross Platform Makefile Generator
3   Copyright 2000-2009 Kitware, Inc., Insight Software Consortium
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 #ifndef cmDependenciessCommand_h
13 #define cmDependenciessCommand_h
14
15 #include "cmCommand.h"
16
17 /** \class cmAddDependenciesCommand
18  * \brief Add a dependency to a target
19  *
20  * cmAddDependenciesCommand adds a dependency to a target
21  */
22 class cmAddDependenciesCommand : public cmCommand
23 {
24 public:
25   /**
26    * This is a virtual constructor for the command.
27    */
28   virtual cmCommand* Clone()
29     {
30     return new cmAddDependenciesCommand;
31     }
32
33   /**
34    * This is called when the command is first encountered in
35    * the CMakeLists.txt file.
36    */
37   virtual bool InitialPass(std::vector<std::string> const& args,
38                            cmExecutionStatus &status);
39
40   /**
41    * The name of the command as specified in CMakeList.txt.
42    */
43   virtual const char* GetName() const { return "add_dependencies";}
44
45   /**
46    * Succinct documentation.
47    */
48   virtual const char* GetTerseDocumentation() const
49     {
50     return "Add a dependency between top-level targets.";
51     }
52
53   /**
54    * More documentation.
55    */
56   virtual const char* GetFullDocumentation() const
57     {
58     return
59       "  add_dependencies(target-name depend-target1\n"
60       "                   depend-target2 ...)\n"
61       "Make a top-level target depend on other top-level targets.  A "
62       "top-level target is one created by ADD_EXECUTABLE, ADD_LIBRARY, "
63       "or ADD_CUSTOM_TARGET.  Adding dependencies with this command "
64       "can be used to make sure one target is built before another target.  "
65       "Dependencies added to an IMPORTED target are followed transitively "
66       "in its place since the target itself does not build.  "
67       "See the DEPENDS option of ADD_CUSTOM_TARGET "
68       "and ADD_CUSTOM_COMMAND for adding file-level dependencies in custom "
69       "rules.  See the OBJECT_DEPENDS option in "
70       "SET_SOURCE_FILES_PROPERTIES to add file-level dependencies to object "
71       "files.";
72     }
73
74   cmTypeMacro(cmAddDependenciesCommand, cmCommand);
75 };
76
77
78 #endif