lib/autobuild/packages/cmake.rb in autobuild-1.5.3 vs lib/autobuild/packages/cmake.rb in autobuild-1.5.4
- old
+ new
@@ -42,11 +42,12 @@
else
@full_reconfigures
end
end
- def configurestamp; File.join(builddir, "CMakeCache.txt") end
+ def cmake_cache; File.join(builddir, "CMakeCache.txt") end
+ def configurestamp; cmake_cache end
def initialize(options)
@defines = Hash.new
super
end
@@ -103,17 +104,17 @@
# A failed initial CMake configuration leaves a CMakeCache.txt file,
# but no Makefile.
#
# Delete the CMakeCache to force reconfiguration
if !File.exists?( File.join(builddir, 'Makefile') )
- FileUtils.rm_f configurestamp
+ FileUtils.rm_f cmake_cache
end
- if File.exists?(configurestamp)
+ if File.exists?(cmake_cache)
all_defines = defines.dup
all_defines['CMAKE_INSTALL_PREFIX'] = prefix
- cache = File.read(configurestamp)
+ cache = File.read(cmake_cache)
did_change = all_defines.any? do |name, value|
cache_line = cache.each_line.find do |line|
line =~ /^#{name}:/
end
@@ -129,11 +130,11 @@
end
if did_change
if Autobuild.debug
puts "CMake configuration changed, forcing a reconfigure"
end
- FileUtils.rm_f configurestamp
+ FileUtils.rm_f cmake_cache
end
end
super
end
@@ -148,10 +149,10 @@
end
command << srcdir
progress "generating and configuring build system for %s"
if full_reconfigures?
- FileUtils.rm_f configurestamp
+ FileUtils.rm_f cmake_cache
end
Subprocess.run(self, 'configure', *command)
end
end
end