lib/autobuild/packages/cmake.rb in autobuild-1.1 vs lib/autobuild/packages/cmake.rb in autobuild-1.2
- old
+ new
@@ -13,11 +13,14 @@
raise ConfigException, "builddir must be non-nil and non-empty" if (new.nil? || new.empty?)
@builddir = new
end
end
+ # a key => value association of defines for CMake
attr_reader :defines
+ # If true, always run cmake before make during the build
+ attr_accessor :always_reconfigure
def configurestamp; File.join(builddir, "CMakeCache.txt") end
def initialize(options)
@defines = Hash.new
@@ -70,9 +73,12 @@
end
# Do the build in builddir
def build
Dir.chdir(builddir) do
+ if always_reconfigure
+ Subprocess.run(name, 'build', Autobuild.tool(:cmake), '.')
+ end
Subprocess.run(name, 'build', Autobuild.tool(:make))
end
touch_stamp(buildstamp)
end