diff options
author | Richard Dale <richard.dale@codethink.co.uk> | 2013-05-21 11:11:04 +0100 |
---|---|---|
committer | Richard Dale <richard.dale@codethink.co.uk> | 2013-05-29 16:13:48 +0100 |
commit | 70f21759d03cfc930d26f8abac0d56a8279276b8 (patch) | |
tree | 54fd95dd8450536cc8c359498227c52ce5964a2d /morphlib/buildsystem.py | |
parent | 5a29d98c43fdb637947af893b8604b5d6adcd113 (diff) | |
download | morph-70f21759d03cfc930d26f8abac0d56a8279276b8.tar.gz |
Add detection for cmake and qmake build systems
Add tests for cmake and qmake build systems
Diffstat (limited to 'morphlib/buildsystem.py')
-rw-r--r-- | morphlib/buildsystem.py | 57 |
1 files changed, 57 insertions, 0 deletions
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(), ] |