# This is a stripped-down version of the test in ../moc/ which tests only that
# relative, ""-style inclusion works (so see ../moc/buildfile for any missing
# information; the primary difference is the use of -I$*_base instead of
# -I$*_root).
#

qt.version = $config.libbuild2_qt_tests.qt

using qt.moc

switch $qt.version
{
  case 0
    libs =
  case 5
    import libs = libQt5Core%lib{Qt5Core}
  case 6
    import libs = libQt6Core%lib{Qt6Core}
}

# Headers and source files.
#
exe{driver}: hxx{source sink} cxx{driver source sink}

# C++ source files generated by moc.
#
exe{driver}: cxx{moc_source}: include = adhoc # Included.
exe{driver}: cxx{moc_sink}                    # Compiled.
exe{driver}: moc{sink}                        # Included.

# Libraries.
#
exe{driver}: $libs

# Generate source files from headers using moc.
#
cxx{moc_source}: hxx{source}
cxx{moc_sink}:   hxx{sink}
moc{sink}:       cxx{sink}

qt.moc.include_with_quotes = true

cxx.poptions += "-I$out_base" "-I$src_base"
