mirror of
https://github.com/Kitware/CMake.git
synced 2026-03-01 20:28:37 -06:00
QtAutogen: Add rcc output files to autogen target byproducts
This commit is contained in:
committed by
Brad King
parent
8f437f3c35
commit
bafbeaf190
@@ -128,7 +128,7 @@ static void SetupSourceFiles(cmGeneratorTarget const* target,
|
|||||||
!cmSystemTools::IsOn(sf->GetPropertyForUser("SKIP_AUTORCC"))) {
|
!cmSystemTools::IsOn(sf->GetPropertyForUser("SKIP_AUTORCC"))) {
|
||||||
|
|
||||||
// Run cmake again when .qrc file changes
|
// Run cmake again when .qrc file changes
|
||||||
makefile->AddCMakeDependFile ( absFile );
|
makefile->AddCMakeDependFile(absFile);
|
||||||
|
|
||||||
std::string rccOutputFile = GetAutogenTargetBuildDir(target);
|
std::string rccOutputFile = GetAutogenTargetBuildDir(target);
|
||||||
rccOutputFile += fpathCheckSum.getPart(absFile);
|
rccOutputFile += fpathCheckSum.getPart(absFile);
|
||||||
@@ -697,7 +697,7 @@ void cmQtAutoGeneratorInitializer::InitializeAutogenTarget(
|
|||||||
|
|
||||||
if (target->GetPropertyAsBool("AUTOMOC")) {
|
if (target->GetPropertyAsBool("AUTOMOC")) {
|
||||||
// Register moc compilation file as generated
|
// Register moc compilation file as generated
|
||||||
autogenOutputFiles.push_back ( autogenBuildDir + "moc_compilation.cpp" );
|
autogenOutputFiles.push_back(autogenBuildDir + "moc_compilation.cpp");
|
||||||
}
|
}
|
||||||
|
|
||||||
// Initialize autogen target dependencies
|
// Initialize autogen target dependencies
|
||||||
@@ -770,35 +770,33 @@ void cmQtAutoGeneratorInitializer::InitializeAutogenTarget(
|
|||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
bool const isNinja = lg->GetGlobalGenerator()->GetName() == "Ninja";
|
if (target->GetPropertyAsBool("AUTORCC")) {
|
||||||
if (isNinja
|
cmFilePathChecksum fpathCheckSum(makefile);
|
||||||
#if defined(_WIN32) && !defined(__CYGWIN__)
|
std::vector<cmSourceFile*> srcFiles;
|
||||||
|| usePRE_BUILD
|
target->GetConfigCommonSourceFiles(srcFiles);
|
||||||
#endif
|
for (std::vector<cmSourceFile*>::const_iterator fileIt = srcFiles.begin();
|
||||||
) {
|
fileIt != srcFiles.end(); ++fileIt) {
|
||||||
if (target->GetPropertyAsBool("AUTORCC")) {
|
cmSourceFile* sf = *fileIt;
|
||||||
cmFilePathChecksum fpathCheckSum(makefile);
|
if (sf->GetExtension() == "qrc" &&
|
||||||
std::vector<cmSourceFile*> srcFiles;
|
!cmSystemTools::IsOn(sf->GetPropertyForUser("SKIP_AUTORCC"))) {
|
||||||
target->GetConfigCommonSourceFiles(srcFiles);
|
{
|
||||||
for (std::vector<cmSourceFile*>::const_iterator fileIt =
|
const std::string absFile =
|
||||||
srcFiles.begin();
|
cmsys::SystemTools::GetRealPath(sf->GetFullPath());
|
||||||
fileIt != srcFiles.end(); ++fileIt) {
|
|
||||||
cmSourceFile* sf = *fileIt;
|
|
||||||
if (sf->GetExtension() == "qrc" &&
|
|
||||||
!cmSystemTools::IsOn(sf->GetPropertyForUser("SKIP_AUTORCC"))) {
|
|
||||||
{
|
|
||||||
const std::string absFile =
|
|
||||||
cmsys::SystemTools::GetRealPath(sf->GetFullPath());
|
|
||||||
|
|
||||||
std::string rccOutputFile = GetAutogenTargetBuildDir(target);
|
std::string rccOutputFile = autogenBuildDir;
|
||||||
rccOutputFile += fpathCheckSum.getPart(absFile);
|
rccOutputFile += fpathCheckSum.getPart(absFile);
|
||||||
rccOutputFile += "/qrc_";
|
rccOutputFile += "/qrc_";
|
||||||
rccOutputFile +=
|
rccOutputFile +=
|
||||||
cmsys::SystemTools::GetFilenameWithoutLastExtension(absFile);
|
cmsys::SystemTools::GetFilenameWithoutLastExtension(absFile);
|
||||||
rccOutputFile += ".cpp";
|
rccOutputFile += ".cpp";
|
||||||
// Register rcc output file as generated
|
// Register rcc output file as generated
|
||||||
autogenOutputFiles.push_back(rccOutputFile);
|
autogenOutputFiles.push_back(rccOutputFile);
|
||||||
}
|
}
|
||||||
|
if (lg->GetGlobalGenerator()->GetName() == "Ninja"
|
||||||
|
#if defined(_WIN32) && !defined(__CYGWIN__)
|
||||||
|
|| usePRE_BUILD
|
||||||
|
#endif
|
||||||
|
) {
|
||||||
if (!cmSystemTools::IsOn(sf->GetPropertyForUser("GENERATED"))) {
|
if (!cmSystemTools::IsOn(sf->GetPropertyForUser("GENERATED"))) {
|
||||||
RccListInputs(qtMajorVersion, sf, target, depends);
|
RccListInputs(qtMajorVersion, sf, target, depends);
|
||||||
#if defined(_WIN32) && !defined(__CYGWIN__)
|
#if defined(_WIN32) && !defined(__CYGWIN__)
|
||||||
|
|||||||
Reference in New Issue
Block a user