# Empty project that declares the sources in the "SongToXXX..." project, so that there is no need
# to copy/paste them each time.

cmake_minimum_required(VERSION 3.12)

project(BaseExport)

set(TargetName ${PROJECT_NAME})

add_library(${TargetName})

target_compile_definitions(${TargetName} PRIVATE)

target_sources(
        ${TargetName}
        PRIVATE

        ../../audio/effect/BaseEffect.cpp
        ../../audio/effect/BaseEffect.h
        ../../audio/effect/SpeakerEffect.cpp
        ../../audio/effect/SpeakerEffect.h
        ../../audio/effect/StereoSeparationEffect.cpp
        ../../audio/effect/StereoSeparationEffect.h
        ../../audio/effect/VolumeEffect.cpp
        ../../audio/effect/VolumeEffect.h
        ../../audio/sources/EffectsProcessor.cpp
        ../../audio/sources/EffectsProcessor.h
        ../../audio/sources/PsgsProcessor.cpp
        ../../audio/sources/PsgsProcessor.h
        ../../audio/sources/PsgStreamGenerator.cpp
        ../../audio/sources/PsgStreamGenerator.h
        ../../audio/sources/HardwareTables.cpp
        ../../audio/sources/HardwareTables.h
        ../../app/preferences/model/StoredOutputMix.cpp
        ../../app/preferences/model/StoredOutputMix.h
        ../../controllers/serial/model/SerialProfile.h
        ../../audio/Volumes.cpp
        ../../audio/Volumes.h
        ../../business/model/Loop.cpp
        ../../business/model/Loop.h
        ../../business/model/StartEnd.cpp
        ../../business/model/StartEnd.h
        ../../business/model/Speed.h
        ../../business/patternViewer/DisplayedEffects.cpp
        ../../business/patternViewer/DisplayedEffects.h
        ../../business/serialization/patternViewer/EffectToCharSerializer.cpp
        ../../business/serialization/patternViewer/EffectToCharSerializer.h
        ../../business/serialization/patternViewer/TrackSerializer.cpp
        ../../business/serialization/patternViewer/TrackSerializer.h
        ../../business/serialization/song/ExpressionSerializer.cpp
        ../../business/serialization/song/ExpressionSerializer.h
        ../../business/serialization/instrument/InstrumentSerializer.cpp
        ../../business/serialization/instrument/InstrumentSerializer.h
        ../../business/serialization/instrument/InstrumentNodes.cpp
        ../../business/serialization/instrument/InstrumentNodes.h
        ../../business/serialization/song/PositionSerializer.cpp
        ../../business/serialization/song/PositionSerializer.h
        ../../business/serialization/song/PatternSerializer.cpp
        ../../business/serialization/song/PatternSerializer.h
        ../../business/serialization/song/CellSerializer.cpp
        ../../business/serialization/song/CellSerializer.h
        ../../business/serialization/song/SpecialCellSerializer.cpp
        ../../business/serialization/song/SpecialCellSerializer.h
        ../../business/serialization/sourceProfile/SourceProfileSerializer.cpp
        ../../business/serialization/sourceProfile/SourceProfileSerializer.h
        ../../business/serialization/sourceProfile/SourceProfileXmlNodes.cpp
        ../../business/serialization/sourceProfile/SourceProfileXmlNodes.h
        ../../business/sourceProfile/SourceProfile.cpp
        ../../business/sourceProfile/SourceProfile.h
        ../../business/sourceProfile/SourceProfileValidator.cpp
        ../../business/sourceProfile/SourceProfileValidator.h
        ../../business/song/cells/CellEffectsChecker.cpp
        ../../business/song/cells/CellEffectsChecker.h
        ../../business/song/tool/WaitCounter.cpp
        ../../business/song/tool/WaitCounter.h
        ../../business/song/tool/InstrumentSimpleCounter.cpp
        ../../business/song/tool/InstrumentSimpleCounter.h
        ../../business/song/tool/browser/CellAndLocation.cpp
        ../../business/song/tool/browser/CellAndLocation.h
        ../../business/song/tool/browser/CellBrowser.cpp
        ../../business/song/tool/browser/CellBrowser.h
        ../../business/song/tool/browser/SpecialCellBrowser.cpp
        ../../business/song/tool/browser/SpecialCellBrowser.h
        ../../business/song/tool/browser/SpecialCellAndLocation.cpp
        ../../business/song/tool/browser/SpecialCellAndLocation.h
        ../../business/song/tool/browser/TrackBrowser.cpp
        ../../business/song/tool/browser/TrackBrowser.h
        ../../business/song/tool/ChangeExpressionsOrdering.cpp
        ../../business/song/tool/ChangeExpressionsOrdering.h
        ../../business/song/tool/ChangeInstrumentsOrdering.cpp
        ../../business/song/tool/ChangeInstrumentsOrdering.h
        ../../business/song/tool/builder/SongBuilder.cpp
        ../../business/song/tool/builder/SongBuilder.h
        ../../business/song/tool/builder/SubsongBuilder.cpp
        ../../business/song/tool/builder/SubsongBuilder.h
        ../../business/song/tool/builder/PatternUnoptimizer.cpp
        ../../business/song/tool/builder/PatternUnoptimizer.h
        ../../business/song/tool/builder/TrailingEffectContext.cpp
        ../../business/song/tool/builder/TrailingEffectContext.h
        ../../business/song/tool/frameCounter/FrameCounter.cpp
        ../../business/song/tool/frameCounter/FrameCounter.h
        ../../business/song/tool/speed/DetermineSpeed.cpp
        ../../business/song/tool/speed/DetermineSpeed.h
        ../../business/song/tool/songStripper/SongStripper.cpp
        ../../business/song/tool/songStripper/SongStripper.h
        ../../business/song/tool/songStripper/SubsongsAndPsgs.cpp
        ../../business/song/tool/songStripper/SubsongsAndPsgs.h
        ../../business/song/tool/BaseNoteFinder.cpp
        ../../business/song/tool/BaseNoteFinder.h
        ../../business/song/tool/CellOperations.cpp
        ../../business/song/tool/CellOperations.h
        ../../business/song/tool/ChangeExpressionsOrdering.cpp
        ../../business/song/tool/ChangeExpressionsOrdering.h
        ../../business/song/tool/ChangeInstrumentsOrdering.cpp
        ../../business/song/tool/ChangeInstrumentsOrdering.h
        ../../business/song/tool/InlineArpeggioConverter.cpp
        ../../business/song/tool/InlineArpeggioConverter.h
        ../../business/song/tool/RetrigInInstrumentHeaderNormalizer.cpp
        ../../business/song/tool/RetrigInInstrumentHeaderNormalizer.h
        ../../business/song/tool/optimizers/BaseItemOptimizer.h
        ../../business/song/tool/optimizers/ExpressionOptimizer.cpp
        ../../business/song/tool/optimizers/ExpressionOptimizer.h
        ../../business/song/tool/optimizers/ExpressionsOptimizer.cpp
        ../../business/song/tool/optimizers/ExpressionsOptimizer.h
        ../../business/song/tool/optimizers/InstrumentOptimizer.cpp
        ../../business/song/tool/optimizers/InstrumentOptimizer.h
        ../../business/song/tool/optimizers/InstrumentsOptimizer.cpp
        ../../business/song/tool/optimizers/InstrumentsOptimizer.h
        ../../business/song/tool/optimizers/PatternOptimizer.cpp
        ../../business/song/tool/optimizers/PatternOptimizer.h
        ../../business/song/tool/optimizers/SongOptimizer.cpp
        ../../business/song/tool/optimizers/SongOptimizer.h
        ../../business/song/tool/sfx/FirstNotePerInstrumentFinder.cpp
        ../../business/song/tool/sfx/FirstNotePerInstrumentFinder.h
        ../../business/song/tool/context/model/LineContext.cpp
        ../../business/song/tool/context/model/LineContext.h
        ../../business/instrument/GenericInstrumentGenerator.cpp
        ../../business/instrument/GenericInstrumentGenerator.h
        ../../business/song/validation/CheckLoopStartEnd.cpp
        ../../business/song/validation/CheckLoopStartEnd.h
        ../../business/song/validation/CheckTrackHeight.cpp
        ../../business/song/validation/CheckTrackHeight.h
        ../../business/song/validation/CorrectExpression.cpp
        ../../business/song/validation/CorrectExpression.h
        ../../business/song/validation/CorrectInstrument.cpp
        ../../business/song/validation/CorrectInstrument.h
        ../../business/song/validation/LoopChange.cpp
        ../../controllers/model/OutputMix.cpp
        ../../controllers/model/OutputMix.h
        ../../controllers/model/Follow.h
        ../../export/at3/SongNodes.cpp
        ../../export/at3/SongNodes.h
        ../../export/samples/SampleEncoderFlags.cpp
        ../../export/samples/SampleEncoderFlags.h
        ../../export/ExportConfiguration.cpp
        ../../export/ExportConfiguration.h
        ../../import/soundtrakker/Stk128Importer.cpp
        ../../import/soundtrakker/Stk128Importer.h
        ../../import/soundtrakker/SubsongImporter.cpp
        ../../import/soundtrakker/SubsongImporter.h
        ../../import/soundtrakker/Stk128Constants.h
        ../../import/starkos/StarkosImporter.cpp
        ../../import/starkos/StarkosImporter.h
        ../../import/starkos/InstrumentReader.cpp
        ../../import/starkos/InstrumentReader.h
        ../../import/starkos/TrackReader.cpp
        ../../import/starkos/TrackReader.h
        ../../import/at1/At1SongImporter.cpp
        ../../import/at1/At1SongImporter.h
        ../../import/at2/At2SongImporter.cpp
        ../../import/at2/At2SongImporter.h
        ../../import/at2/SubsongReader.cpp
        ../../import/at2/SubsongReader.h
        ../../import/at3/At3SongImporter.cpp
        ../../import/at3/At3SongImporter.h
        ../../import/chp/ChpSongImporter.cpp
        ../../import/chp/ChpSongImporter.h
        ../../import/vt2/Vt2SongImporter.cpp
        ../../import/vt2/Vt2SongImporter.h
        ../../import/vt2/Vt2InstrumentBuilder.cpp
        ../../import/vt2/Vt2InstrumentBuilder.h
        ../../import/wyz/WyzSongImporter.cpp
        ../../import/wyz/WyzSongImporter.h
        ../../import/SongImporter.h
        ../../import/ImportedFormat.h
        ../../import/loader/SongLoader.cpp
        ../../import/loader/SongLoader.h
        ../../import/loader/configuration/ImportConfiguration.cpp
        ../../import/loader/configuration/ImportConfiguration.h
        ../../import/loader/configuration/ImportFirstPassReturnData.h
        ../../import/mod/ModConfiguration.cpp
        ../../import/mod/ModConfiguration.h
        ../../import/mod/ModTrackCell.cpp
        ../../import/mod/ModTrackCell.h
        ../../import/mod/ModSongImporter.cpp
        ../../import/mod/ModSongImporter.h
        ../../import/midi/MidiConfiguration.cpp
        ../../import/midi/MidiConfiguration.h
        ../../import/midi/MidiImporter.cpp
        ../../import/midi/MidiImporter.h
        ../../import/midi/MidiTrackReader.cpp
        ../../import/midi/MidiTrackReader.h
        ../../import/common/ChannelMixerKeeper.cpp
        ../../import/common/ChannelMixerKeeper.h
        ../../import/ConfigurationType.h
        ../../reader/StreamedMusicReader.cpp
        ../../reader/StreamedMusicReader.h
        ../../reader/ym/YmReader.cpp
        ../../reader/ym/YmReader.h
        ../../reader/ym/decoder/YmDecoder.cpp
        ../../reader/ym/decoder/YmDecoder.h
        ../../reader/ym/decoder/YmDecoder123.cpp
        ../../reader/ym/decoder/YmDecoder123.h
        ../../reader/ym/decoder/YmDecoder3b.cpp
        ../../reader/ym/decoder/YmDecoder3b.h
        ../../reader/ym/decoder/YmDecoder456.cpp
        ../../reader/ym/decoder/YmDecoder456.h
        ../../reader/vgm/VgmReader.cpp
        ../../reader/vgm/VgmReader.h
        ../../disark/base/AreaTag.cpp
        ../../disark/base/AreaTag.h
        ../../utils/ErrorReport.cpp
        ../../utils/ErrorReport.h
        ../../utils/StreamUtil.cpp
        ../../utils/StreamUtil.h
        ../../utils/SpeedUtil.cpp
        ../../utils/SpeedUtil.h
        ../../utils/Base64Util.cpp
        ../../utils/Base64Util.h
        ../../player/channel/ChannelOutputRegisters.cpp
        ../../player/channel/ChannelOutputRegisters.h
        ../../player/channel/ChannelPlayer.cpp
        ../../player/channel/ChannelPlayer.h
        ../../player/channel/ChannelPlayerResults.cpp
        ../../player/channel/ChannelPlayerResults.h
        ../../player/NoteAndShift.cpp
        ../../player/NoteAndShift.h
        ../../player/InstrumentPlayedInfo.cpp
        ../../player/InstrumentPlayedInfo.h
        ../../player/CellToPlay.cpp
        ../../player/CellToPlay.h
        ../../player/PsgPeriod.cpp
        ../../player/PsgPeriod.h
        ../../player/PsgRegisters.cpp
        ../../player/PsgRegisters.h
        ../../player/PsgRegistersConverter.cpp
        ../../player/PsgRegistersConverter.h
        ../../player/PsgRegistersProvider.h
        ../../player/SampleData.cpp
        ../../player/SampleData.h
        ../../player/SamplePlayInfo.cpp
        ../../player/SamplePlayInfo.h
        ../../player/SongPlayer.cpp
        ../../player/SongPlayer.h
        ../../player/TemperedScaleUtil.cpp
        ../../player/TemperedScaleUtil.h
        ../../controllers/observers/SongPlayerObserver.h
        ../../song/cells/Cell.cpp
        ../../song/cells/Cell.h
        ../../song/cells/CellConstants.h
        ../../song/cells/CellEffect.cpp
        ../../song/cells/CellEffect.h
        ../../song/cells/CellEffects.cpp
        ../../song/cells/CellEffects.h
        ../../song/cells/Effect.cpp
        ../../song/cells/Effect.h
        ../../song/cells/Note.cpp
        ../../song/cells/Note.h
        ../../song/cells/SpecialCell.cpp
        ../../song/cells/SpecialCell.h
        ../../song/cells/SpecialCellConstants.h
        ../../song/cells/EffectError.h
        ../../song/instrument/sample/SamplePart.cpp
        ../../song/instrument/sample/SamplePart.h
        ../../song/instrument/sample/Sample.cpp
        ../../song/instrument/sample/Sample.h
        ../../song/instrument/psg/LowLevelPsgInstrumentCell.cpp
        ../../song/instrument/psg/LowLevelPsgInstrumentCell.h
        ../../song/instrument/psg/PsgInstrumentCell.cpp
        ../../song/instrument/psg/PsgInstrumentCell.h
        ../../song/instrument/psg/PsgInstrumentCellLink.h
        ../../song/instrument/psg/SpreadPsgInstrumentCell.cpp
        ../../song/instrument/psg/SpreadPsgInstrumentCell.h
        ../../song/instrument/psg/PsgPart.cpp
        ../../song/instrument/psg/PsgPart.h
        ../../song/instrument/psg/PsgPartConstants.h
        ../../song/instrument/psg/PsgSection.cpp
        ../../song/instrument/psg/PsgSection.h
        ../../song/instrument/Instrument.cpp
        ../../song/instrument/Instrument.h
        ../../song/instrument/InstrumentType.h
        ../../song/subsong/Pattern.cpp
        ../../song/subsong/Pattern.h
        ../../song/psg/Psg.cpp
        ../../song/psg/Psg.h
        ../../song/psg/PsgFrequency.cpp
        ../../song/psg/PsgFrequency.h
        ../../song/psg/PsgMixingOutput.cpp
        ../../song/psg/PsgMixingOutput.h
        ../../song/psg/PsgType.cpp
        ../../song/psg/PsgType.h
        ../../song/subsong/Position.cpp
        ../../song/subsong/Position.h
        ../../song/subsong/Subsong.cpp
        ../../song/subsong/Subsong.h
        ../../song/subsong/SubsongConstants.cpp
        ../../song/subsong/SubsongConstants.h
        ../../song/tracks/AbstractTrack.h
        ../../song/tracks/SpecialTrack.h
        ../../song/tracks/Track.h
        ../../song/tracks/TrackConstants.cpp
        ../../song/tracks/TrackConstants.h
        ../../song/CellLocationInTrack.cpp
        ../../song/CellLocationInTrack.h
        ../../song/CellLocationInPosition.cpp
        ../../song/CellLocationInPosition.h
        ../../song/TrackLocation.cpp
        ../../song/TrackLocation.h
        ../../song/SpecialTrackLocation.cpp
        ../../song/SpecialTrackLocation.h
        ../../song/SpecialCellLocationInPosition.cpp
        ../../song/SpecialCellLocationInPosition.h
        ../../song/SpecialCellLocationInTrack.cpp
        ../../song/SpecialCellLocationInTrack.h
        ../../song/Expression.cpp
        ../../song/Expression.h
        ../../song/ExpressionConstants.h
        ../../song/ExpressionHandler.cpp
        ../../song/ExpressionHandler.h
        ../../song/ExpressionBuilder.cpp
        ../../song/ExpressionBuilder.h
        ../../song/Location.cpp
        ../../song/Location.h
        ../../song/Song.cpp
        ../../song/Song.h
        ../../utils/CollectionUtil.h
        ../../utils/Counter.cpp
        ../../utils/Counter.h
        ../../utils/EnumHasher.h
        ../../utils/FileExtensions.cpp
        ../../utils/FileExtensions.h
        ../../utils/FileUtil.cpp
        ../../utils/FileUtil.h
        ../../utils/FpFloat.cpp
        ../../utils/FpFloat.h
        ../../utils/NoteUtil.cpp
        ../../utils/NoteUtil.h
        ../../utils/NumberUtil.cpp
        ../../utils/NumberUtil.h
        ../../utils/BitNumber.cpp
        ../../utils/BitNumber.h
        ../../utils/Observers.h
        ../../utils/OptionalValue.h
        ../../utils/PsgValues.cpp
        ../../utils/PsgValues.h
        ../../utils/Remapper.h
        ../../utils/SetUtil.h
        ../../utils/SimpleId.cpp
        ../../utils/SimpleId.h
        ../../utils/Id.h
        ../../utils/StringUtil.cpp
        ../../utils/StringUtil.h
        ../../utils/TotalAndWeight.cpp
        ../../utils/TotalAndWeight.h
        ../../utils/MapUtil.h
        ../../utils/MemoryBlockUtil.cpp
        ../../utils/MemoryBlockUtil.h
        ../../utils/WithParent.h
        ../../utils/XmlHelper.cpp
        ../../utils/XmlHelper.h
        ../../utils/ZipHelper.cpp
        ../../utils/ZipHelper.h
        ../../export/sourceGenerator/SourceGenerator.h
        ../../export/sourceGenerator/SourceGenerator.cpp
        ../../export/sourceGenerator/SourceGeneratorConfiguration.h
        ../../export/sourceGenerator/SourceGeneratorConfiguration.cpp
        ../../export/sourceGenerator/DisarkSourceGenerator.h
        ../../export/sourceGenerator/DisarkSourceGenerator.cpp
        ../../export/sourceGenerator/SourceGeneratorException.h
        ../../export/playerConfiguration/PlayerConfigurationExporter.cpp
        ../../export/playerConfiguration/PlayerConfigurationExporter.h
        ../../export/playerConfiguration/PlayerConfiguration.cpp
        ../../export/playerConfiguration/PlayerConfiguration.h
        ../../export/playerConfiguration/PlayerConfigurationFlag.h
        ../../ui/lookAndFeel/LookAndFeelConstants.cpp
        ../../ui/lookAndFeel/LookAndFeelConstants.h
        ../../ui/components/colors/ColorConstants.cpp
        ../../ui/components/colors/ColorConstants.h
        ../../ui/patternViewer/CursorLocation.cpp
        ../../ui/patternViewer/CursorLocation.h
        ../../ui/patternViewer/controller/PasteData.cpp
        ../../ui/patternViewer/controller/PasteData.h
        ../../ui/patternViewer/controller/CaptureFlags.cpp
        ../../ui/patternViewer/controller/CaptureFlags.h
        ../../ui/export/common/task/SaveSourceOrBinary.cpp
        ../../ui/export/common/task/SaveSourceOrBinary.h
        ../../ui/export/common/task/CompileSource.cpp
        ../../ui/export/common/task/CompileSource.h

        ../utils/CommandLineArgumentDescriptor.cpp
        ../utils/CommandLineArgumentDescriptor.h
        ../utils/CommandLineConstants.cpp
        ../utils/CommandLineConstants.h
        ../utils/CommandLineParser.cpp
        ../utils/CommandLineParser.h
        ../utils/Option.cpp
        ../utils/Option.h
        ../utils/Parameter.cpp
        ../utils/Parameter.h
        ../utils/CommandLineToolHelper.cpp
        ../utils/CommandLineToolHelper.h
)

