set(VGAUDIO_SOURCE src/lib/vgaudio/codecs/crihca/HcaInfo.h src/lib/vgaudio/codecs/crihca/HcaInfo.cpp src/lib/common/utilities/IntHelper.cpp src/lib/common/utilities/IntHelper.h src/lib/vgaudio/IProgressReport.h src/lib/vgaudio/codecs/CodecParameters.h src/lib/vgaudio/codecs/crihca/CriHcaParameters.h src/lib/vgaudio/codecs/crihca/CriHcaQuality.h src/lib/vgaudio/codecs/crihca/CriHcaConstants.h src/lib/vgaudio/codecs/crihca/ChannelType.h src/lib/vgaudio/utilities/Mdct.cpp src/lib/vgaudio/utilities/Mdct.h src/lib/common/utilities/runtime_array.h src/lib/common/utilities/type_sys.h src/lib/common/utilities/StrHelper.cpp src/lib/common/utilities/StrHelper.h src/lib/common/utilities/BitHelper.cpp src/lib/common/utilities/BitHelper.h src/lib/common/utilities/static_class.h src/lib/vgaudio/codecs/crihca/CriHcaChannel.cpp src/lib/vgaudio/codecs/crihca/CriHcaChannel.h src/lib/vgaudio/codecs/crihca/CriHcaTables.cpp src/lib/vgaudio/codecs/crihca/CriHcaTables.h src/lib/common/utilities/runtime_jagged_array.h src/lib/common/utilities/array_gen.h src/lib/common/utilities/ArrayHelper.h src/lib/vgaudio/codecs/crihca/CriHcaKey.cpp src/lib/vgaudio/codecs/crihca/CriHcaKey.h src/lib/vgaudio/codecs/crihca/CriHcaKeyType.h src/lib/vgaudio/utilities/BitReader.cpp src/lib/vgaudio/utilities/BitReader.h src/lib/vgaudio/utilities/OffsetBias.h src/lib/vgaudio/codecs/crihca/CriHcaFrame.cpp src/lib/vgaudio/codecs/crihca/CriHcaFrame.h src/lib/vgaudio/codecs/crihca/CriHcaDecoder.cpp src/lib/vgaudio/codecs/crihca/CriHcaDecoder.h src/lib/vgaudio/codecs/crihca/CriHcaEncoder.cpp src/lib/vgaudio/codecs/crihca/CriHcaEncoder.h src/lib/vgaudio/codecs/crihca/CriHcaPacking.cpp src/lib/vgaudio/codecs/crihca/CriHcaPacking.h src/lib/vgaudio/utilities/Crc16.cpp src/lib/vgaudio/utilities/Crc16.h src/lib/vgaudio/utilities/BitWriter.cpp src/lib/vgaudio/utilities/BitWriter.h src/lib/common/utilities/private/runtime_array_container.h src/lib/common/utilities/private/runtime_array_decl.h src/lib/common/utilities/private/array_iterator.h src/lib/common/utilities/private/runtime_array_wrapper.h src/lib/common/utilities/macros.h src/lib/common/io/Stream.h src/lib/common/io/Stream.cpp src/lib/common/io/SeekOrigin.h src/lib/common/io/FileStream.cpp src/lib/common/io/FileStream.h src/lib/common/io/BinaryReader.cpp src/lib/common/io/BinaryReader.h src/lib/common/io/BinaryWriter.cpp src/lib/common/io/BinaryWriter.h src/lib/vgaudio/formats/IAudioFormat.h src/lib/vgaudio/formats/AudioFormatBase.h src/lib/vgaudio/formats/AudioFormatBaseBuilder.h src/lib/vgaudio/formats/AudioTrack.cpp src/lib/vgaudio/formats/AudioTrack.h src/lib/vgaudio/formats/pcm16/Pcm16FormatBuilder.cpp src/lib/vgaudio/formats/pcm16/Pcm16FormatBuilder.h src/lib/common/utilities/traits.h src/lib/vgaudio/formats/AudioFormatBaseBuilder.cpp src/lib/vgaudio/formats/AudioFormatBase.cpp src/lib/common/utilities/TypeHelper.h src/lib/vgaudio/formats/crihca/CriHcaFormatBuilder.cpp src/lib/vgaudio/formats/crihca/CriHcaFormatBuilder.h src/lib/vgaudio/formats/crihca/CriHcaFormat.cpp src/lib/vgaudio/formats/crihca/CriHcaFormat.h src/api/private/dll_public.h src/lib/vgaudio/containers/Configuration.h src/lib/vgaudio/containers/Configuration.cpp src/lib/vgaudio/containers/hca/HcaConfiguration.cpp src/lib/vgaudio/containers/hca/HcaConfiguration.h src/lib/vgaudio/formats/AudioData.cpp src/lib/vgaudio/formats/AudioData.h src/lib/vgaudio/containers/AudioWithConfig.cpp src/lib/vgaudio/containers/AudioWithConfig.h src/lib/common/io/MemoryStream.cpp src/lib/common/io/MemoryStream.h src/lib/vgaudio/containers/IAudioReader.h src/lib/vgaudio/containers/IAudioReader.cpp src/lib/vgaudio/containers/IAudioWriter.cpp src/lib/vgaudio/containers/IAudioWriter.h src/lib/vgaudio/containers/AudioReader.h src/lib/vgaudio/containers/IStructure.h src/lib/vgaudio/containers/hca/HcaReader.cpp src/lib/vgaudio/containers/hca/HcaReader.h src/lib/vgaudio/containers/hca/HcaStructure.h src/lib/common/utilities/endian.cpp src/lib/common/utilities/endian.h src/lib/vgaudio/containers/AudioWriter.h src/lib/vgaudio/containers/hca/HcaWriter.cpp src/lib/vgaudio/containers/hca/HcaWriter.h src/lib/vgaudio/containers/hca/HcaStructure.cpp src/lib/common/utilities/bswap.h src/lib/common/io/BinaryWriterLE.cpp src/lib/common/io/BinaryWriterLE.h src/lib/common/io/BinaryWriterBE.cpp src/lib/common/io/BinaryWriterBE.h src/lib/common/io/BinaryReaderLE.cpp src/lib/common/io/BinaryReaderLE.h src/lib/common/io/BinaryReaderBE.cpp src/lib/common/io/BinaryReaderBE.h src/lib/common/utilities/EndianHelper.cpp src/lib/common/utilities/EndianHelper.h src/lib/vgaudio/codecs/crihca/CriHcaParameters.cpp src/lib/vgaudio/codecs/CodecParameters.cpp src/lib/vgaudio/codecs/crihca/CriHcaEncryption.cpp src/lib/vgaudio/codecs/crihca/CriHcaEncryption.h src/lib/vgaudio/formats/pcm16/Pcm16Format.cpp src/lib/vgaudio/formats/pcm16/Pcm16Format.h src/lib/common/utilities/traits.h src/api/vgaudio.h src/lib/thread_fix.h src/lib/vgaudio/utilities/ArrayUnpacker.cpp src/lib/vgaudio/utilities/ArrayUnpacker.h src/lib/common/io/compression/DeflateStream.cpp src/lib/common/io/compression/DeflateStream.h src/lib/common/io/compression/CompressionMode.h src/lib/common/io/compression/IDeflater.h src/lib/common/io/compression/ZLibDeflater.cpp src/lib/common/io/compression/ZLibDeflater.h src/lib/common/utilities/defer.h src/lib/common/io/compression/IInflater.h src/lib/common/io/compression/ZLibInflater.cpp src/lib/common/io/compression/ZLibInflater.h src/lib/common/io/compression/private/zlib_debug.h src/lib/common/io/compression/private/zlib_debug.cpp src/lib/common/io/compression/private/zlib_settings.h src/lib/vgaudio/utilities/private/ArrayUnpackerStatic.cpp src/lib/vgaudio/utilities/private/ArrayUnpackerStatic.h src/lib/common/utilities/err.h src/lib/common/utilities/Guid.cpp src/lib/common/utilities/Guid.h src/lib/vgaudio/utilities/riff/MediaSubtypes.cpp src/lib/vgaudio/utilities/riff/MediaSubtypes.h src/lib/vgaudio/utilities/riff/RiffSubChunk.cpp src/lib/vgaudio/utilities/riff/RiffSubChunk.h src/lib/vgaudio/utilities/riff/RiffChunk.cpp src/lib/vgaudio/utilities/riff/RiffChunk.h src/lib/vgaudio/utilities/riff/WaveDataChunk.cpp src/lib/vgaudio/utilities/riff/WaveDataChunk.h src/lib/vgaudio/utilities/riff/RiffParser.cpp src/lib/vgaudio/utilities/riff/RiffParser.h src/lib/vgaudio/utilities/riff/WaveFormatTags.h src/lib/vgaudio/utilities/riff/WaveFactChunk.cpp src/lib/vgaudio/utilities/riff/WaveFactChunk.h src/lib/vgaudio/utilities/riff/WaveFormatExtensible.cpp src/lib/vgaudio/utilities/riff/WaveFormatExtensible.h src/lib/vgaudio/utilities/riff/WaveFmtChunk.cpp src/lib/vgaudio/utilities/riff/WaveFmtChunk.h src/lib/vgaudio/utilities/riff/WaveSmplChunk.cpp src/lib/vgaudio/utilities/riff/WaveSmplChunk.h src/lib/vgaudio/containers/wave/WaveCodec.h src/lib/vgaudio/utilities/Interleave.h src/lib/vgaudio/utilities/Interleave.cpp src/lib/vgaudio/containers/wave/WaveStructure.cpp src/lib/vgaudio/containers/wave/WaveStructure.h src/lib/vgaudio/containers/wave/WaveConfiguration.cpp src/lib/vgaudio/containers/wave/WaveConfiguration.h src/lib/vgaudio/containers/wave/WaveReader.cpp src/lib/vgaudio/containers/wave/WaveReader.h src/lib/vgaudio/codecs/pcm8/Pcm8Codec.cpp src/lib/vgaudio/codecs/pcm8/Pcm8Codec.h src/lib/vgaudio/formats/pcm8/Pcm8FormatBase.cpp src/lib/vgaudio/formats/pcm8/Pcm8FormatBase.h src/lib/vgaudio/formats/pcm8/Pcm8FormatBuilder.cpp src/lib/vgaudio/formats/pcm8/Pcm8FormatBuilder.h src/lib/vgaudio/formats/pcm8/SignedPcm8Format.cpp src/lib/vgaudio/formats/pcm8/SignedPcm8Format.h src/lib/vgaudio/formats/pcm8/UnsignedPcm8Format.cpp src/lib/vgaudio/formats/pcm8/UnsignedPcm8Format.h src/lib/common/io/File.cpp src/lib/common/io/File.h src/lib/vgaudio/containers/wave/WaveWriter.cpp src/lib/vgaudio/containers/wave/WaveWriter.h src/api/modules/misc.h src/api/modules/deflate.h src/api/modules/vga_byte_buffer.h src/api/modules/hca.h src/api/private/vga_bool.h src/lib/api/modules/deflate.cpp src/lib/api/modules/hca.cpp src/lib/api/modules/misc.cpp src/lib/api/modules/vga_byte_buffer_impl.cpp src/lib/api/modules/vga_byte_buffer_impl.h src/api/modules/vga_progress_reporter.h src/lib/api/modules/progress_report.cpp src/lib/api/modules/progress_report.h src/lib/common/utilities/private/runtime_jagged_array_container.h src/lib/common/utilities/runtime_jagged_array.h src/lib/vgaudio/codecs/crihca/private/CriHcaDecoderStatic.h src/lib/vgaudio/codecs/crihca/private/CriHcaDecoderStatic.cpp src/lib/vgaudio/codecs/crihca/private/CriHcaEncoderStatic.cpp src/lib/vgaudio/codecs/crihca/private/CriHcaEncoderStatic.h src/lib/vgaudio/codecs/crihca/private/CriHcaPackingStatic.cpp src/lib/vgaudio/codecs/crihca/private/CriHcaPackingStatic.h src/api/modules/vga_handle.h src/lib/api/modules/vga_handle_impl.h src/lib/api/modules/vga_handle_impl.cpp src/lib/api/modules/vga_object_type.h src/lib/vgaudio/codecs/criadx/CriAdxParameters.cpp src/lib/vgaudio/codecs/criadx/CriAdxParameters.h src/lib/vgaudio/codecs/criadx/CriAdxType.h src/lib/vgaudio/codecs/criadx/CriAdxCodec.cpp src/lib/vgaudio/codecs/criadx/CriAdxCodec.h src/lib/vgaudio/codecs/criadx/CriAdxKey.cpp src/lib/vgaudio/codecs/criadx/CriAdxKey.h src/lib/common/utilities/compare.h src/lib/vgaudio/formats/criadx/CriAdxChannel.cpp src/lib/vgaudio/formats/criadx/CriAdxChannel.h src/lib/vgaudio/formats/criadx/CriAdxHelpers.cpp src/lib/vgaudio/formats/criadx/CriAdxHelpers.h src/lib/vgaudio/formats/criadx/CriAdxFormat.cpp src/lib/vgaudio/formats/criadx/CriAdxFormat.h src/lib/vgaudio/formats/criadx/CriAdxFormatBuilder.cpp src/lib/vgaudio/formats/criadx/CriAdxFormatBuilder.h src/lib/vgaudio/containers/adx/AdxConfiguration.cpp src/lib/vgaudio/containers/adx/AdxConfiguration.h src/lib/vgaudio/containers/adx/AdxStructure.cpp src/lib/vgaudio/containers/adx/AdxStructure.h src/lib/vgaudio/containers/adx/AdxReader.cpp src/lib/vgaudio/containers/adx/AdxReader.h src/lib/vgaudio/codecs/criadx/CriAdxEncryption.cpp src/lib/vgaudio/codecs/criadx/CriAdxEncryption.h src/lib/vgaudio/containers/adx/AdxWriter.cpp src/lib/vgaudio/containers/adx/AdxWriter.h src/lib/common/utilities/_cxx17.h src/lib/vgaudio/codecs/crihca/CriHcaConstants.cpp src/lib/vgaudio/utilities/riff/WaveFormatTags.cpp)

# Now, real targets

add_library(vgaudio SHARED ${VGAUDIO_SOURCE})
add_library(vgaudio_static ${VGAUDIO_SOURCE})

if (NOT VGAUDIO_DONT_GENERATE_TEST_TARGETS)
    add_executable(test_misc test/test_misc/test_misc.cpp)
    add_executable(test_deflate test/test_deflate/test_deflate.cpp)
    add_executable(test_wave_io test/test_wave_io/test_wave_io.cpp)
endif ()

add_executable(hcaenc src/apps/hcaenc/hcaenc.cpp)
add_executable(hcadec src/apps/hcadec/hcadec.cpp)
