--- a/Source/cmMakefile.cxx~ 2017-09-07 19:14:26.000000000 +0300 +++ b/Source/cmMakefile.cxx 2017-10-23 12:55:36.616269687 +0300 @@ -3359,6 +3359,25 @@ std::string cmMakefile::GetModulesFile(c } } + { + const char* cmakeModulePathFallback = "/usr/share/CMake/Modules"; + std::vector modulePath; + cmExpandList(cmakeModulePathFallback, modulePath); + + // Look through the possible module directories. + for (std::vector::iterator i = modulePath.begin(); + i != modulePath.end(); ++i) { + std::string itempl = *i; + cmSystemTools::ConvertToUnixSlashes(itempl); + itempl += "/"; + itempl += filename; + if (cmSystemTools::FileExists(itempl.c_str())) { + moduleInCMakeModulePath = itempl; + break; + } + } + } + // Always search in the standard modules location. moduleInCMakeRoot = cmSystemTools::GetCMakeRoot(); moduleInCMakeRoot += "/Modules/";