From 70f21759d03cfc930d26f8abac0d56a8279276b8 Mon Sep 17 00:00:00 2001 From: Richard Dale Date: Tue, 21 May 2013 11:11:04 +0100 Subject: Add detection for cmake and qmake build systems Add tests for cmake and qmake build systems --- morphlib/buildsystem.py | 57 +++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 57 insertions(+) (limited to 'morphlib/buildsystem.py') diff --git a/morphlib/buildsystem.py b/morphlib/buildsystem.py index a6645eb2..90cc15c2 100644 --- a/morphlib/buildsystem.py +++ b/morphlib/buildsystem.py @@ -197,12 +197,69 @@ class CPANBuildSystem(BuildSystem): return any(x in file_list for x in indicators) +class CMakeBuildSystem(BuildSystem): + + '''The cmake build system.''' + + name = 'cmake' + + def __init__(self): + BuildSystem.__init__(self) + self.configure_commands = [ + 'cmake -DCMAKE_INSTALL_PREFIX=/usr' + ] + self.build_commands = [ + 'make', + ] + self.test_commands = [ + ] + self.install_commands = [ + 'make DESTDIR="$DESTDIR" install', + ] + + def used_by_project(self, file_list): + indicators = [ + 'CMakeLists.txt', + ] + + return any(x in file_list for x in indicators) + +class QMakeBuildSystem(BuildSystem): + + '''The Qt build system.''' + + name = 'qmake' + + def __init__(self): + BuildSystem.__init__(self) + self.configure_commands = [ + 'qmake -makefile ' + ] + self.build_commands = [ + 'make', + ] + self.test_commands = [ + ] + self.install_commands = [ + 'make INSTALL_ROOT="$DESTDIR" install', + ] + + def used_by_project(self, file_list): + indicator = '.pro' + + for x in file_list: + if x.endswith(indicator): + return True + + return False build_systems = [ ManualBuildSystem(), AutotoolsBuildSystem(), PythonDistutilsBuildSystem(), CPANBuildSystem(), + CMakeBuildSystem(), + QMakeBuildSystem(), DummyBuildSystem(), ] -- cgit v1.2.1