|
@@ -49,7 +49,8 @@ bool HandleSourceMode(cmExecutionStatus& status, const std::string& name,
|
|
|
bool source_file_paths_should_be_absolute);
|
|
bool source_file_paths_should_be_absolute);
|
|
|
bool HandleTestMode(cmExecutionStatus& status, const std::string& name,
|
|
bool HandleTestMode(cmExecutionStatus& status, const std::string& name,
|
|
|
OutType infoType, const std::string& variable,
|
|
OutType infoType, const std::string& variable,
|
|
|
- const std::string& propertyName);
|
|
|
|
|
|
|
+ const std::string& propertyName,
|
|
|
|
|
+ cmMakefile& directory_makefile);
|
|
|
bool HandleVariableMode(cmExecutionStatus& status, const std::string& name,
|
|
bool HandleVariableMode(cmExecutionStatus& status, const std::string& name,
|
|
|
OutType infoType, const std::string& variable,
|
|
OutType infoType, const std::string& variable,
|
|
|
const std::string& propertyName);
|
|
const std::string& propertyName);
|
|
@@ -81,6 +82,9 @@ bool cmGetPropertyCommand(std::vector<std::string> const& args,
|
|
|
bool source_file_directory_option_enabled = false;
|
|
bool source_file_directory_option_enabled = false;
|
|
|
bool source_file_target_option_enabled = false;
|
|
bool source_file_target_option_enabled = false;
|
|
|
|
|
|
|
|
|
|
+ std::string test_directory;
|
|
|
|
|
+ bool test_directory_option_enabled = false;
|
|
|
|
|
+
|
|
|
// Get the scope from which to get the property.
|
|
// Get the scope from which to get the property.
|
|
|
cmProperty::ScopeType scope;
|
|
cmProperty::ScopeType scope;
|
|
|
if (args[1] == "GLOBAL") {
|
|
if (args[1] == "GLOBAL") {
|
|
@@ -116,7 +120,8 @@ bool cmGetPropertyCommand(std::vector<std::string> const& args,
|
|
|
DoingProperty,
|
|
DoingProperty,
|
|
|
DoingType,
|
|
DoingType,
|
|
|
DoingSourceDirectory,
|
|
DoingSourceDirectory,
|
|
|
- DoingSourceTargetDirectory
|
|
|
|
|
|
|
+ DoingSourceTargetDirectory,
|
|
|
|
|
+ DoingTestDirectory,
|
|
|
};
|
|
};
|
|
|
Doing doing = DoingName;
|
|
Doing doing = DoingName;
|
|
|
for (unsigned int i = 2; i < args.size(); ++i) {
|
|
for (unsigned int i = 2; i < args.size(); ++i) {
|
|
@@ -145,12 +150,19 @@ bool cmGetPropertyCommand(std::vector<std::string> const& args,
|
|
|
args[i] == "TARGET_DIRECTORY") {
|
|
args[i] == "TARGET_DIRECTORY") {
|
|
|
doing = DoingSourceTargetDirectory;
|
|
doing = DoingSourceTargetDirectory;
|
|
|
source_file_target_option_enabled = true;
|
|
source_file_target_option_enabled = true;
|
|
|
|
|
+ } else if (doing == DoingNone && scope == cmProperty::TEST &&
|
|
|
|
|
+ args[i] == "DIRECTORY") {
|
|
|
|
|
+ doing = DoingTestDirectory;
|
|
|
|
|
+ test_directory_option_enabled = true;
|
|
|
} else if (doing == DoingSourceDirectory) {
|
|
} else if (doing == DoingSourceDirectory) {
|
|
|
source_file_directories.push_back(args[i]);
|
|
source_file_directories.push_back(args[i]);
|
|
|
doing = DoingNone;
|
|
doing = DoingNone;
|
|
|
} else if (doing == DoingSourceTargetDirectory) {
|
|
} else if (doing == DoingSourceTargetDirectory) {
|
|
|
source_file_target_directories.push_back(args[i]);
|
|
source_file_target_directories.push_back(args[i]);
|
|
|
doing = DoingNone;
|
|
doing = DoingNone;
|
|
|
|
|
+ } else if (doing == DoingTestDirectory) {
|
|
|
|
|
+ test_directory = args[i];
|
|
|
|
|
+ doing = DoingNone;
|
|
|
} else if (doing == DoingProperty) {
|
|
} else if (doing == DoingProperty) {
|
|
|
doing = DoingNone;
|
|
doing = DoingNone;
|
|
|
propertyName = args[i];
|
|
propertyName = args[i];
|
|
@@ -167,12 +179,17 @@ bool cmGetPropertyCommand(std::vector<std::string> const& args,
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
std::vector<cmMakefile*> source_file_directory_makefiles;
|
|
std::vector<cmMakefile*> source_file_directory_makefiles;
|
|
|
- bool file_scopes_handled =
|
|
|
|
|
|
|
+ bool source_file_scopes_handled =
|
|
|
SetPropertyCommand::HandleAndValidateSourceFileDirectoryScopes(
|
|
SetPropertyCommand::HandleAndValidateSourceFileDirectoryScopes(
|
|
|
status, source_file_directory_option_enabled,
|
|
status, source_file_directory_option_enabled,
|
|
|
source_file_target_option_enabled, source_file_directories,
|
|
source_file_target_option_enabled, source_file_directories,
|
|
|
source_file_target_directories, source_file_directory_makefiles);
|
|
source_file_target_directories, source_file_directory_makefiles);
|
|
|
- if (!file_scopes_handled) {
|
|
|
|
|
|
|
+ cmMakefile* test_directory_makefile;
|
|
|
|
|
+ bool test_scopes_handled =
|
|
|
|
|
+ SetPropertyCommand::HandleAndValidateTestDirectoryScopes(
|
|
|
|
|
+ status, test_directory_option_enabled, test_directory,
|
|
|
|
|
+ test_directory_makefile);
|
|
|
|
|
+ if (!(source_file_scopes_handled && test_scopes_handled)) {
|
|
|
return false;
|
|
return false;
|
|
|
}
|
|
}
|
|
|
|
|
|
|
@@ -231,7 +248,8 @@ bool cmGetPropertyCommand(std::vector<std::string> const& args,
|
|
|
directory_scope_mf,
|
|
directory_scope_mf,
|
|
|
source_file_paths_should_be_absolute);
|
|
source_file_paths_should_be_absolute);
|
|
|
case cmProperty::TEST:
|
|
case cmProperty::TEST:
|
|
|
- return HandleTestMode(status, name, infoType, variable, propertyName);
|
|
|
|
|
|
|
+ return HandleTestMode(status, name, infoType, variable, propertyName,
|
|
|
|
|
+ *test_directory_makefile);
|
|
|
case cmProperty::VARIABLE:
|
|
case cmProperty::VARIABLE:
|
|
|
return HandleVariableMode(status, name, infoType, variable,
|
|
return HandleVariableMode(status, name, infoType, variable,
|
|
|
propertyName);
|
|
propertyName);
|
|
@@ -404,7 +422,7 @@ bool HandleSourceMode(cmExecutionStatus& status, const std::string& name,
|
|
|
|
|
|
|
|
bool HandleTestMode(cmExecutionStatus& status, const std::string& name,
|
|
bool HandleTestMode(cmExecutionStatus& status, const std::string& name,
|
|
|
OutType infoType, const std::string& variable,
|
|
OutType infoType, const std::string& variable,
|
|
|
- const std::string& propertyName)
|
|
|
|
|
|
|
+ const std::string& propertyName, cmMakefile& test_makefile)
|
|
|
{
|
|
{
|
|
|
if (name.empty()) {
|
|
if (name.empty()) {
|
|
|
status.SetError("not given name for TEST scope.");
|
|
status.SetError("not given name for TEST scope.");
|
|
@@ -412,7 +430,7 @@ bool HandleTestMode(cmExecutionStatus& status, const std::string& name,
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
// Loop over all tests looking for matching names.
|
|
// Loop over all tests looking for matching names.
|
|
|
- if (cmTest* test = status.GetMakefile().GetTest(name)) {
|
|
|
|
|
|
|
+ if (cmTest* test = test_makefile.GetTest(name)) {
|
|
|
return StoreResult(infoType, status.GetMakefile(), variable,
|
|
return StoreResult(infoType, status.GetMakefile(), variable,
|
|
|
test->GetProperty(propertyName));
|
|
test->GetProperty(propertyName));
|
|
|
}
|
|
}
|