diff options
Diffstat (limited to 'Source/cmCommandArgumentParserHelper.cxx')
-rw-r--r-- | Source/cmCommandArgumentParserHelper.cxx | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/Source/cmCommandArgumentParserHelper.cxx b/Source/cmCommandArgumentParserHelper.cxx index c0a8127..54af13b 100644 --- a/Source/cmCommandArgumentParserHelper.cxx +++ b/Source/cmCommandArgumentParserHelper.cxx @@ -132,8 +132,9 @@ char* cmCommandArgumentParserHelper::ExpandVariable(const char* var) { const char* srcRoot = this->Makefile->GetDefinition("CMAKE_SOURCE_DIR"); const char* binRoot = this->Makefile->GetDefinition("CMAKE_BINARY_DIR"); - if (this->CheckSystemVars || strstr(this->FileName, srcRoot) == this->FileName || - strstr(this->FileName, binRoot) == this->FileName) + if (this->CheckSystemVars || + cmSystemTools::IsSubDirectory(this->FileName, this->Makefile->GetHomeDirectory()) || + cmSystemTools::IsSubDirectory(this->FileName, this->Makefile->GetHomeOutputDirectory())) { cmOStringStream msg; msg << this->FileName << ":" << this->FileLine << ":" << |