-def writeCmakeRulesFile(f, config):
- print >>f, "%:"
- print >>f, "\tdh $@ --buildsystem cmake --parallel --builddirectory=build.dir" # "build" is not a good idea, as that's also the name of a target...
- print >>f, ""
- print >>f, "override_dh_auto_configure:"
- print >>f, "\tmkdir -p build.dir"
- print >>f, "\tcd build.dir && cmake ..",' '.join(['-DCMAKE_INSTALL_PREFIX=/usr', '-DCMAKE_BUILD_TYPE=Release'] + config.get('cmakeParameters', []))
- print >>f, ""
- print >>f, "override_dh_auto_clean:"
- print >>f, " rm -f build.dir/CMakeCache.txt # clean old cmake cache"
- print >>f, ""
+def cmakeRules(config):
+ r = RulesFile()
+ r.dh += ["--buildsystem=cmake", "--builddirectory=build.dir"] # dh parameters: "build" is not a good idea, as that's also the name of a target...
+ r.rules['auto_configure'] = [
+ 'mkdir -p build.dir',
+ "cd build.dir && cmake .. "+' '.join(['-DCMAKE_INSTALL_PREFIX=/usr', '-DCMAKE_BUILD_TYPE=Release'] + config.get('cmakeParameters', []))
+ ]
+ r.rules['auto_clean'] = ['rm -f build.dir/CMakeCache.txt'] # clean old cmake cache
+ return r