target_compile_definitions(${TargetName}
        PUBLIC
        JUCE_WEB_BROWSER=0
        JUCE_USE_CURL=0
        JUCE_PLUGINHOST_LADSPA=0
        JUCE_USE_XCURSOR=0
        JUCE_MODULE_AVAILABLE_juce_opengl=0
        DONT_SET_USING_JUCE_NAMESPACE=1
        JUCE_SILENCE_XCODE_15_LINKER_WARNING=1
)

target_link_libraries(${TargetName}
        PRIVATE
        ThirdPartyLzh
        ThirdPartyRasm                  # Most projects need it.
        juce::juce_events               # Needed for the juce::ScopedJuceInitialiser_GUI assertion removal.
        juce::juce_audio_basics         # Needed for MIDI import (relies on MIDI messages).
        PUBLIC
        juce::juce_recommended_config_flags
        juce::juce_recommended_lto_flags
        juce::juce_recommended_warning_flags
)

if(CMAKE_CXX_COMPILER_ID STREQUAL "AppleClang")
    target_link_options(${TargetName}
            PUBLIC
            -Wl,-ld_classic     # To avoid Linker warnings. See https://forum.juce.com/t/vst-au-builds-fail-after-upgrading-to-xcode-15/57936/64?u=jnv
    )
elseif(CMAKE_CXX_COMPILER_ID STREQUAL "GNU")
    target_link_options(${TargetName}
            PUBLIC
            -no-pie             # To have mime type application/x-executable instead of application/x-sharedlib, and thus allowing direct launch.
    )
endif()
