diff options
Diffstat (limited to 'Source/cmSourceFile.cxx')
-rw-r--r-- | Source/cmSourceFile.cxx | 12 |
1 files changed, 7 insertions, 5 deletions
diff --git a/Source/cmSourceFile.cxx b/Source/cmSourceFile.cxx index 0ab30a2..b833d3f 100644 --- a/Source/cmSourceFile.cxx +++ b/Source/cmSourceFile.cxx @@ -24,6 +24,8 @@ cmSourceFile::cmSourceFile(cmMakefile* mf, const std::string& name): this->CustomCommand = 0; this->Properties.SetCMakeInstance(mf->GetCMakeInstance()); this->FindFullPathFailed = false; + this->IsUiFile = ("ui" == + cmSystemTools::GetFilenameLastExtension(this->Location.GetName())); } //---------------------------------------------------------------------------- @@ -38,6 +40,8 @@ std::string const& cmSourceFile::GetExtension() const return this->Extension; } +const std::string cmSourceFile::propLANGUAGE = "LANGUAGE"; + //---------------------------------------------------------------------------- void cmSourceFile::SetObjectLibrary(std::string const& objlib) { @@ -54,7 +58,7 @@ std::string cmSourceFile::GetObjectLibrary() const std::string cmSourceFile::GetLanguage() { // If the language was set explicitly by the user then use it. - if(const char* lang = this->GetProperty("LANGUAGE")) + if(const char* lang = this->GetProperty(propLANGUAGE)) { return lang; } @@ -91,7 +95,7 @@ std::string cmSourceFile::GetLanguage() std::string cmSourceFile::GetLanguage() const { // If the language was set explicitly by the user then use it. - if(const char* lang = this->GetProperty("LANGUAGE")) + if(const char* lang = this->GetProperty(propLANGUAGE)) { return lang; } @@ -297,9 +301,7 @@ void cmSourceFile::SetProperty(const std::string& prop, const char* value) { this->Properties.SetProperty(prop, value, cmProperty::SOURCE_FILE); - std::string ext = - cmSystemTools::GetFilenameLastExtension(this->Location.GetName()); - if (ext == ".ui") + if (this->IsUiFile) { cmMakefile const* mf = this->Location.GetMakefile(); if (prop == "AUTOUIC_OPTIONS") |