summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorSebastian Holtermann <sebholt@xwmw.org>2017-04-22 11:30:28 (GMT)
committerSebastian Holtermann <sebholt@xwmw.org>2017-04-22 11:30:28 (GMT)
commit344a6d8448d16e2d28a318e4809ea0ff2a544c0d (patch)
treefbd4366516bca20599809ec0efbd2d71b91d47c6
parent5965a589154e64ba3997c28a718652f54a84c631 (diff)
downloadCMake-344a6d8448d16e2d28a318e4809ea0ff2a544c0d.zip
CMake-344a6d8448d16e2d28a318e4809ea0ff2a544c0d.tar.gz
CMake-344a6d8448d16e2d28a318e4809ea0ff2a544c0d.tar.bz2
Autogen: MakeParentDirectory logPrefix parameter
-rw-r--r--Source/cmQtAutoGenerators.cxx18
-rw-r--r--Source/cmQtAutoGenerators.h3
2 files changed, 13 insertions, 8 deletions
diff --git a/Source/cmQtAutoGenerators.cxx b/Source/cmQtAutoGenerators.cxx
index 89b90b2..a42db11 100644
--- a/Source/cmQtAutoGenerators.cxx
+++ b/Source/cmQtAutoGenerators.cxx
@@ -1148,7 +1148,7 @@ bool cmQtAutoGenerators::MocGenerateAll(
// Generate moc_predefs
if (!this->MocPredefsCmd.empty()) {
- if (!this->MakeParentDirectory(this->MocPredefsFileAbs)) {
+ if (!this->MakeParentDirectory("AutoMoc", this->MocPredefsFileAbs)) {
this->LogError("AutoMoc: Error creating directory for " +
this->MocPredefsFileRel);
return false;
@@ -1275,7 +1275,7 @@ bool cmQtAutoGenerators::MocGenerateAll(
this->LogBold("Generating MOC compilation " + this->MocCppFilenameRel);
// Make sure the parent directory exists
- success = this->MakeParentDirectory(this->MocCppFilenameAbs);
+ success = this->MakeParentDirectory("AutoMoc", this->MocCppFilenameAbs);
if (success) {
cmsys::ofstream outfile;
outfile.open(this->MocCppFilenameAbs.c_str(), std::ios::trunc);
@@ -1340,7 +1340,7 @@ bool cmQtAutoGenerators::MocGenerateFile(
this->LogBold("Generating MOC source " + mocFileRel);
// Make sure the parent directory exists
- if (this->MakeParentDirectory(mocFileAbs)) {
+ if (this->MakeParentDirectory("AutoMoc", mocFileAbs)) {
// Compose moc command
std::vector<std::string> cmd;
cmd.push_back(this->MocExecutable);
@@ -1516,7 +1516,7 @@ bool cmQtAutoGenerators::UicGenerateFile(const std::string& realName,
this->LogBold("Generating UIC header " + uicFileRel);
// Make sure the parent directory exists
- if (this->MakeParentDirectory(uicFileAbs)) {
+ if (this->MakeParentDirectory("AutoUic", uicFileAbs)) {
// Compose uic command
std::vector<std::string> cmd;
cmd.push_back(this->UicExecutable);
@@ -1654,7 +1654,7 @@ bool cmQtAutoGenerators::RccGenerateFile(const std::string& rccInputFile,
this->LogBold("Generating RCC source " + rccOutputFile);
// Make sure the parent directory exists
- if (this->MakeParentDirectory(rccBuildFile)) {
+ if (this->MakeParentDirectory("AutoRcc", rccBuildFile)) {
// Compose symbol name
std::string symbolName =
cmsys::SystemTools::GetFilenameWithoutLastExtension(rccInputFile);
@@ -1839,14 +1839,18 @@ std::string cmQtAutoGenerators::ChecksumedPath(const std::string& sourceFile,
* @brief Generates the parent directory of the given file on demand
* @return True on success
*/
-bool cmQtAutoGenerators::MakeParentDirectory(const std::string& filename) const
+bool cmQtAutoGenerators::MakeParentDirectory(const char* logPrefix,
+ const std::string& filename) const
{
bool success = true;
const std::string dirName = cmSystemTools::GetFilenamePath(filename);
if (!dirName.empty()) {
success = cmsys::SystemTools::MakeDirectory(dirName);
if (!success) {
- this->LogError("AutoGen: Error: Directory creation failed: " + dirName);
+ std::string error = logPrefix;
+ error += ": Error: Parent directory creation failed for ";
+ error += Quoted(filename);
+ this->LogError(error);
}
}
return success;
diff --git a/Source/cmQtAutoGenerators.h b/Source/cmQtAutoGenerators.h
index 7ef2d6e..7419cdc 100644
--- a/Source/cmQtAutoGenerators.h
+++ b/Source/cmQtAutoGenerators.h
@@ -141,7 +141,8 @@ private:
std::string ChecksumedPath(const std::string& sourceFile,
const char* basePrefix,
const char* baseSuffix) const;
- bool MakeParentDirectory(const std::string& filename) const;
+ bool MakeParentDirectory(const char* logPrefix,
+ const std::string& filename) const;
bool RunCommand(const std::vector<std::string>& command, std::string& output,
bool verbose = true) const;