diff options
author | Brad King <brad.king@kitware.com> | 2008-03-07 13:40:36 (GMT) |
---|---|---|
committer | Brad King <brad.king@kitware.com> | 2008-03-07 13:40:36 (GMT) |
commit | 680104a490250f7b56b67aa3cbb7c113d997e93c (patch) | |
tree | 52af6beb6a876f03a1205c050ad8295e338ca573 /Source/cmMakefile.h | |
parent | 41a59e211ef6b0c9c839545661579934ce9415c1 (diff) | |
download | CMake-680104a490250f7b56b67aa3cbb7c113d997e93c.zip CMake-680104a490250f7b56b67aa3cbb7c113d997e93c.tar.gz CMake-680104a490250f7b56b67aa3cbb7c113d997e93c.tar.bz2 |
ENH: New format for warning and error messages
- Add cmMakefile methods IssueError and IssueWarning
- Maintain an explicit call stack in cmMakefile
- Include context/call-stack info in messages
- Nested errors now unwind the call stack
- Use new mechanism for policy warnings and errors
- Improve policy error message
- Include cmExecutionStatus pointer in call stack
so that errors deeper in the C++ stack under
a command invocation will become errors for the
command
Diffstat (limited to 'Source/cmMakefile.h')
-rw-r--r-- | Source/cmMakefile.h | 17 |
1 files changed, 17 insertions, 0 deletions
diff --git a/Source/cmMakefile.h b/Source/cmMakefile.h index db13452..b679ff4 100644 --- a/Source/cmMakefile.h +++ b/Source/cmMakefile.h @@ -41,6 +41,7 @@ class cmSourceFile; class cmTest; class cmVariableWatch; class cmake; +class cmMakefileCall; /** \class cmMakefile * \brief Process the input CMakeLists.txt file. @@ -783,6 +784,10 @@ public: void PopScope(); void RaiseScope(const char *var, const char *value); + /** Issue messages with the given text plus context information. */ + void IssueWarning(std::string const& msg) const; + void IssueError(std::string const& msg) const; + protected: // add link libraries and directories to the target void AddGlobalLinkInformation(const char* name, cmTarget& target); @@ -876,6 +881,18 @@ private: // stack of list files being read std::deque<cmStdString> ListFileStack; + // stack of commands being invoked. + struct CallStackEntry + { + cmListFileContext const* Context; + cmExecutionStatus* Status; + }; + typedef std::deque<CallStackEntry> CallStackType; + CallStackType CallStack; + friend class cmMakefileCall; + + void IssueMessage(std::string const& text, bool isError) const; + cmTarget* FindBasicTarget(const char* name); std::vector<cmTarget*> ImportedTargetsOwned; std::map<cmStdString, cmTarget*> ImportedTargets; |