build system: build Qt translation files on MingW

This commit is contained in:
Moritz Bunkus 2015-06-03 20:06:34 +02:00
parent 75f2cdd6f9
commit 479f5d3670
4 changed files with 16 additions and 1 deletions

1
.gitignore vendored
View File

@ -44,6 +44,7 @@
/lib/saxon-he
/po/*.mo
/po/mkvtoolnix.pot
/po/qt/*.qm
/rake.d/dependency.d
/share/icons/*/*.h
/src/common/common.h.gch

View File

@ -173,6 +173,9 @@ def define_default_task
# The GUI help
targets << "translations:guides" if c?(:USE_WXWIDGETS)
# The Qt translation files: only for Windows
targets << "translations:qt" if c?(:MINGW) && !c(:LCONVERT).blank?
task :default => targets do
puts "Done. Enjoy :)"
end
@ -251,6 +254,12 @@ rule '.mo' => '.po' do |t|
runq " MSGFMT #{t.source}", "msgfmt -c -o #{t.name} #{t.sources.join(" ")}"
end
if !c(:LCONVERT).blank?
rule '.qm' => '.ts' do |t|
runq "LCONVERT #{t.source}", "#{c(:LCONVERT)} -o #{t.name} -i #{t.sources.join(" ")}"
end
end
# HTML help book stuff
rule '.hhk' => '.hhc' do |t|
runq " GREP #{t.source}", "#{c(:GREP)} -v 'name=\"ID\"' #{t.sources.join(" ")} > #{t.name}"
@ -401,6 +410,8 @@ EOT
[ :applications, :manpages, :guides ].each { |type| task type => $translations[type] }
task :qt => FileList[ "#{$top_srcdir }/po/qt/*.ts" ].collect { |file| file.ext 'qm' }
$available_languages[:manpages].each do |language|
$manpages.each do |manpage|
name = manpage.gsub(/man\//, "man/#{language}/")
@ -643,7 +654,7 @@ task :clean do
share/icons/*x*/*.h
src/info/ui/*.h src/mkvtoolnix-gui/forms/**/*.h src/**/*.moc src/**/*.moco src/mkvtoolnix-gui/qt_resources.cpp
tests/unit/**/*.o tests/unit/**/*.a tests/unit/all
po/*.mo doc/guide/**/*.hhk
po/*.mo po/qt/*.qm doc/guide/**/*.hhk
}
patterns += $applications + $tools.collect { |name| "src/tools/#{name}" }

View File

@ -228,6 +228,8 @@ return 0;
BUILD_MKVTOOLNIX_GUI=no
fi
AC_PATH_PROG(LCONVERT, lconvert)
else
echo '*** Not checking for Qt: disabled by user request'
fi

View File

@ -55,6 +55,7 @@ INSTALL_SCRIPT = @INSTALL_SCRIPT@
install_sh_DATA = $(install_sh) -c -m 644
install_sh_PROGRAM = $(install_sh) -c
install_sh_SCRIPT = $(install_sh) -c
LCONVERT = @LCONVERT@
LD = @LD@
MOC = @MOC@
OBJEXT = @OBJEXT@