Commit be11a852 authored by Sebastian Holtermann's avatar Sebastian Holtermann
Browse files

Autogen: Use project relative paths in rcc custom command comment

parent ab9d5896
...@@ -147,6 +147,26 @@ static void AddCleanFile(cmMakefile* makefile, std::string const& fileName) ...@@ -147,6 +147,26 @@ static void AddCleanFile(cmMakefile* makefile, std::string const& fileName)
false); false);
} }
static std::string FileProjectRelativePath(cmMakefile* makefile,
std::string const& fileName)
{
std::string res;
{
std::string pSource = cmSystemTools::RelativePath(
makefile->GetCurrentSourceDirectory(), fileName.c_str());
std::string pBinary = cmSystemTools::RelativePath(
makefile->GetCurrentBinaryDirectory(), fileName.c_str());
if (pSource.size() < pBinary.size()) {
res = std::move(pSource);
} else if (pBinary.size() < fileName.size()) {
res = std::move(pBinary);
} else {
res = fileName;
}
}
return res;
}
/* @brief Tests if targetDepend is a STATIC_LIBRARY and if any of its /* @brief Tests if targetDepend is a STATIC_LIBRARY and if any of its
* recursive STATIC_LIBRARY dependencies depends on targetOrigin * recursive STATIC_LIBRARY dependencies depends on targetOrigin
* (STATIC_LIBRARY cycle). * (STATIC_LIBRARY cycle).
...@@ -646,7 +666,7 @@ void cmQtAutoGeneratorInitializer::InitCustomTargets() ...@@ -646,7 +666,7 @@ void cmQtAutoGeneratorInitializer::InitCustomTargets()
commandLines.push_back(std::move(currentLine)); commandLines.push_back(std::move(currentLine));
} }
std::string ccComment = "Automatic RCC for "; std::string ccComment = "Automatic RCC for ";
ccComment += qrc.QrcFile; ccComment += FileProjectRelativePath(makefile, qrc.QrcFile);
if (qrc.Generated) { if (qrc.Generated) {
// Create custom rcc target // Create custom rcc target
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment