[jhbuild] cmake: show an appropriate error if cmake is not in PATH (GNOME bug 655688)



commit 5b19d0bcb7f900481d107816b8f1a274001e2eb7
Author: FrÃdÃric PÃters <fpeters 0d be>
Date:   Sat Oct 8 15:06:17 2011 -0400

    cmake: show an appropriate error if cmake is not in PATH (GNOME bug 655688)

 jhbuild/modtypes/cmake.py |    5 ++++-
 1 files changed, 4 insertions(+), 1 deletions(-)
---
diff --git a/jhbuild/modtypes/cmake.py b/jhbuild/modtypes/cmake.py
index 610f5c5..6da1be7 100644
--- a/jhbuild/modtypes/cmake.py
+++ b/jhbuild/modtypes/cmake.py
@@ -21,9 +21,10 @@ __metaclass__ = type
 
 import os
 
-from jhbuild.errors import BuildStateError
+from jhbuild.errors import BuildStateError, CommandError
 from jhbuild.modtypes import \
      Package, DownloadableModule, register_module_type
+from jhbuild.commands.sanitycheck import inpath
 
 __all__ = [ 'CMakeModule' ]
 
@@ -87,6 +88,8 @@ class CMakeModule(Package, DownloadableModule):
         if not os.path.exists(builddir):
             os.mkdir(builddir)
         prefix = os.path.expanduser(buildscript.config.prefix)
+        if not inpath('cmake', os.environ['PATH'].split(os.pathsep)):
+            raise CommandError(_('%s not found') % 'cmake')
         baseargs = '-DCMAKE_INSTALL_PREFIX=%s -DLIB_INSTALL_DIR=%s -Dlibdir=%s' % (
                         prefix, buildscript.config.libdir, buildscript.config.libdir)
         cmd = 'cmake %s %s %s' % (baseargs, self.get_cmakeargs(), srcdir)



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]