#directory cmake-proxies/libsndfile
set( TARGET libsndfile )
set( TARGET_SOURCE ${LIB_SRC_DIRECTORY}${TARGET} )
project( ${TARGET} )

set( SOURCES 
#${LIB_SRC_DIRECTORY}libsndfile/examples/generate.c
#${LIB_SRC_DIRECTORY}libsndfile/examples/list_formats.c
#${LIB_SRC_DIRECTORY}libsndfile/examples/make_sine.c
#${LIB_SRC_DIRECTORY}libsndfile/examples/sfprocess.c
#${LIB_SRC_DIRECTORY}libsndfile/examples/sndfile-to-text.c
#${LIB_SRC_DIRECTORY}libsndfile/programs/common.c
#${LIB_SRC_DIRECTORY}libsndfile/programs/sndfile-cmp.c
#${LIB_SRC_DIRECTORY}libsndfile/programs/sndfile-concat.c
#${LIB_SRC_DIRECTORY}libsndfile/programs/sndfile-convert.c
#${LIB_SRC_DIRECTORY}libsndfile/programs/sndfile-deinterleave.c
#${LIB_SRC_DIRECTORY}libsndfile/programs/sndfile-info.c
#${LIB_SRC_DIRECTORY}libsndfile/programs/sndfile-interleave.c
#${LIB_SRC_DIRECTORY}libsndfile/programs/sndfile-metadata-get.c
#${LIB_SRC_DIRECTORY}libsndfile/programs/sndfile-metadata-set.c
#${LIB_SRC_DIRECTORY}libsndfile/programs/sndfile-play.c
#${LIB_SRC_DIRECTORY}libsndfile/programs/sndfile-salvage.c
#${LIB_SRC_DIRECTORY}libsndfile/regtest/checksum.c
#${LIB_SRC_DIRECTORY}libsndfile/regtest/database.c
#${LIB_SRC_DIRECTORY}libsndfile/regtest/sndfile-regtest.c
${LIB_SRC_DIRECTORY}libsndfile/src/aiff.c
${LIB_SRC_DIRECTORY}libsndfile/src/alaw.c
${LIB_SRC_DIRECTORY}libsndfile/src/au.c
${LIB_SRC_DIRECTORY}libsndfile/src/audio_detect.c
${LIB_SRC_DIRECTORY}libsndfile/src/avr.c
${LIB_SRC_DIRECTORY}libsndfile/src/broadcast.c
${LIB_SRC_DIRECTORY}libsndfile/src/caf.c
${LIB_SRC_DIRECTORY}libsndfile/src/chanmap.c
${LIB_SRC_DIRECTORY}libsndfile/src/chunk.c
${LIB_SRC_DIRECTORY}libsndfile/src/command.c
${LIB_SRC_DIRECTORY}libsndfile/src/common.c
${LIB_SRC_DIRECTORY}libsndfile/src/dither.c
${LIB_SRC_DIRECTORY}libsndfile/src/double64.c
${LIB_SRC_DIRECTORY}libsndfile/src/dwd.c
${LIB_SRC_DIRECTORY}libsndfile/src/dwvw.c
${LIB_SRC_DIRECTORY}libsndfile/src/file_io.c
${LIB_SRC_DIRECTORY}libsndfile/src/flac.c
${LIB_SRC_DIRECTORY}libsndfile/src/float32.c
${LIB_SRC_DIRECTORY}libsndfile/src/g72x.c
${LIB_SRC_DIRECTORY}libsndfile/src/gsm610.c
${LIB_SRC_DIRECTORY}libsndfile/src/htk.c
${LIB_SRC_DIRECTORY}libsndfile/src/id3.c
${LIB_SRC_DIRECTORY}libsndfile/src/ima_adpcm.c
${LIB_SRC_DIRECTORY}libsndfile/src/ima_oki_adpcm.c
${LIB_SRC_DIRECTORY}libsndfile/src/interleave.c
${LIB_SRC_DIRECTORY}libsndfile/src/ircam.c
${LIB_SRC_DIRECTORY}libsndfile/src/macbinary3.c
${LIB_SRC_DIRECTORY}libsndfile/src/macos.c
${LIB_SRC_DIRECTORY}libsndfile/src/mat4.c
${LIB_SRC_DIRECTORY}libsndfile/src/mat5.c
${LIB_SRC_DIRECTORY}libsndfile/src/mpc2k.c
${LIB_SRC_DIRECTORY}libsndfile/src/ms_adpcm.c
${LIB_SRC_DIRECTORY}libsndfile/src/nist.c
${LIB_SRC_DIRECTORY}libsndfile/src/ogg.c
${LIB_SRC_DIRECTORY}libsndfile/src/paf.c
${LIB_SRC_DIRECTORY}libsndfile/src/pcm.c
${LIB_SRC_DIRECTORY}libsndfile/src/pvf.c
${LIB_SRC_DIRECTORY}libsndfile/src/raw.c
${LIB_SRC_DIRECTORY}libsndfile/src/rf64.c
${LIB_SRC_DIRECTORY}libsndfile/src/rx2.c
${LIB_SRC_DIRECTORY}libsndfile/src/sd2.c
${LIB_SRC_DIRECTORY}libsndfile/src/sds.c
${LIB_SRC_DIRECTORY}libsndfile/src/sndfile.c
${LIB_SRC_DIRECTORY}libsndfile/src/strings.c
${LIB_SRC_DIRECTORY}libsndfile/src/svx.c
#${LIB_SRC_DIRECTORY}libsndfile/src/test_audio_detect.c
#${LIB_SRC_DIRECTORY}libsndfile/src/test_broadcast_var.c
#${LIB_SRC_DIRECTORY}libsndfile/src/test_conversions.c
#${LIB_SRC_DIRECTORY}libsndfile/src/test_endswap.c
#${LIB_SRC_DIRECTORY}libsndfile/src/test_file_io.c
#${LIB_SRC_DIRECTORY}libsndfile/src/test_float.c
#${LIB_SRC_DIRECTORY}libsndfile/src/test_ima_oki_adpcm.c
#${LIB_SRC_DIRECTORY}libsndfile/src/test_log_printf.c
#${LIB_SRC_DIRECTORY}libsndfile/src/test_main.c
#${LIB_SRC_DIRECTORY}libsndfile/src/test_strncpy_crlf.c
${LIB_SRC_DIRECTORY}libsndfile/src/txw.c
${LIB_SRC_DIRECTORY}libsndfile/src/ulaw.c
${LIB_SRC_DIRECTORY}libsndfile/src/voc.c
${LIB_SRC_DIRECTORY}libsndfile/src/vox_adpcm.c
${LIB_SRC_DIRECTORY}libsndfile/src/w64.c
${LIB_SRC_DIRECTORY}libsndfile/src/wav.c
${LIB_SRC_DIRECTORY}libsndfile/src/wav_w64.c
${LIB_SRC_DIRECTORY}libsndfile/src/windows.c
${LIB_SRC_DIRECTORY}libsndfile/src/wve.c
${LIB_SRC_DIRECTORY}libsndfile/src/xi.c
${LIB_SRC_DIRECTORY}libsndfile/src/G72x/g721.c
${LIB_SRC_DIRECTORY}libsndfile/src/G72x/g723_16.c
${LIB_SRC_DIRECTORY}libsndfile/src/G72x/g723_24.c
${LIB_SRC_DIRECTORY}libsndfile/src/G72x/g723_40.c
${LIB_SRC_DIRECTORY}libsndfile/src/G72x/g72x.c
#${LIB_SRC_DIRECTORY}libsndfile/src/G72x/g72x_test.c
${LIB_SRC_DIRECTORY}libsndfile/src/GSM610/add.c
${LIB_SRC_DIRECTORY}libsndfile/src/GSM610/code.c
${LIB_SRC_DIRECTORY}libsndfile/src/GSM610/decode.c
${LIB_SRC_DIRECTORY}libsndfile/src/GSM610/gsm_create.c
${LIB_SRC_DIRECTORY}libsndfile/src/GSM610/gsm_decode.c
${LIB_SRC_DIRECTORY}libsndfile/src/GSM610/gsm_destroy.c
${LIB_SRC_DIRECTORY}libsndfile/src/GSM610/gsm_encode.c
${LIB_SRC_DIRECTORY}libsndfile/src/GSM610/gsm_option.c
${LIB_SRC_DIRECTORY}libsndfile/src/GSM610/long_term.c
${LIB_SRC_DIRECTORY}libsndfile/src/GSM610/lpc.c
${LIB_SRC_DIRECTORY}libsndfile/src/GSM610/preprocess.c
${LIB_SRC_DIRECTORY}libsndfile/src/GSM610/rpe.c
${LIB_SRC_DIRECTORY}libsndfile/src/GSM610/short_term.c
${LIB_SRC_DIRECTORY}libsndfile/src/GSM610/table.c
#${LIB_SRC_DIRECTORY}libsndfile/tests/aiff_rw_test.c
#${LIB_SRC_DIRECTORY}libsndfile/tests/alaw_test.c
#${LIB_SRC_DIRECTORY}libsndfile/tests/benchmark.c
#${LIB_SRC_DIRECTORY}libsndfile/tests/checksum_test.c
#${LIB_SRC_DIRECTORY}libsndfile/tests/command_test.c
#${LIB_SRC_DIRECTORY}libsndfile/tests/dft_cmp.c
#${LIB_SRC_DIRECTORY}libsndfile/tests/dither_test.c
#${LIB_SRC_DIRECTORY}libsndfile/tests/dwvw_test.c
#${LIB_SRC_DIRECTORY}libsndfile/tests/error_test.c
#${LIB_SRC_DIRECTORY}libsndfile/tests/external_libs_test.c
#${LIB_SRC_DIRECTORY}libsndfile/tests/fix_this.c
#${LIB_SRC_DIRECTORY}libsndfile/tests/floating_point_test.c
#${LIB_SRC_DIRECTORY}libsndfile/tests/generate.c
#${LIB_SRC_DIRECTORY}libsndfile/tests/headerless_test.c
#${LIB_SRC_DIRECTORY}libsndfile/tests/header_test.c
#${LIB_SRC_DIRECTORY}libsndfile/tests/largefile_test.c
#${LIB_SRC_DIRECTORY}libsndfile/tests/locale_test.c
#${LIB_SRC_DIRECTORY}libsndfile/tests/lossy_comp_test.c
#${LIB_SRC_DIRECTORY}libsndfile/tests/misc_test.c
#${LIB_SRC_DIRECTORY}libsndfile/tests/multi_file_test.c
#${LIB_SRC_DIRECTORY}libsndfile/tests/ogg_test.c
#${LIB_SRC_DIRECTORY}libsndfile/tests/pcm_test.c
#${LIB_SRC_DIRECTORY}libsndfile/tests/peak_chunk_test.c
#${LIB_SRC_DIRECTORY}libsndfile/tests/pipe_test.c
#${LIB_SRC_DIRECTORY}libsndfile/tests/raw_test.c
#${LIB_SRC_DIRECTORY}libsndfile/tests/rdwr_test.c
#${LIB_SRC_DIRECTORY}libsndfile/tests/scale_clip_test.c
#${LIB_SRC_DIRECTORY}libsndfile/tests/sfversion.c
#${LIB_SRC_DIRECTORY}libsndfile/tests/stdin_test.c
#${LIB_SRC_DIRECTORY}libsndfile/tests/stdio_test.c
#${LIB_SRC_DIRECTORY}libsndfile/tests/stdout_test.c
#${LIB_SRC_DIRECTORY}libsndfile/tests/string_test.c
#${LIB_SRC_DIRECTORY}libsndfile/tests/ulaw_test.c
#${LIB_SRC_DIRECTORY}libsndfile/tests/utils.c
#${LIB_SRC_DIRECTORY}libsndfile/tests/virtual_io_test.c
#${LIB_SRC_DIRECTORY}libsndfile/tests/vorbis_test.c
#${LIB_SRC_DIRECTORY}libsndfile/tests/win32_ordinal_test.c
#${LIB_SRC_DIRECTORY}libsndfile/tests/win32_test.c
#${LIB_SRC_DIRECTORY}libsndfile/tests/write_read_test.c
#${LIB_SRC_DIRECTORY}libsndfile/Win32/testprog.c
#${LIB_SRC_DIRECTORY}libsndfile/programs/sndfile-play-beos.cpp

)
# This defines the #define on both Windows and Linux.
add_definitions( 
-D_LIB
-Dinline=__inline
-DLIBSNDFILE_PRIVATE_CONFIG
 )
add_library( ${TARGET} STATIC ${SOURCES})

add_compile_options(/wd4996)

target_include_directories( ${TARGET} PRIVATE 
${TARGET_SOURCE}/include
${TARGET_SOURCE}/src
${LIB_SRC_DIRECTORY}/ffmpeg/win32
${top_dir}/win/Projects/libsndfile #to get config.h
)

target_link_libraries( ${TARGET} )