diff --git a/Rakefile b/Rakefile index 41ef5aeb4..0712ad2ba 100644 --- a/Rakefile +++ b/Rakefile @@ -1163,6 +1163,8 @@ if $build_mkvtoolnix_gui qrc = [ "src/mkvtoolnix-gui/qt_resources.qrc" ] qrc << "lib/QDarkStyleSheet/qdarkstyle/style.qrc" if $building_for[:windows] + add_qrc_dependencies(*qrc) + file "src/mkvtoolnix-gui/qt_resources.cpp" => qrc, &qrc_compiler Application.new("src/mkvtoolnix-gui/mkvtoolnix-gui"). diff --git a/rake.d/helpers.rb b/rake.d/helpers.rb index fde8267f9..2d57c0580 100644 --- a/rake.d/helpers.rb +++ b/rake.d/helpers.rb @@ -287,6 +287,19 @@ def update_version_number_include end end +def add_qrc_dependencies *qrcs + qrc_content = read_files(*qrcs) + qrc_content.each do |file_name, content| + dir = file_name.gsub(%r{[^/]+$}, '') + dependencies = content. + join(''). + scan(%r{]*>([^<]+)}). + map { |matches| dir + matches[0] } + + file file_name => dependencies + end +end + class Rake::Task def mo_all_prerequisites todo = [name]