diff options
Diffstat (limited to 'Source/cmFindCommon.cxx')
-rw-r--r-- | Source/cmFindCommon.cxx | 15 |
1 files changed, 13 insertions, 2 deletions
diff --git a/Source/cmFindCommon.cxx b/Source/cmFindCommon.cxx index 7beeda0..97a20ce 100644 --- a/Source/cmFindCommon.cxx +++ b/Source/cmFindCommon.cxx @@ -140,14 +140,25 @@ void cmFindCommon::RerootPaths(std::vector<std::string>& paths) } const char* rootPath = this->Makefile->GetDefinition("CMAKE_FIND_ROOT_PATH"); - if((rootPath == 0) || (strlen(rootPath) == 0)) + const char* osxRootPath = + this->Makefile->GetDefinition("_CMAKE_OSX_SYSROOT_PATH"); + const bool noRootPath = !rootPath || !*rootPath; + const bool noOSXRootPath = !osxRootPath || !*osxRootPath; + if(noRootPath && noOSXRootPath) { return; } // Construct the list of path roots with no trailing slashes. std::vector<std::string> roots; - cmSystemTools::ExpandListArgument(rootPath, roots); + if(rootPath) + { + cmSystemTools::ExpandListArgument(rootPath, roots); + } + if(osxRootPath) + { + roots.push_back(osxRootPath); + } for(std::vector<std::string>::iterator ri = roots.begin(); ri != roots.end(); ++ri) { |