1 /*============================================================================
2 CMake - Cross Platform Makefile Generator
3 Copyright 2000-2010 Kitware, Inc., Insight Software Consortium
5 Distributed under the OSI-approved BSD License (the "License");
6 see accompanying file Copyright.txt for details.
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 cmTargetDepend_h
13 #define cmTargetDepend_h
15 #include "cmStandardIncludes.h"
19 /** One edge in the global target dependency graph.
20 It may be marked as a 'link' or 'util' edge or both. */
25 // The set order depends only on the Target, so we use
26 // mutable members to acheive a map with set syntax.
30 cmTargetDepend(cmTarget* t): Target(t), Link(false), Util(false) {}
31 operator cmTarget*() const { return this->Target; }
32 cmTarget* operator->() const { return this->Target; }
33 cmTarget& operator*() const { return *this->Target; }
34 friend bool operator < (cmTargetDepend const& l, cmTargetDepend const& r)
35 { return l.Target < r.Target; }
36 void SetType(bool strong) const
38 if(strong) { this->Util = true; }
39 else { this->Link = true; }
41 bool IsLink() const { return this->Link; }
42 bool IsUtil() const { return this->Util; }
45 /** Unordered set of (direct) dependencies of a target. */
46 class cmTargetDependSet: public std::set<cmTargetDepend> {};