Commit b9d44fc3 authored by Sebastian Holtermann's avatar Sebastian Holtermann
Browse files

cmSourceFile: Additional static property strings

parent 0c61b869
...@@ -32,6 +32,8 @@ std::string const& cmSourceFile::GetExtension() const ...@@ -32,6 +32,8 @@ std::string const& cmSourceFile::GetExtension() const
} }
const std::string cmSourceFile::propLANGUAGE = "LANGUAGE"; const std::string cmSourceFile::propLANGUAGE = "LANGUAGE";
const std::string cmSourceFile::propLOCATION = "LOCATION";
const std::string cmSourceFile::propGENERATED = "GENERATED";
void cmSourceFile::SetObjectLibrary(std::string const& objlib) void cmSourceFile::SetObjectLibrary(std::string const& objlib)
{ {
...@@ -119,7 +121,7 @@ bool cmSourceFile::FindFullPath(std::string* error) ...@@ -119,7 +121,7 @@ bool cmSourceFile::FindFullPath(std::string* error)
// If the file is generated compute the location without checking on // If the file is generated compute the location without checking on
// disk. // disk.
if (this->GetPropertyAsBool("GENERATED")) { if (this->GetPropertyAsBool(propGENERATED)) {
// The file is either already a full path or is relative to the // The file is either already a full path or is relative to the
// build directory for the target. // build directory for the target.
this->Location.DirectoryUseBinary(); this->Location.DirectoryUseBinary();
...@@ -266,7 +268,7 @@ const char* cmSourceFile::GetPropertyForUser(const std::string& prop) ...@@ -266,7 +268,7 @@ const char* cmSourceFile::GetPropertyForUser(const std::string& prop)
// cmSourceFileLocation class to commit to a particular full path to // cmSourceFileLocation class to commit to a particular full path to
// the source file as late as possible. If the users requests the // the source file as late as possible. If the users requests the
// LOCATION property we must commit now. // LOCATION property we must commit now.
if (prop == "LOCATION") { if (prop == propLOCATION) {
// Commit to a location. // Commit to a location.
this->GetFullPath(); this->GetFullPath();
} }
...@@ -278,7 +280,7 @@ const char* cmSourceFile::GetPropertyForUser(const std::string& prop) ...@@ -278,7 +280,7 @@ const char* cmSourceFile::GetPropertyForUser(const std::string& prop)
const char* cmSourceFile::GetProperty(const std::string& prop) const const char* cmSourceFile::GetProperty(const std::string& prop) const
{ {
// Check for computed properties. // Check for computed properties.
if (prop == "LOCATION") { if (prop == propLOCATION) {
if (this->FullPath.empty()) { if (this->FullPath.empty()) {
return nullptr; return nullptr;
} }
......
...@@ -120,6 +120,8 @@ private: ...@@ -120,6 +120,8 @@ private:
void CheckLanguage(std::string const& ext); void CheckLanguage(std::string const& ext);
static const std::string propLANGUAGE; static const std::string propLANGUAGE;
static const std::string propLOCATION;
static const std::string propGENERATED;
}; };
// TODO: Factor out into platform information modules. // TODO: Factor out into platform information modules.
......
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