diff options
author | Sebastian Holtermann <sebholt@xwmw.org> | 2019-09-09 15:04:51 (GMT) |
---|---|---|
committer | Sebastian Holtermann <sebholt@xwmw.org> | 2019-09-16 16:18:48 (GMT) |
commit | f9e5441eb43d3238211685cded447141082e37b8 (patch) | |
tree | a4332235879289fc5e23e64e6c37988d0d632b26 /Source/cmQtAutoGenInitializer.cxx | |
parent | 51676cf65590f7a9bc3ad247151ee5bdc768eb77 (diff) | |
download | CMake-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/cmQtAutoGenInitializer.cxx')
-rw-r--r-- | Source/cmQtAutoGenInitializer.cxx | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/Source/cmQtAutoGenInitializer.cxx b/Source/cmQtAutoGenInitializer.cxx index 7012ef6..89ef588 100644 --- a/Source/cmQtAutoGenInitializer.cxx +++ b/Source/cmQtAutoGenInitializer.cxx @@ -1410,6 +1410,11 @@ bool cmQtAutoGenInitializer::SetupWriteRccInfo() for (Qrc const& qrc : this->Rcc.Qrcs) { InfoWriter ofs(qrc.InfoFile); if (ofs) { + // Utility lambdas + auto MfDef = [this](const char* key) { + return this->Makefile->GetSafeDefinition(key); + }; + // Write ofs.Write("# Configurations\n"); ofs.Write("ARCC_MULTI_CONFIG", this->MultiConfig ? "TRUE" : "FALSE"); @@ -1419,6 +1424,8 @@ bool cmQtAutoGenInitializer::SetupWriteRccInfo() ofs.WriteConfig("ARCC_SETTINGS_FILE", qrc.ConfigSettingsFile); ofs.Write("# Directories\n"); + ofs.Write("ARCC_CMAKE_SOURCE_DIR", MfDef("CMAKE_SOURCE_DIR")); + ofs.Write("ARCC_CMAKE_BINARY_DIR", MfDef("CMAKE_BINARY_DIR")); ofs.Write("ARCC_BUILD_DIR", this->Dir.Build); ofs.Write("ARCC_INCLUDE_DIR", this->Dir.Include); ofs.WriteConfig("ARCC_INCLUDE_DIR", this->Dir.ConfigInclude); |