cmSourceFile: Cache the isUiFile check
The filename extension call is expensive, so cache the .ui check.
This commit is contained in:
parent
14e7a8ae1c
commit
10baf00f3d
|
@ -24,6 +24,8 @@ cmSourceFile::cmSourceFile(cmMakefile* mf, const std::string& name):
|
||||||
this->CustomCommand = 0;
|
this->CustomCommand = 0;
|
||||||
this->Properties.SetCMakeInstance(mf->GetCMakeInstance());
|
this->Properties.SetCMakeInstance(mf->GetCMakeInstance());
|
||||||
this->FindFullPathFailed = false;
|
this->FindFullPathFailed = false;
|
||||||
|
this->IsUiFile = ("ui" ==
|
||||||
|
cmSystemTools::GetFilenameLastExtension(this->Location.GetName()));
|
||||||
}
|
}
|
||||||
|
|
||||||
//----------------------------------------------------------------------------
|
//----------------------------------------------------------------------------
|
||||||
|
@ -297,9 +299,7 @@ void cmSourceFile::SetProperty(const std::string& prop, const char* value)
|
||||||
{
|
{
|
||||||
this->Properties.SetProperty(prop, value, cmProperty::SOURCE_FILE);
|
this->Properties.SetProperty(prop, value, cmProperty::SOURCE_FILE);
|
||||||
|
|
||||||
std::string ext =
|
if (this->IsUiFile)
|
||||||
cmSystemTools::GetFilenameLastExtension(this->Location.GetName());
|
|
||||||
if (ext == ".ui")
|
|
||||||
{
|
{
|
||||||
cmMakefile const* mf = this->Location.GetMakefile();
|
cmMakefile const* mf = this->Location.GetMakefile();
|
||||||
if (prop == "AUTOUIC_OPTIONS")
|
if (prop == "AUTOUIC_OPTIONS")
|
||||||
|
|
|
@ -109,6 +109,7 @@ private:
|
||||||
std::string FullPath;
|
std::string FullPath;
|
||||||
bool FindFullPathFailed;
|
bool FindFullPathFailed;
|
||||||
std::string ObjectLibrary;
|
std::string ObjectLibrary;
|
||||||
|
bool IsUiFile;
|
||||||
|
|
||||||
bool FindFullPath(std::string* error);
|
bool FindFullPath(std::string* error);
|
||||||
bool TryFullPath(const std::string& path, const std::string& ext);
|
bool TryFullPath(const std::string& path, const std::string& ext);
|
||||||
|
|
Loading…
Reference in New Issue