require 'mkmf'

qt_dir         = with_config('qt-dir')
qt_include_dir = qt_dir + '/include/qt' if qt_dir
qt_include_dir = with_config('qt-include-dir', qt_include_dir)
qt_lib_dir     = qt_dir + '/lib' if qt_dir
qt_lib_dir     = with_config('qt-lib-dir', qt_lib_dir)

$CFLAGS = "-I#{qt_include_dir}" if qt_include_dir
$LDFLAGS = "-L#{qt_lib_dir}" if qt_lib_dir

if have_header('qapplication.h') and have_library('qt')
  create_makefile('qt')
end
