find_package(Qt6 COMPONENTS DBus QUIET)

add_qtc_plugin(Core
  DEPENDS Qt::PrintSupport Qt::Qml Qt::Gui Qt::GuiPrivate TerminalLib qtkeychain
  PLUGIN_TEST_DEPENDS TextEditor
  PUBLIC_DEPENDS Aggregation ExtensionSystem Utils
  SOURCES
    actionmanager/actioncontainer.cpp
    actionmanager/actioncontainer.h
    actionmanager/actioncontainer_p.h
    actionmanager/actionmanager.cpp
    actionmanager/actionmanager.h
    actionmanager/actionmanager_p.h
    actionmanager/command.cpp
    actionmanager/command.h
    actionmanager/command_p.h
    actionmanager/commandmappings.cpp
    actionmanager/commandmappings.h
    actionsfilter.cpp
    actionsfilter.h
    basefilewizard.cpp
    basefilewizard.h
    basefilewizardfactory.cpp
    basefilewizardfactory.h
    core.qrc
    core_global.h
    coreconstants.h
    coreicons.cpp
    coreicons.h
    corejsextensions.cpp
    corejsextensions.h
    coreplugin.cpp
    coreplugin.h
    coreplugintr.h
    credentialquery.cpp
    credentialquery.h
    customlanguagemodels.cpp
    customlanguagemodels.h
    designmode.cpp
    designmode.h
    dialogs/codecselector.cpp
    dialogs/codecselector.h
    dialogs/externaltoolconfig.cpp
    dialogs/externaltoolconfig.h
    dialogs/filepropertiesdialog.cpp
    dialogs/filepropertiesdialog.h
    dialogs/ioptionspage.cpp
    dialogs/ioptionspage.h
    dialogs/newdialog.cpp
    dialogs/newdialog.h
    dialogs/openwithdialog.cpp
    dialogs/openwithdialog.h
    dialogs/promptoverwritedialog.cpp
    dialogs/promptoverwritedialog.h
    dialogs/readonlyfilesdialog.cpp
    dialogs/readonlyfilesdialog.h
    dialogs/saveitemsdialog.cpp
    dialogs/saveitemsdialog.h
    dialogs/shortcutsettings.cpp
    dialogs/shortcutsettings.h
    diffservice.cpp
    diffservice.h
    documentmanager.cpp
    documentmanager.h
    editmode.cpp
    editmode.h
    editormanager/documentmodel.cpp
    editormanager/documentmodel.h
    editormanager/documentmodel_p.h
    editormanager/editorarea.cpp
    editormanager/editorarea.h
    editormanager/editormanager.cpp
    editormanager/editormanager.h
    editormanager/editormanager_p.h
    editormanager/editorview.cpp
    editormanager/editorview.h
    editormanager/editorwindow.cpp
    editormanager/editorwindow.h
    editormanager/ieditor.cpp
    editormanager/ieditor.h
    editormanager/ieditorfactory.cpp
    editormanager/ieditorfactory.h
    editormanager/ieditorfactory_p.h
    editormanager/openeditorsview.cpp
    editormanager/openeditorsview.h
    editormanager/openeditorswindow.cpp
    editormanager/openeditorswindow.h
    editormanager/systemeditor.cpp
    editormanager/systemeditor.h
    editortoolbar.cpp
    editortoolbar.h
    envvarseparatoraspect.cpp
    envvarseparatoraspect.h
    externaltool.cpp
    externaltool.h
    externaltoolmanager.cpp
    externaltoolmanager.h
    fancyactionbar.cpp
    fancyactionbar.h
    fancyactionbar.qrc
    fancytabwidget.cpp
    fancytabwidget.h
    featureprovider.cpp
    featureprovider.h
    fileutils.cpp
    fileutils.h
    find/basetextfind.cpp
    find/basetextfind.h
    find/currentdocumentfind.cpp
    find/currentdocumentfind.h
    find/find.qrc
    find/findplugin.cpp
    find/findplugin.h
    find/findtoolbar.cpp
    find/findtoolbar.h
    find/findtoolwindow.cpp
    find/findtoolwindow.h
    find/highlightscrollbarcontroller.cpp
    find/highlightscrollbarcontroller.h
    find/ifindfilter.cpp
    find/ifindfilter.h
    find/ifindsupport.cpp
    find/ifindsupport.h
    find/itemviewfind.cpp
    find/itemviewfind.h
    find/minimapcontroller.cpp
    find/minimapcontroller.h
    find/minimapoverlay.cpp
    find/minimapoverlay.h
    find/optionspopup.cpp
    find/optionspopup.h
    find/searchresulthighlighter.cpp
    find/searchresulthighlighter.h
    find/searchresulttreeitemdelegate.cpp
    find/searchresulttreeitemdelegate.h
    find/searchresulttreeitemroles.h
    find/searchresulttreeitems.cpp
    find/searchresulttreeitems.h
    find/searchresulttreemodel.cpp
    find/searchresulttreemodel.h
    find/searchresulttreeview.cpp
    find/searchresulttreeview.h
    find/searchresultwidget.cpp
    find/searchresultwidget.h
    find/searchresultwindow.cpp
    find/searchresultwindow.h
    find/textfindconstants.h
    findplaceholder.cpp
    findplaceholder.h
    foldernavigationwidget.cpp
    foldernavigationwidget.h
    generalsettings.cpp
    generalsettings.h
    generatedfile.cpp
    generatedfile.h
    helpitem.cpp
    helpitem.h
    helpmanager.cpp
    helpmanager.h
    helpmanager_implementation.h
    icontext.cpp
    icontext.h
    icore.cpp
    icore.h
    idocument.cpp
    idocument.h
    idocumentfactory.cpp
    idocumentfactory.h
    ifilewizardextension.h
    imode.cpp
    imode.h
    inavigationwidgetfactory.cpp
    inavigationwidgetfactory.h
    ioutputpane.cpp
    ioutputpane.h
    iversioncontrol.cpp
    iversioncontrol.h
    iwelcomepage.cpp
    iwelcomepage.h
    iwizardfactory.cpp
    iwizardfactory.h
    jsexpander.cpp
    jsexpander.h
    locator/commandlocator.cpp
    locator/commandlocator.h
    locator/directoryfilter.cpp
    locator/directoryfilter.h
    locator/executefilter.cpp
    locator/executefilter.h
    locator/externaltoolsfilter.cpp
    locator/externaltoolsfilter.h
    locator/filesystemfilter.cpp
    locator/filesystemfilter.h
    locator/ilocatorfilter.cpp
    locator/ilocatorfilter.h
    locator/javascriptfilter.cpp
    locator/javascriptfilter.h
    locator/locator.cpp
    locator/locator.h
    locator/locatorconstants.h
    locator/locatorfiltersfilter.cpp
    locator/locatorfiltersfilter.h
    locator/locatormanager.cpp
    locator/locatormanager.h
    locator/locatorsettingspage.cpp
    locator/locatorsettingspage.h
    locator/locatorwidget.cpp
    locator/locatorwidget.h
    locator/opendocumentsfilter.cpp
    locator/opendocumentsfilter.h
    locator/spotlightlocatorfilter.cpp
    locator/spotlightlocatorfilter.h
    locator/urllocatorfilter.cpp
    locator/urllocatorfilter.h
    loggingviewer.cpp
    loggingviewer.h
    manhattanstyle.cpp
    manhattanstyle.h
    mcp/mcpmanager.cpp
    mcp/mcpmanager.h
    mcp/mcpregistry.cpp
    mcp/mcpregistry.h
    messagebox.cpp
    messagebox.h
    messagemanager.cpp
    messagemanager.h
    mimetypemagicdialog.cpp
    mimetypemagicdialog.h
    mimetypesettings.cpp
    mimetypesettings.h
    minisplitter.cpp
    minisplitter.h
    modemanager.cpp
    modemanager.h
    navigationsubwidget.cpp
    navigationsubwidget.h
    navigationwidget.cpp
    navigationwidget.h
    opendocumentstreeview.cpp
    opendocumentstreeview.h
    outputpane.h
    outputpanemanager.cpp
    outputpanemanager.h
    outputwindow.cpp
    outputwindow.h
    patchtool.cpp
    patchtool.h
    plugindialog.cpp
    plugindialog.h
    plugininstallwizard.cpp
    plugininstallwizard.h
    progressmanager/futureprogress.cpp
    progressmanager/futureprogress.h
    progressmanager/processprogress.cpp
    progressmanager/processprogress.h
    progressmanager/progressbar.cpp
    progressmanager/progressbar.h
    progressmanager/progressmanager.cpp
    progressmanager/progressmanager.h
    progressmanager/progressmanager_p.h
    progressmanager/progressview.cpp
    progressmanager/progressview.h
    progressmanager/taskprogress.cpp
    progressmanager/taskprogress.h
    rightpane.cpp
    rightpane.h
    secretaspect.cpp
    secretaspect.h
    session.cpp
    session.h
    sessiondialog.cpp
    sessiondialog.h
    sessionmodel.cpp
    sessionmodel.h
    sessionview.cpp
    sessionview.h
    settingsmode.cpp
    settingsmode.h
    sidebar.cpp
    sidebar.h
    sidebarwidget.cpp
    sidebarwidget.h
    statusbarmanager.cpp
    statusbarmanager.h
    systemsettings.cpp
    systemsettings.h
    terminal/searchableterminal.cpp
    terminal/searchableterminal.h
    textdocument.cpp
    textdocument.h
    themechooser.cpp
    themechooser.h
    vcsmanager.cpp
    vcsmanager.h
    vcsfilestate.h
    versiondialog.cpp
    versiondialog.h
    welcomepagehelper.cpp
    welcomepagehelper.h
    windowsupport.cpp
    windowsupport.h
)

