mirror of
https://github.com/Kitware/CMake.git
synced 2026-02-08 08:09:42 -06:00
AutoRcc: Rebuild if the rcc executable is newer than its output
In AUTORCC add a test if the rcc executable is newer that the rcc output. If the rcc executable is newer, rebuild the output.
This commit is contained in:
@@ -75,6 +75,13 @@ bool cmQtAutoRcc::Init(cmMakefile* makefile)
|
||||
|
||||
// - Rcc executable
|
||||
RccExecutable_ = InfoGet("ARCC_RCC_EXECUTABLE");
|
||||
if (!RccExecutableTime_.Load(RccExecutable_)) {
|
||||
std::string error = "The rcc executable ";
|
||||
error += Quoted(RccExecutable_);
|
||||
error += " does not exist.";
|
||||
Log().ErrorFile(GenT::RCC, InfoFile(), error);
|
||||
return false;
|
||||
}
|
||||
RccListOptions_ = InfoGetList("ARCC_RCC_LIST_OPTIONS");
|
||||
|
||||
// - Job
|
||||
@@ -336,6 +343,18 @@ bool cmQtAutoRcc::TestQrcRccFiles(bool& generate)
|
||||
return true;
|
||||
}
|
||||
|
||||
// Test if the rcc output file is older than the rcc executable
|
||||
if (RccFileTime_.Older(RccExecutableTime_)) {
|
||||
if (Log().Verbose()) {
|
||||
Reason = "Generating ";
|
||||
Reason += Quoted(RccFileOutput_);
|
||||
Reason += ", because it is older than the rcc executable, from ";
|
||||
Reason += Quoted(QrcFile_);
|
||||
}
|
||||
generate = true;
|
||||
return true;
|
||||
}
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
|
||||
@@ -54,6 +54,7 @@ private:
|
||||
std::string IncludeDir_;
|
||||
// -- Qt environment
|
||||
std::string RccExecutable_;
|
||||
cmFileTime RccExecutableTime_;
|
||||
std::vector<std::string> RccListOptions_;
|
||||
// -- Job
|
||||
std::string LockFile_;
|
||||
|
||||
Reference in New Issue
Block a user