if(BUILD_TESTING)
    add_subdirectory(autotests)
endif()
add_subdirectory(ms-tnef)
add_subdirectory(vcard)
add_subdirectory(highlighter)
add_subdirectory(calendar)
add_subdirectory(gnupgwks)
add_subdirectory(pkpass)
add_subdirectory(itinerary)

if (Qt5Widgets_VERSION VERSION_LESS 5.14.0)
    set(USE_DISCOUNT_LIB TRUE)
    if(discount_FOUND)
        MESSAGE(STATUS "build bodyparformatter mardown with discount support")
        add_subdirectory(markdown)
    else()
        message(STATUS "Markdown plugin not supported before qt 5.14.0")
    endif()
else()
    option(FORCE_DISCOUNT_LIB "Force using discount lib for markdown bodyformatter." TRUE)
    if (FORCE_DISCOUNT_LIB AND discount_FOUND)
        set(USE_DISCOUNT_LIB TRUE)
        MESSAGE(STATUS "build bodyparformatter mardown with discount support")
        add_subdirectory(markdown)
    else()
        set(USE_DISCOUNT_LIB FALSE)
        MESSAGE(STATUS "build bodyparformatter mardown with QTextDocument support")
        add_subdirectory(markdown)
    endif()
endif()
