summaryrefslogtreecommitdiffstats
path: root/Source/cmQtAutoGenerator.h
diff options
context:
space:
mode:
authorSebastian Holtermann <sebholt@xwmw.org>2019-09-09 15:04:51 (GMT)
committerSebastian Holtermann <sebholt@xwmw.org>2019-09-16 16:18:48 (GMT)
commitf9e5441eb43d3238211685cded447141082e37b8 (patch)
treea4332235879289fc5e23e64e6c37988d0d632b26 /Source/cmQtAutoGenerator.h
parent51676cf65590f7a9bc3ad247151ee5bdc768eb77 (diff)
downloadCMake-f9e5441eb43d3238211685cded447141082e37b8.zip
CMake-f9e5441eb43d3238211685cded447141082e37b8.tar.gz
CMake-f9e5441eb43d3238211685cded447141082e37b8.tar.bz2
Autogen: Abbreviate file paths in messages
This introduces the `cmQtAutoGenerator::MessagePath` method, that abbreviates paths by placing a - "SRC:" prefix in place of the project source directory - "BIN:" prefix in place of the project binary directory The method is used in `AUTO{MOC,UIC,RCC}` when paths are displayed in messages. This makes the messages generated by `AUTO{MOC,UIC,RCC}` shorter and improves their readability.
Diffstat (limited to 'Source/cmQtAutoGenerator.h')
-rw-r--r--Source/cmQtAutoGenerator.h24
1 files changed, 17 insertions, 7 deletions
diff --git a/Source/cmQtAutoGenerator.h b/Source/cmQtAutoGenerator.h
index 4b8b0b7..371b25c 100644
--- a/Source/cmQtAutoGenerator.h
+++ b/Source/cmQtAutoGenerator.h
@@ -23,9 +23,7 @@ class cmQtAutoGenerator : public cmQtAutoGen
public:
// -- Types
- /**
- * Thread safe logger
- */
+ /** Thread safe logger. */
class Logger
{
public:
@@ -45,12 +43,8 @@ public:
void Info(GenT genType, cm::string_view message) const;
// -- Log warning
void Warning(GenT genType, cm::string_view message) const;
- void WarningFile(GenT genType, cm::string_view filename,
- cm::string_view message) const;
// -- Log error
void Error(GenT genType, cm::string_view message) const;
- void ErrorFile(GenT genType, cm::string_view filename,
- cm::string_view message) const;
void ErrorCommand(GenT genType, cm::string_view message,
std::vector<std::string> const& command,
std::string const& output) const;
@@ -64,6 +58,15 @@ public:
bool ColorOutput_ = false;
};
+ /** Project directories. */
+ struct ProjectDirsT
+ {
+ std::string Source;
+ std::string Binary;
+ std::string CurrentSource;
+ std::string CurrentBinary;
+ };
+
// -- File system methods
static bool MakeParentDirectory(std::string const& filename);
static bool FileRead(std::string& content, std::string const& filename,
@@ -91,13 +94,18 @@ public:
std::string const& InfoDir() const { return InfoDir_; }
std::string const& InfoConfig() const { return InfoConfig_; }
+ // -- Directories
+ ProjectDirsT const& ProjectDirs() const { return ProjectDirs_; }
+
// -- Utility
static std::string SettingsFind(std::string const& content, const char* key);
+ std::string MessagePath(cm::string_view path) const;
protected:
// -- Abstract processing interface
virtual bool Init(cmMakefile* makefile) = 0;
virtual bool Process() = 0;
+ ProjectDirsT& ProjectDirsRef() { return ProjectDirs_; }
private:
// -- Info settings
@@ -105,6 +113,8 @@ private:
cmFileTime InfoFileTime_;
std::string InfoDir_;
std::string InfoConfig_;
+ // -- Directories
+ ProjectDirsT ProjectDirs_;
};
#endif