if(HAVE_OSG)
	set(SCRIBUS_OSG_CLASS
		ui/AdapterWidget.h
		ui/osgeditor.h
		pageitem_osgframe.h
	)
	set(SCRIBUS_OSG_SRC
		ui/AdapterWidget.cpp
		ui/osgeditor.cpp
		pageitem_osgframe.cpp
	)
endif()

if (GMAGICK_FOUND)
	set(SCRIBUS_GMAGICK_SRC imagedataloaders/scimgdataloader_gmagick.cpp)
else()
	set(SCRIBUS_GMAGICK_SRC)
endif()

if (JXL_FOUND)
	set(SCRIBUS_JPEGXL_SRC imagedataloaders/scimgdataloader_jpegxl.cpp)
endif()

set(SCRIBUS_FSW_SRC
	ui/fsw/firststartwizard.cpp
	ui/fsw/fsw_appearance.cpp
	ui/fsw/fsw_experimental.cpp
	ui/fsw/fsw_finish.cpp
	ui/fsw/fsw_fontsscripts.cpp
	ui/fsw/fsw_language.cpp
	ui/fsw/fsw_newdocument.cpp
	ui/fsw/fsw_sidepanel.cpp
	ui/fsw/fsw_welcome.cpp
)

set(SCRIBUS_SOURCES
	actionmanager.cpp
	actionsearch.cpp
	appmodehelper.cpp
	canvas.cpp
	canvasgesture_cellselect.cpp
	canvasgesture_columnresize.cpp
	canvasgesture_linemove.cpp
	canvasgesture_pan.cpp
	canvasgesture_rectselect.cpp
	canvasgesture_resize.cpp
	canvasgesture_rowresize.cpp
	canvasgesture_rulermove.cpp
	canvasgesture_table.cpp
	canvasgesture_tableresize.cpp
	canvasmode.cpp
	canvasmode_copyproperties.cpp
	canvasmode_create.cpp
	canvasmode_drawbezier.cpp
	canvasmode_drawcalligraphic.cpp
	canvasmode_drawfreehand.cpp
	canvasmode_eyedropper.cpp
	canvasmode_framelinks.cpp
	canvasmode_imageimport.cpp
	canvasmode_edit.cpp
	canvasmode_editarc.cpp
	canvasmode_editgradient.cpp
	canvasmode_editmeshgradient.cpp
	canvasmode_editmeshpatch.cpp
	canvasmode_editpolygon.cpp
	canvasmode_editspiral.cpp
	canvasmode_edittable.cpp
	canvasmode_editweldpoint.cpp
	canvasmode_magnifier.cpp
	canvasmode_measurements.cpp
	canvasmode_nodeedit.cpp
	canvasmode_normal.cpp
	canvasmode_objimport.cpp
	canvasmode_panning.cpp
	canvasmode_rotate.cpp
	cellarea.cpp
	chartablemodel.cpp
	chartableview.cpp
	cmserrorhandling.cpp
	cmsettings.cpp
	collapsedtablepainter.cpp
	collapsedtablepainterex.cpp
	collect4output.cpp
	colorblind.cpp
	colorsetmanager.cpp
	commonstrings.cpp
	deferredtask.cpp
	documentchecker.cpp
	documentinformation.cpp
	documentlogmanager.cpp
	exif.cpp
	fileloader.cpp
	filesearch.cpp
	filewatcher.cpp
	fontlistmodel.cpp
	fpoint.cpp
	fpointarray.cpp
	framelinkrouter.cpp
	gtaction.cpp
	gtfont.cpp
	gtframestyle.cpp
	gtgettext.cpp
	gtmeasure.cpp
	gtparagraphstyle.cpp
	gtstyle.cpp
	gtwriter.cpp
	guidemanagercore.cpp
	guidesdelegate.cpp
	guidesmodel.cpp
	guidesview.cpp
	hyphenator.cpp
	iconmanager.cpp
	ioapi.c
	KarbonCurveFit.cpp
	langdef.cpp
	langmgr.cpp
	latexhelpers.cpp
	loadsaveplugin.cpp
	localemgr.cpp
	marks.cpp
	menumanager.cpp
	mesh.cpp
	navigator.cpp
	numeration.cpp
	observable.cpp
	nftrcreader.cpp
	nftsettings.cpp
	nfttemplate.cpp
	nodeeditcontext.cpp
	notesstyles.cpp
	opticalmarginlookup.cpp
	pageitem.cpp
	pageitem_arc.cpp
	pageitem_group.cpp
	pageitem_imageframe.cpp
	pageitem_latexframe.cpp
	pageitem_line.cpp
	pageitem_pathtext.cpp
	pageitem_polygon.cpp
	pageitem_polyline.cpp
	pageitem_regularpolygon.cpp
	pageitem_spiral.cpp
	pageitem_symbol.cpp
	pageitem_table.cpp
	pageitem_textframe.cpp
	pageitem_noteframe.cpp
	pageitemiterator.cpp
	pageitempointer.cpp
	pagesize.cpp
	pdf_analyzer.cpp
	pdflib.cpp
	pdflib_core.cpp
	pdfoptions.cpp
	pdfoptionsio.cpp
	pdfversion.cpp
	pdfwriter.cpp
	pluginmanager.cpp
	pp_proxy.cpp
	prefscontext.cpp
	prefsfile.cpp
	prefsmanager.cpp
	prefsreader.cpp
	prefstable.cpp
	printpreviewcreator.cpp
	printpreviewcreator_pdf.cpp
	printpreviewcreator_ps.cpp
	printpreviewcreatorfactory.cpp
	pslib.cpp
	qtiocompressor.cpp
	rawimage.cpp
	rc4.c
	sampleitem.cpp
	scclipboardprocessor.cpp
	scclocale.cpp
	sccolor.cpp
	sccolorengine.cpp
	sccolorshade.cpp
	sccolorstructs.cpp
	scdocoutput.cpp
	scdocoutput_ps2.cpp
	scdomelement.cpp
	scfonts.cpp
	scgtplugin.cpp
	schelptreemodel.cpp
	scimage.cpp
	scimagecacheproxy.cpp
	scimagecachedir.cpp
	scimagecachefile.cpp
	scimagecachemanager.cpp
	scimagecachewriteaction.cpp
	scimagestructs.cpp
	sclayer.cpp
	sclockedfile.cpp
	scmimedata.cpp
	scpage.cpp
	scpageoutput.cpp
	scpageoutput_ps2.cpp
	scpainter.cpp
	scpainterex_ps2.cpp
	scpainterexbase.cpp
	scpaths.cpp
	scpattern.cpp
	scplugin.cpp
	scpreview.cpp
	scprintengine.cpp
	scprintengine_pdf.cpp
	scprintengine_ps.cpp
	scraction.cpp
	scribus.cpp
	scribusXml.cpp
	scribusapp.cpp
	scribuscore.cpp
	scribusdoc.cpp
	scribusview.cpp
	scribuswin.cpp
	scslainforeader.cpp
	scstreamfilter.cpp
	scstreamfilter_ascii85.cpp
	scstreamfilter_flate.cpp
	scstreamfilter_jpeg.cpp
	scstreamfilter_rc4.cpp
	sctextcodec.cpp
	sctextstream.cpp
	sctextstruct.cpp
	scxmlstreamreader.cpp
	selection.cpp
	selectionrubberband.cpp
	serializer.cpp
	spellcheckfunctions.cpp
	storyloader.cpp
	styleitem.cpp
	stylesearch.cpp
	tableborder.cpp
	tablecell.cpp
	tableutils.cpp
	textframespellchecker.cpp
	textnote.cpp
	textwriter.cpp
	tocgenerator.cpp
	transaction.cpp
	undogui.cpp
	undomanager.cpp
	undoobject.cpp
	undostack.cpp
	undostate.cpp
	undotransaction.cpp
	units.cpp
	updatemanager.cpp
	upgradechecker.cpp
	urllauncher.cpp
	util.cpp
	util_color.cpp
	util_debug.cpp
	util_file.cpp
	util_formats.cpp
	util_ghostscript.cpp
	util_gui.cpp
	util_layer.cpp
	util_math.cpp
	util_os.cpp
	util_printer.cpp
	util_text.cpp
	vgradient.cpp
	vgradientex.cpp	
	downloadmanager/scdlmgr.cpp
	downloadmanager/scdlthread.cpp
	imagedataloaders/scimgdataloader.cpp
	imagedataloaders/scimgdataloader_gimp.cpp
	imagedataloaders/scimgdataloader_jpeg.cpp
	imagedataloaders/scimgdataloader_kra.cpp
	imagedataloaders/scimgdataloader_ora.cpp
	imagedataloaders/scimgdataloader_pdf.cpp
	imagedataloaders/scimgdataloader_pgf.cpp
	imagedataloaders/scimgdataloader_pict.cpp
	imagedataloaders/scimgdataloader_png.cpp
	imagedataloaders/scimgdataloader_ps.cpp
	imagedataloaders/scimgdataloader_psd.cpp
	imagedataloaders/scimgdataloader_qt.cpp
	imagedataloaders/scimgdataloader_tiff.cpp
	imagedataloaders/scimgdataloader_wpg.cpp
	manager/dock_manager.cpp
	manager/pagepreset_manager.cpp
	manager/widget_manager.cpp
	models/gradientlistmodel.cpp
	palettes/cxfcolor.cpp
	palettes/cxfcolorspecification.cpp
	palettes/cxfdocument.cpp
	palettes/cxfobject.cpp
	palettes/cxfmeasurementspec.cpp
	palettes/cxftristimulusspec.cpp
	palettes/cxfutils.cpp
	palettes/paletteloader.cpp
	palettes/paletteloader_adobe_acb.cpp
	palettes/paletteloader_adobe_aco.cpp
	palettes/paletteloader_adobe_ase.cpp
	palettes/paletteloader_autocad_acb.cpp
	palettes/paletteloader_cxf.cpp
	palettes/paletteloader_ps.cpp
	palettes/paletteloader_sk1.cpp
	palettes/paletteloader_swatchbook.cpp
	third_party/fparser/fpoptimizer.cc
	third_party/fparser/fparser.cc
	ui/about.cpp
	ui/aboutplugins.cpp
	ui/actionsearchdialog.cpp
	ui/aligndistribute.cpp
	ui/alignselect.cpp
	ui/alignverticalselect.cpp
	ui/directionselect.cpp
	ui/annot.cpp
	ui/annota.cpp
	ui/applytemplatedialog.cpp
	ui/arcwidget.cpp
	ui/arcvectordialog.cpp
	ui/arrowchooser.cpp
	ui/autoform.cpp
	ui/autoformbuttongroup.cpp
	ui/basepointwidget.cpp
	ui/bookmarkpalette.cpp
	ui/bookmwin.cpp
	ui/buttonicon.cpp
	ui/charselect.cpp
	ui/charselectenhanced.cpp
	ui/charzoom.cpp
	ui/checkDocument.cpp
	ui/clockwidget.cpp
	ui/cmykfw.cpp
	ui/collectforoutput_ui.cpp
	ui/colorchart.cpp
	ui/colorcombo.cpp
	ui/colorlistbox.cpp
	ui/colorlistmodel.cpp
	ui/colorsandfills.cpp
	ui/contentpalette.cpp
	ui/contentpalette_default.cpp
	ui/contentpalette_page.cpp
	ui/contextmenu.cpp
	ui/cupsoptions.cpp
	ui/curvewidget.cpp
	ui/customfdialog.cpp
	ui/cxfimportdialog.cpp
	ui/dasheditor.cpp
	ui/dcolor.cpp
	ui/delpages.cpp
	ui/documentlogviewer.cpp
	ui/downloadspalette.cpp
	ui/editor.cpp
	ui/effectsdialog.cpp
	ui/extimageprops.cpp
	ui/filedialogeventcatcher.cpp
	ui/flopwidget.cpp
	ui/fontcombo.cpp
	ui/fontembeddingcombo.cpp
	ui/fontembeddingmodel.cpp
	ui/fontlistview.cpp
	ui/fontreplacedialog.cpp
	ui/gradientaddedit.cpp
	ui/gradienteditor.cpp
	ui/gradientpreview.cpp
	ui/gtdialogs.cpp
	ui/gtfiledialog.cpp
	ui/guidemanager.cpp
	ui/helpbrowser.cpp
	ui/hruler.cpp
	ui/hyask.cpp
	ui/imageclippingpaths.cpp
	ui/imagelayers.cpp
	ui/imageinfodialog.cpp
	ui/inlinepalette.cpp
	ui/insertTable.cpp
	ui/insertaframe.cpp
	ui/inserttablecolumnsdialog.cpp
	ui/inserttablerowsdialog.cpp
	ui/inspage.cpp
	ui/javadocs.cpp
	ui/latexeditor.cpp
	ui/layers.cpp
	ui/linecombo.cpp
	ui/linemarkerselector.cpp
	ui/linestyleselector.cpp
	ui/linkbutton.cpp	
	ui/loremipsum.cpp
	ui/mark2item.cpp
	ui/mark2mark.cpp
	ui/markanchor.cpp
	ui/markindex.cpp
	ui/markinsert.cpp
	ui/marknote.cpp
	ui/marksmanager.cpp
	ui/markvariabletext.cpp
	ui/marginpresetlayout.cpp
	ui/newmarginwidget.cpp
	ui/mergedoc.cpp
	ui/missing.cpp
	ui/movepage.cpp
	ui/multipleduplicate.cpp
	ui/multiprogressdialog.cpp
	ui/measurements.cpp
	ui/newdocdialog.cpp
	ui/newtemp.cpp
	ui/nftdialog.cpp
	ui/nftwidget.cpp
	ui/nodeeditpalette.cpp
	ui/notesstyleseditor.cpp
	ui/numformatcombo.cpp
	ui/opticalmargineditor.cpp
	ui/opticalmarginswidget.cpp
	ui/outlinepalette.cpp
	ui/outputpreview_pdf.cpp
	ui/outputpreview_ps.cpp
	ui/outputpreviewbase.cpp
	ui/pageitemattributes.cpp
	ui/pagepalette.cpp
	ui/pagepalette_pages.cpp
	ui/pagepalette_masterpages.cpp
	ui/pagepalette_widgets.cpp
	ui/pagepropertiesdialog.cpp
	ui/pageselector.cpp
	ui/patternpropsdialog.cpp
	ui/pdfexportdialog.cpp
	ui/pdfversioncombo.cpp
	ui/pdfversionmodel.cpp
	ui/picsearch.cpp
	ui/picsearchoptions.cpp
	ui/picstatus.cpp
	ui/polygonwidget.cpp
	ui/polyprops.cpp
	ui/preferences/preferencesdialog.cpp
	ui/preferences/prefs_colormanagement.cpp
	ui/preferences/prefs_display.cpp
	ui/preferences/prefs_documentinformation.cpp
	ui/preferences/prefs_documentsections.cpp
	ui/preferences/prefs_documentsetup.cpp
	ui/preferences/prefs_experimental.cpp
	ui/preferences/prefs_externaltools.cpp
	ui/preferences/prefs_fonts.cpp
	ui/preferences/prefs_guides.cpp
	ui/preferences/prefs_hyphenator.cpp
	ui/preferences/prefs_indexes.cpp
	ui/preferences/prefs_imagecache.cpp
	ui/preferences/prefs_keyboardshortcuts.cpp
	ui/preferences/prefs_miscellaneous.cpp
	ui/preferences/prefs_pagesizes.cpp
	ui/preferences/prefs_pane.cpp
	ui/preferences/prefs_paths.cpp
	ui/preferences/prefs_plugins.cpp
	ui/preferences/prefs_preflightverifier.cpp
	ui/preferences/prefs_printer.cpp
	ui/preferences/prefs_scrapbook.cpp
	ui/preferences/prefs_spelling.cpp
	ui/preferences/prefs_typography.cpp
	ui/preferences/prefs_userinterface.cpp
	ui/preferences/prefs_itemtools.cpp
	ui/preferences/prefs_operatortools.cpp
	ui/preferences/prefs_pdfexport.cpp
	ui/preferences/prefs_tableofcontents.cpp
	ui/preferences/prefs_documentitemattributes.cpp
	ui/printdialog.cpp
	ui/printlanguagecombo.cpp
	ui/printpreview.cpp
	ui/propertiespalette.cpp
	ui/propertiespalette_attributes.cpp
	ui/propertiespalette_image.cpp
	ui/propertiespalette_fill.cpp
	ui/propertiespalette_group.cpp
	ui/propertiespalette_line.cpp
	ui/propertiespalette_shadow.cpp
	ui/propertiespalette_shape.cpp
	ui/propertiespalette_table.cpp
	ui/propertiespalette_text.cpp
	ui/propertiespalette_utils.cpp
	ui/propertiespalette_xyz.cpp
	ui/propertywidget_advanced.cpp
	ui/propertywidget_alignment.cpp
	ui/propertywidget_distance.cpp
	ui/propertywidget_paragraphstyle.cpp
	ui/propertywidget_pareffect.cpp
	ui/propertywidget_hyphenation.cpp
	ui/propertywidget_orphans.cpp
	ui/propertywidget_pathtext.cpp
	ui/propertywidget_text.cpp
	ui/propertywidget_fontfeatures.cpp
	ui/propertywidgetbase.cpp
	ui/proptree.cpp
	ui/query.cpp
	ui/recoverdialog.cpp
	ui/replacecolors.cpp
	ui/replaceonecolor.cpp
	ui/resourcemanager.cpp
	ui/resourcemanagerlicense.cpp
	ui/rulermover.cpp
	ui/sccolorslider.cpp
	ui/scdialog.cpp
	ui/scdockpalette.cpp
	ui/scescapecatcher.cpp
	ui/scfilewidget.cpp
	ui/sclistwidgetdelegate.cpp
	ui/scmenu.cpp
	ui/scmessagebox.cpp
	ui/scmwmenumanager.cpp
	ui/scrapbookpalette.cpp
	ui/scresizecursor.cpp
	ui/scrpalettebase.cpp
	ui/scrspinbox.cpp
	ui/sctablewidget.cpp
	ui/sctextbrowser.cpp
	ui/sctoolbar.cpp
	ui/sctreewidget.cpp
	ui/search.cpp
	ui/selectobjects.cpp
	ui/selfield.cpp
	ui/shadebutton.cpp
	ui/shortcutwidget.cpp
	ui/smalignselect.cpp
	ui/smcellstylewidget.cpp
	ui/smcellstyle.cpp
	ui/smcheckbox.cpp
	ui/smcolorbutton.cpp
	ui/smcolorcombo.cpp
	ui/smcstylewidget.cpp
	ui/smdirectionselect.cpp
	ui/smfontfeatures.cpp
	ui/smfontcomboh.cpp
	ui/smlinestyle.cpp
	ui/smlinestylewidget.cpp
	ui/smnumformatcombo.cpp
	ui/smopticalmarginswidget.cpp
	ui/smpstylewidget.cpp
	ui/smradiobutton.cpp
	ui/smreplacedia.cpp
	ui/smsccombobox.cpp
	ui/smscrspinbox.cpp
	ui/smshadebutton.cpp
	ui/smspinbox.cpp
	ui/smlineedit.cpp
	ui/smstyleimport.cpp
	ui/smstyleselect.cpp
	ui/smtablestylewidget.cpp
	ui/smtablestyle.cpp
	ui/smtabruler.cpp
	ui/smtextstyles.cpp
	ui/spiralvectordialog.cpp
	ui/spiralwidget.cpp
	ui/splash.cpp
	ui/storyeditor.cpp
	ui/stylecombos.cpp
	ui/stylemanager.cpp
	ui/stylesearchdialog.cpp
	ui/styleselect.cpp
	ui/styleview.cpp
	ui/swatchcombo.cpp
	ui/symbolpalette.cpp
	ui/tablecolumnwidthsdialog.cpp
	ui/tablerowheightsdialog.cpp
	ui/tablesideselector.cpp
	ui/tabmanager.cpp
	ui/tabpdfoptions.cpp
	ui/tabruler.cpp
	ui/transformdialog.cpp
	tt/simpletreemodel/treeitem.cpp
	tt/simpletreemodel/treemodel.cpp
	ui/copypagetomasterpagedialog.cpp
	ui/createrange.cpp
	ui/edittoolbar.cpp
	ui/filetoolbar.cpp
	ui/helpnavigation.cpp
	ui/modetoolbar.cpp
	ui/pdftoolbar.cpp
	ui/viewtoolbar.cpp
	ui/unicodesearch.cpp
	ui/vruler.cpp
	ui/useprintermarginsdialog.cpp
	ui/weldedit.cpp
	ui/colorpicker/colorpicker.cpp
	ui/colorpicker/colorpicker_color.cpp	
	ui/colorpicker/colorpicker_color_swatches.cpp
	ui/colorpicker/colorpicker_gradient.cpp
	ui/colorpicker/colorpicker_gradient_properties.cpp
	ui/colorpicker/colorpicker_gradient_swatches.cpp
	ui/colorpicker/colorpicker_hatch.cpp
	ui/colorpicker/colorpicker_pattern.cpp
	ui/delegates/sclistitemdelegate.cpp
	ui/docks/dock_centralwidget.cpp
	ui/docks/dock_panelbase.cpp
	ui/factories/scribusproxystyle.cpp
	ui/widgets/color_button.cpp
	ui/widgets/color_slider.cpp
	ui/widgets/combo_blendmode.cpp
	ui/widgets/combo_linestyle.cpp
	ui/widgets/dropdown_button.cpp
	ui/widgets/floatingwindow.cpp
	ui/widgets/form_widget.cpp
	ui/widgets/gradientlistbox.cpp
	ui/widgets/pagelayout.cpp
	ui/widgets/pagesizelist.cpp
	ui/widgets/pagesizepreview.cpp
	ui/widgets/pagesizeselector.cpp
	ui/widgets/popup_menu.cpp
	ui/widgets/pulsing_toolbutton.cpp
	ui/widgets/section_container.cpp
	ui/widgets/stacked_container.cpp
	ui/widgets/switch.cpp
	${SCRIBUS_OSG_SRC}
	${SCRIBUS_GMAGICK_SRC}
	${SCRIBUS_JPEGXL_SRC}
	${SCRIBUS_FSW_SRC}
)

if(NOT HAVE_HYPHEN)
	include_directories(third_party/hyphen)
	set(SCRIBUS_SOURCES
	${SCRIBUS_SOURCES}
	third_party/hyphen/hnjalloc.c
	third_party/hyphen/hyphen.c
	)
endif()

if(WIN32)
	set(SCRIBUS_WIN32_ONLY_SOURCES
		scpainterex_cairo.cpp
		scprintengine_gdi.cpp
		)
	set(SCRIBUS_MAIN_CPP main_win32.cpp)
else()
	set(SCRIBUS_WIN32_ONLY_SOURCES)
	set(SCRIBUS_MAIN_CPP main.cpp)
endif()


