+def cmakeRules(config):
+ buildDir = config.get('buildDir', 'build.dir') # "build" is not a good idea, as that's also the name of a target...
+ srcDir = os.getcwd()
+ r = RulesFile()
+ r.dh += ["--buildsystem=cmake", "--builddirectory="+buildDir] # dh parameters
+ r.rules['auto_configure'] = [
+ safeCall("mkdir", "-p", buildDir),
+ safeCall("cd", buildDir) + " && " +
+ safeCall("cmake", srcDir, "-DCMAKE_INSTALL_PREFIX=/usr", *config.get('cmakeParameters', []))
+ ]
+ r.rules['auto_clean'] = [safeCall('rm', '-f', os.path.join(buildDir, 'CMakeCache.txt'))] # clean old cmake cache
+ return r
+
+def automakeRules(config):
+ # "build" is what we are building *on*, and "host" is what we are building *for* (and GNU is weird...)
+ # also, we don't really support cross-building... ;-) (to do, we'd have to write shell code that checks whether BUILD_GNU_TYPE
+ # and HOST_GNU_TYPE are equal, and if they are not, add a --host parameter)