extend_qtc_plugin(Core
  CONDITION WITH_TESTS
  SOURCES
    editormanager/editormanager_test.cpp
    locator/locator_test.cpp
    locator/locator_test.h
    locator/locatorfiltertest.cpp
    locator/locatorfiltertest.h
)

extend_qtc_plugin(Core
  CONDITION WIN32
  SOURCES progressmanager/progressmanager_win.cpp
)

extend_qtc_plugin(Core
  CONDITION APPLE
  DEPENDS ${FWAppKit}
  SOURCES
    progressmanager/progressmanager_mac.mm
)

extend_qtc_plugin(Core
  CONDITION (NOT WIN32) AND (NOT APPLE)
  SOURCES progressmanager/progressmanager_x11.cpp
)

extend_qtc_plugin(Core
  FEATURE_INFO "Freedesktop file manager support"
  CONDITION UNIX AND NOT APPLE AND TARGET Qt::DBus
  DEFINES QTC_SUPPORT_DBUSFILEMANAGER
  DEPENDS Qt::DBus
)

set(FONTS_BASE "${QtCreator_SOURCE_DIR}/src/share/3rdparty/studiofonts/")
qt_add_resources(Core
  CoreWelcomeScreenFonts_rcc
  BASE ${FONTS_BASE}
  PREFIX "studiofonts"
  FILES "${FONTS_BASE}/TitilliumWeb-Regular.ttf"
)
