Commit df74f3ff authored by Sebastian Holtermann's avatar Sebastian Holtermann Committed by Brad King

QtAutogen: Generate rcc output file names in one place only

parent bafbeaf1
......@@ -109,8 +109,6 @@ static void SetupSourceFiles(cmGeneratorTarget const* target,
std::vector<cmSourceFile*> srcFiles;
target->GetConfigCommonSourceFiles(srcFiles);
std::vector<std::string> rccOutput;
cmFilePathChecksum fpathCheckSum(makefile);
for (std::vector<cmSourceFile*>::const_iterator fileIt = srcFiles.begin();
fileIt != srcFiles.end(); ++fileIt) {
......@@ -123,23 +121,6 @@ static void SetupSourceFiles(cmGeneratorTarget const* target,
skipUic.push_back(absFile);
}
if (target->GetPropertyAsBool("AUTORCC")) {
if (ext == "qrc" &&
!cmSystemTools::IsOn(sf->GetPropertyForUser("SKIP_AUTORCC"))) {
// Run cmake again when .qrc file changes
makefile->AddCMakeDependFile(absFile);
std::string rccOutputFile = GetAutogenTargetBuildDir(target);
rccOutputFile += fpathCheckSum.getPart(absFile);
rccOutputFile += "/qrc_";
rccOutputFile +=
cmsys::SystemTools::GetFilenameWithoutLastExtension(absFile);
rccOutputFile += ".cpp";
rccOutput.push_back(rccOutputFile);
}
}
if (!cmSystemTools::IsOn(sf->GetPropertyForUser("GENERATED"))) {
if (cmSystemTools::IsOn(sf->GetPropertyForUser("SKIP_AUTOMOC"))) {
skipMoc.push_back(absFile);
......@@ -154,18 +135,6 @@ static void SetupSourceFiles(cmGeneratorTarget const* target,
}
}
}
// Add rcc output files as sources
for (std::vector<std::string>::const_iterator fileIt = rccOutput.begin();
fileIt != rccOutput.end(); ++fileIt) {
const std::string& rccOutputFile = *fileIt;
// Add source
makefile->GetOrCreateSource(rccOutputFile, true);
const_cast<cmGeneratorTarget*>(target)->AddSource(rccOutputFile);
// Create output directory
cmSystemTools::MakeDirectory(
cmsys::SystemTools::GetFilenamePath(rccOutputFile));
}
}
static void GetCompileDefinitionsAndDirectories(
......@@ -783,12 +752,19 @@ void cmQtAutoGeneratorInitializer::InitializeAutogenTarget(
const std::string absFile =
cmsys::SystemTools::GetRealPath(sf->GetFullPath());
// Run cmake again when .qrc file changes
makefile->AddCMakeDependFile(absFile);
std::string rccOutputFile = autogenBuildDir;
rccOutputFile += fpathCheckSum.getPart(absFile);
rccOutputFile += "/qrc_";
rccOutputFile +=
cmsys::SystemTools::GetFilenameWithoutLastExtension(absFile);
rccOutputFile += ".cpp";
// Add rcc output file to origin target sources
makefile->GetOrCreateSource(rccOutputFile, true);
target->AddSource(rccOutputFile);
// Register rcc output file as generated
autogenOutputFiles.push_back(rccOutputFile);
}
......
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