SHA256
3
0
forked from pool/cmake

Accepting request 440360 from devel:tools:building

1

OBS-URL: https://build.opensuse.org/request/show/440360
OBS-URL: https://build.opensuse.org/package/show/openSUSE:Factory/cmake?expand=0&rev=127
This commit is contained in:
Dominique Leuenberger 2016-11-16 12:47:30 +00:00 committed by Git OBS Bridge
commit f53097be63
2 changed files with 23 additions and 19 deletions

View File

@ -1,3 +1,12 @@
-------------------------------------------------------------------
Tue Nov 15 08:23:14 UTC 2016 - alarrosa@suse.com
- Fix cmake.prov to report all cmake Config modules provided in a single
cmake directory instead of just returning the first one given by a
shell glob (which could be different across builds). Also, include
upper and lowercase files always instead of including lowercase files
only when no uppercase files were found.
-------------------------------------------------------------------
Sun Sep 25 00:21:58 UTC 2016 - jimmy@boombatower.com

View File

@ -31,35 +31,30 @@ class CMakeParser:
paths = map(lambda x: x.rstrip(), filelist.readlines())
for path in paths:
modulePath, cmakeModule, lowercase = self.parseCmakeModuleConfig(path)
if modulePath and cmakeModule:
version = self.resolveCMakeModuleVersion(modulePath, cmakeModule, lowercase)
for (modulePath, cmakeModule, lowercase) in self.parseCmakeModuleConfig(path):
version = self.resolveCMakeModuleVersion(modulePath, cmakeModule, lowercase)
if version:
print("cmake(%s) = %s" % (cmakeModule, version))
print("cmake(%s) = %s" % (cmakeModule, version))
else:
print("cmake(%s)" % cmakeModule)
print("cmake(%s)" % cmakeModule)
def parseCmakeModuleConfig(self, configFile):
paths = configFile.rsplit("/", 3)
modulePath = "%s/cmake/%s" % (paths[0], paths[2])
lowercase = False
configFile = glob.glob("%s/*Config.cmake" % modulePath)
if not configFile:
configFile = glob.glob("%s/*-config.cmake" % modulePath)
lowercase = True
if not configFile:
return (None, None)
result = []
for configFile in glob.glob("%s/*Config.cmake" % modulePath):
moduleName = configFile[len(modulePath) + 1:-len("Config.cmake")]
result.append( (modulePath, moduleName, False) )
if lowercase:
moduleName = configFile[0][len(modulePath) + 1:-len("-config.cmake")]
else:
moduleName = configFile[0][len(modulePath) + 1:-len("Config.cmake")]
for configFile in glob.glob("%s/*-config.cmake" % modulePath):
moduleName = configFile[len(modulePath) + 1:-len("-config.cmake")]
if (modulePath, moduleName, False) not in result:
result.append( (modulePath, moduleName, True) )
return (modulePath, moduleName, lowercase)
return result
def resolveCMakeModuleVersion(self, modulePath, cmakeModule, lowercase):
versionFile = ("%s/%s-config-version.cmake" if lowercase else "%s/%sConfigVersion.cmake") % (modulePath, cmakeModule)