def applyCmakeCache(self, cmakeCache, current=None): if not self._checkBuildDir(): return bdir = os.path.join(rasync.COGX_ROOT, "BUILD") bfile = os.path.join(bdir, "_initcache.txt") f = open(bfile, "w") f.write(cmakeCache) f.close() procman.xrun_wait("../tools/scripts/cmake-apply . _initcache.txt", workdir=bdir)
def _checkBuildDir(self): bdir = os.path.join(rasync.COGX_ROOT, "BUILD") bfile = os.path.join(bdir, "CMakeCache.txt") if os.path.exists(bfile): return True if not os.path.exists(bdir): try: os.mkdir(bdir) except: return False if not os.path.exists(bdir): return False procman.xrun_wait("cmake ..", workdir=bdir) return os.path.exists(bfile)