2020-08-03 09:11:31 +00:00
cmake_minimum_required ( VERSION 3.1..3.18 )
2020-03-08 05:28:46 +00:00
2020-08-23 08:57:21 +00:00
# MSVC runtime library flags are selected by an abstraction, CMake >= 3.15
# This policy still need to be set even with cmake_minimum_required() command above.
2020-09-17 14:15:03 +00:00
if ( POLICY CMP0091 )
2020-10-12 05:29:03 +00:00
if ( ( DEFINED ENABLE_STATIC_RUNTIME ) AND ( DEFINED CMAKE_MSVC_RUNTIME_LIBRARY ) )
message ( FATAL_ERROR "Both ENABLE_STATIC_RUNTIME and CMAKE_MSVC_RUNTIME_LIBRARY are set." )
return ( )
endif ( )
if ( DEFINED CMAKE_MSVC_RUNTIME_LIBRARY )
cmake_policy ( SET CMP0091 NEW )
else ( )
cmake_policy ( SET CMP0091 OLD )
endif ( )
2020-09-17 14:15:03 +00:00
endif ( )
2020-08-23 08:57:21 +00:00
2021-11-21 09:18:47 +00:00
option ( ENABLE_EXTERNAL_LIBS "Enable FLAC, Vorbis, and Opus codecs" ON )
if ( ENABLE_EXTERNAL_LIBS )
list ( APPEND VCPKG_MANIFEST_FEATURES "external-libs" )
endif ( )
option ( ENABLE_MPEG "Enable MPEG codecs" ON )
if ( ENABLE_MPEG )
list ( APPEND VCPKG_MANIFEST_FEATURES "mpeg" )
endif ( )
option ( ENABLE_EXPERIMENTAL "Enable experimental code" OFF )
if ( ENABLE_EXPERIMENTAL )
list ( APPEND VCPKG_MANIFEST_FEATURES "speex" )
endif ( )
option ( BUILD_REGTEST "Build regtest" OFF )
if ( BUILD_REGTEST )
list ( APPEND VCPKG_MANIFEST_FEATURES "regtest" )
endif ( )
2021-06-13 13:33:10 +00:00
project ( libsndfile VERSION 1.1.0 )
2014-07-12 08:00:51 +00:00
2016-07-26 08:41:17 +00:00
#
# Variables
#
2014-10-28 10:00:02 +00:00
2016-07-26 08:41:17 +00:00
set ( CMAKE_C_STANDARD 99 )
set ( CMAKE_C_STANDARD_REQUIRED TRUE )
2017-04-13 06:11:02 +00:00
set_property ( GLOBAL PROPERTY USE_FOLDERS ON )
2020-10-13 04:32:11 +00:00
set ( PACKAGE_NAME ${ PROJECT_NAME } )
2017-04-13 06:11:02 +00:00
set ( CPACK_PACKAGE_VERSION_MAJOR ${ PROJECT_VERSION_MAJOR } )
set ( CPACK_PACKAGE_VERSION_MINOR ${ PROJECT_VERSION_MINOR } )
set ( CPACK_PACKAGE_VERSION_PATCH ${ PROJECT_VERSION_PATCH } )
2021-10-24 12:53:12 +00:00
set ( CPACK_PACKAGE_VERSION_STAGE "beta2" )
2017-04-13 06:11:02 +00:00
set ( CPACK_PACKAGE_VERSION_FULL "${PROJECT_VERSION}${CPACK_PACKAGE_VERSION_STAGE}" )
2016-07-02 01:47:31 +00:00
2016-07-26 08:41:17 +00:00
#
# System-wide includes
#
2016-07-02 01:47:31 +00:00
2016-07-26 08:41:17 +00:00
include ( GNUInstallDirs )
include ( FeatureSummary )
2017-04-13 06:11:02 +00:00
include ( CMakeDependentOption )
2018-08-19 03:56:17 +00:00
include ( CTest )
2020-12-10 07:36:18 +00:00
include ( CheckCCompilerFlag )
2016-07-02 01:47:31 +00:00
2016-07-26 08:41:17 +00:00
#
# Options
#
2016-07-02 01:47:31 +00:00
2018-08-19 03:56:17 +00:00
option ( BUILD_SHARED_LIBS "Build shared libraries" OFF )
if ( BUILD_SHARED_LIBS AND BUILD_TESTING )
set ( BUILD_TESTING OFF )
message ( "Build testing required static libraries. To prevent build errors BUILD_TESTING disabled." )
endif ( )
2017-04-09 12:31:46 +00:00
option ( BUILD_PROGRAMS "Build programs" ON )
2017-04-13 06:11:02 +00:00
option ( BUILD_EXAMPLES "Build examples" ON )
option ( ENABLE_CPACK "Enable CPack support" ON )
option ( ENABLE_BOW_DOCS "Enable black-on-white html docs" OFF )
2020-10-12 05:29:03 +00:00
if ( MSVC AND ( DEFINED ENABLE_STATIC_RUNTIME ) )
option ( ENABLE_STATIC_RUNTIME "Enable static runtime" ${ ENABLE_STATIC_RUNTIME } )
2020-10-13 04:08:28 +00:00
elseif ( MINGW )
option ( ENABLE_STATIC_RUNTIME "Enable static runtime" OFF )
2017-04-13 06:11:02 +00:00
endif ( )
2018-08-19 03:56:17 +00:00
option ( ENABLE_PACKAGE_CONFIG "Generate and install package config file" ON )
2020-08-18 06:27:43 +00:00
option ( INSTALL_PKGCONFIG_MODULE "Generate and install pkg-config module" ON )
2017-04-13 06:11:02 +00:00
2018-08-19 03:56:17 +00:00
list ( APPEND CMAKE_MODULE_PATH "${CMAKE_CURRENT_SOURCE_DIR}/cmake" )
2020-10-27 09:23:51 +00:00
if ( CMAKE_VERSION VERSION_LESS 3.14 )
list ( APPEND CMAKE_MODULE_PATH "${CMAKE_CURRENT_SOURCE_DIR}/cmake/sqlite" )
endif ( )
2014-07-29 05:33:18 +00:00
2016-07-26 08:41:17 +00:00
#
# Setup definitions
#
2014-07-29 05:33:18 +00:00
2018-08-25 20:03:09 +00:00
include ( SndFileChecks )
2014-07-29 05:33:18 +00:00
2021-11-21 09:18:47 +00:00
if ( ENABLE_EXTERNAL_LIBS AND NOT ( Vorbis_FOUND OR FLAC_FOUND OR OPUS_FOUND ) )
set ( ENABLE_EXTERNAL_LIBS OFF )
endif ( )
if ( ENABLE_MPEG AND ( NOT HAVE_MPEG_LIBS ) )
set ( ENABLE_MPEG OFF )
endif ( )
if ( BUILD_REGTEST AND ( NOT SQLITE3_FOUND ) )
set ( BUILD_REGTEST OFF )
endif ( )
2017-04-13 06:11:02 +00:00
2018-08-19 03:56:17 +00:00
cmake_dependent_option ( ENABLE_CPU_CLIP "Enable tricky cpu specific clipper" ON "CPU_CLIPS_POSITIVE;CPU_CLIPS_NEGATIVE" OFF )
if ( NOT ENABLE_CPU_CLIP )
set ( CPU_CLIPS_POSITIVE FALSE )
set ( CPU_CLIPS_NEGATIVE FALSE )
endif ( )
2020-08-28 04:42:44 +00:00
cmake_dependent_option ( ENABLE_COMPATIBLE_LIBSNDFILE_NAME "Set DLL name to libsndfile-1.dll (canonical name), sndfile.dll otherwise" OFF "WIN32;BUILD_SHARED_LIBS" OFF )
2020-09-30 04:32:17 +00:00
cmake_dependent_option ( INSTALL_MANPAGES "Install man pages for programs" ON "BUILD_PROGRAMS" OFF )
2018-08-19 03:56:17 +00:00
2020-12-10 07:36:18 +00:00
if ( NOT MSVC )
if ( CPU_IS_X86 )
check_c_compiler_flag ( -msse2 HAVE_MSSE2_COMPILER_FLAG )
if ( HAVE_MSSE2_COMPILER_FLAG )
cmake_dependent_option ( ENABLE_SSE2 "Add SSE2 compiler flag" ON "HAVE_MSSE2_COMPILER_FLAG" OFF )
endif ( )
endif ( )
endif ( )
if ( ENABLE_SSE2 )
add_compile_options ( -msse2 )
endif ( )
2018-08-19 03:56:17 +00:00
set ( HAVE_EXTERNAL_XIPH_LIBS ${ ENABLE_EXTERNAL_LIBS } )
set ( HAVE_SQLITE3 ${ BUILD_REGTEST } )
set ( HAVE_ALSA_ASOUNDLIB_H ${ ALSA_FOUND } )
set ( HAVE_SNDIO_H ${ SNDIO_FOUND } )
set ( ENABLE_EXPERIMENTAL_CODE ${ ENABLE_EXPERIMENTAL } )
2021-03-26 07:32:45 +00:00
set ( HAVE_MPEG ${ ENABLE_MPEG } )
2018-08-19 03:56:17 +00:00
set ( HAVE_SPEEX ${ ENABLE_EXPERIMENTAL } )
add_feature_info ( BUILD_SHARED_LIBS BUILD_SHARED_LIBS "build shared libraries" )
Opus file support
Ogg: Introduce new functions ogg_sync_fseek(), ogg_ftell(), ogg_next_page(),
ogg_stream_next_page(), ogg_sync_last_page_before(), and
ogg_stream_unpack_page(). Use ogg_sync_* for ogg_read_first_page(). Bump libogg
version requirement from 1.1.3 to 1.3.0 as LibOgg 1.3.0 is required for
ogg_stream_pageout_fill() and ogg_stream_flush_fill().
Opus: Add opus support. Document added commands
SFC_(GET|SET)_ORIGINAL_SAMPLERATE. Added or extended tests ogg_opus_test,
compression_size_test, floating_point_test, lossy_comp_test, string_test,
external_libs_test. Change Opus to non-experimental.
2018-07-09 21:37:06 +00:00
add_feature_info ( ENABLE_EXTERNAL_LIBS ENABLE_EXTERNAL_LIBS "enable FLAC, Vorbis, and Opus codecs" )
2019-02-10 06:45:55 +00:00
add_feature_info ( ENABLE_MPEG ENABLE_MPEG "enable MPEG audio (including mp3) codecs" )
2018-08-19 03:56:17 +00:00
add_feature_info ( ENABLE_EXPERIMENTAL ENABLE_EXPERIMENTAL "enable experimental code" )
add_feature_info ( BUILD_TESTING BUILD_TESTING "build tests" )
add_feature_info ( BUILD_REGTEST BUILD_REGTEST "build regtest" )
add_feature_info ( ENABLE_CPACK ENABLE_CPACK "enable CPack support" )
add_feature_info ( ENABLE_CPU_CLIP ENABLE_CPU_CLIP "Enable tricky cpu specific clipper" )
add_feature_info ( ENABLE_BOW_DOCS ENABLE_BOW_DOCS "enable black-on-white html docs" )
add_feature_info ( ENABLE_PACKAGE_CONFIG ENABLE_PACKAGE_CONFIG "generate and install package config file" )
2020-08-18 06:27:43 +00:00
add_feature_info ( INSTALL_PKGCONFIG_MODULE INSTALL_PKGCONFIG_MODULE "generate and install pkg-config module" )
2020-08-28 04:54:31 +00:00
add_feature_info ( INSTALL_MANPAGES INSTALL_MANPAGES "install man pages for programs" )
2020-08-28 04:42:44 +00:00
if ( WIN32 AND BUILD_SHARED_LIBS )
2018-08-20 03:03:50 +00:00
add_feature_info ( ENABLE_COMPATIBLE_LIBSNDFILE_NAME ENABLE_COMPATIBLE_LIBSNDFILE_NAME "Set DLL name to libsndfile-1.dll (canonical name), sndfile.dll otherwise" )
endif ( )
2017-04-13 06:11:02 +00:00
2020-12-10 07:36:18 +00:00
if ( HAVE_MSSE2_COMPILER_FLAG )
add_feature_info ( ENABLE_SSE2 ENABLE_SSE2 "add SSE2 compiler flag" )
2018-08-19 03:56:17 +00:00
endif ( )
2014-07-29 05:33:18 +00:00
2020-12-10 07:36:18 +00:00
2018-08-19 03:56:17 +00:00
set_package_properties ( Ogg PROPERTIES
T Y P E R E C O M M E N D E D
2016-07-26 08:41:17 +00:00
U R L " w w w . x i p h . o r g / o g g / "
D E S C R I P T I O N " l i b r a r y f o r m a n i p u l a t i n g o g g b i t s t r e a m s "
Opus file support
Ogg: Introduce new functions ogg_sync_fseek(), ogg_ftell(), ogg_next_page(),
ogg_stream_next_page(), ogg_sync_last_page_before(), and
ogg_stream_unpack_page(). Use ogg_sync_* for ogg_read_first_page(). Bump libogg
version requirement from 1.1.3 to 1.3.0 as LibOgg 1.3.0 is required for
ogg_stream_pageout_fill() and ogg_stream_flush_fill().
Opus: Add opus support. Document added commands
SFC_(GET|SET)_ORIGINAL_SAMPLERATE. Added or extended tests ogg_opus_test,
compression_size_test, floating_point_test, lossy_comp_test, string_test,
external_libs_test. Change Opus to non-experimental.
2018-07-09 21:37:06 +00:00
P U R P O S E " R e q u i r e d t o e n a b l e V o r b i s , S p e e x , a n d O p u s s u p p o r t "
2018-08-19 03:56:17 +00:00
)
2020-04-11 06:42:21 +00:00
set_package_properties ( Vorbis PROPERTIES
2018-08-19 03:56:17 +00:00
T Y P E R E C O M M E N D E D
2016-07-26 08:41:17 +00:00
U R L " w w w . v o r b i s . c o m / "
D E S C R I P T I O N " o p e n s o u r c e l o s s y a u d i o c o d e c "
2018-08-19 03:56:17 +00:00
P U R P O S E " E n a b l e s V o r b i s s u p p o r t "
)
set_package_properties ( FLAC PROPERTIES
T Y P E R E C O M M E N D E D
2016-07-26 08:41:17 +00:00
U R L " w w w . x i p h . o r g / f l a c / "
D E S C R I P T I O N " F r e e L o s s l e s s A u d i o C o d e c L i b r a r y "
2018-08-19 03:56:17 +00:00
P U R P O S E " E n a b l e s F L A C s u p p o r t "
)
2021-03-27 07:31:29 +00:00
set_package_properties ( Lame PROPERTIES
T Y P E R E C O M M E N D E D
2019-02-10 06:45:55 +00:00
U R L " h t t p s : / / l a m e . s o u r c e f o r g e . i o / "
D E S C R I P T I O N " H i g h q u a l i t y M P E G A u d i o L a y e r III ( MP3 ) e n c o d e r "
P U R P O S E " E n a b l e s M P E G l a y e r III ( MP3 ) w r i t i n g s u p p o r t "
)
set_package_properties ( MPG123 PROPERTIES
2021-03-27 07:31:29 +00:00
T Y P E R E C O M M E N D E D
2019-02-10 06:45:55 +00:00
U R L " h t t p s : / / w w w . m p g 1 2 3 . d e / "
D E S C R I P T I O N " M P E G A u d i o L a y e r I / I I / I I I d e c o d e r "
P U R P O S E " E n a b l e s M P E G A u d i o r e a d i n g s u p p o r t "
)
Opus file support
Ogg: Introduce new functions ogg_sync_fseek(), ogg_ftell(), ogg_next_page(),
ogg_stream_next_page(), ogg_sync_last_page_before(), and
ogg_stream_unpack_page(). Use ogg_sync_* for ogg_read_first_page(). Bump libogg
version requirement from 1.1.3 to 1.3.0 as LibOgg 1.3.0 is required for
ogg_stream_pageout_fill() and ogg_stream_flush_fill().
Opus: Add opus support. Document added commands
SFC_(GET|SET)_ORIGINAL_SAMPLERATE. Added or extended tests ogg_opus_test,
compression_size_test, floating_point_test, lossy_comp_test, string_test,
external_libs_test. Change Opus to non-experimental.
2018-07-09 21:37:06 +00:00
set_package_properties ( Opus PROPERTIES
T Y P E R E C O M M E N D E D
U R L " w w w . o p u s - c o d e c . o r g / "
D E S C R I P T I O N " S t a n d a r d i z e d o p e n s o u r c e l o w - l a t e n c y f u l l b a n d c o d e c "
P U R P O S E " E n a b l e s e x p e r i m e n t a l O p u s s u p p o r t "
)
2016-07-26 08:41:17 +00:00
set_package_properties ( Speex PROPERTIES TYPE OPTIONAL
U R L " w w w . s p e e x . o r g / "
D E S C R I P T I O N " a n a u d i o c o d e c t u n e d f o r s p e e c h "
2018-08-19 03:56:17 +00:00
P U R P O S E " E n a b l e s e x p e r e m e n t a l S p e e x s u p p o r t "
)
set_package_properties ( SQLite3 PROPERTIES
T Y P E O P T I O N A L
2017-04-13 06:11:02 +00:00
U R L " w w w . s q l i t e . o r g / "
D E S C R I P T I O N " l i g h t w e i g h t S Q L d a t a b a s e e n g i n e . "
2018-08-19 03:56:17 +00:00
P U R P O S E " E n a b l e s r e g t e s t "
)
if ( BUILD_SHARED_LIBS )
set_package_properties ( PythonInterp PROPERTIES
T Y P E R E Q U I R E D
2017-05-24 06:16:54 +00:00
U R L " w w w . p y t h o n . o r g / "
D E S C R I P T I O N " P y t h o n i s a w i d e l y u s e d h i g h - l e v e l p r o g r a m m i n g l a n g u a g e . "
2018-08-19 03:56:17 +00:00
P U R P O S E " R e q u i r e d t o b u i l d s h a r e d l i b r a r i e s "
)
2017-05-24 06:16:54 +00:00
endif ( )
2014-07-29 05:33:18 +00:00
2016-07-26 08:41:17 +00:00
feature_summary ( WHAT ALL )
2016-07-02 23:12:54 +00:00
2016-07-26 08:41:17 +00:00
#
# Setup configuration
#
2016-07-02 23:12:54 +00:00
2017-04-09 23:06:16 +00:00
configure_file ( src/config.h.cmake src/config.h )
2020-08-26 06:23:33 +00:00
configure_file ( include/sndfile.h.in include/sndfile.h )
2016-07-02 23:12:54 +00:00
2020-08-18 06:27:43 +00:00
if ( INSTALL_PKGCONFIG_MODULE )
set ( prefix ${ CMAKE_INSTALL_PREFIX } )
set ( exec_prefix "\$\{prefix\}" )
set ( libdir "\$\{prefix\}/${CMAKE_INSTALL_LIBDIR}" )
set ( includedir "\$\{prefix\}/${CMAKE_INSTALL_INCLUDEDIR}" )
set ( VERSION ${ PROJECT_VERSION } )
if ( ENABLE_EXTERNAL_LIBS )
set ( EXTERNAL_XIPH_REQUIRE "flac ogg vorbis vorbisenc opus" )
if ( ENABLE_EXPERIMENTAL )
set ( EXTERNAL_XIPH_REQUIRE "${EXTERNAL_XIPH_REQUIRE} speex" )
endif ( )
2020-03-07 09:25:23 +00:00
endif ( )
2021-04-20 09:22:00 +00:00
if ( ENABLE_MPEG )
set ( EXTERNAL_MPEG_REQUIRE "libmpg123" )
get_filename_component ( LAME_WE ${ LAME_LIBRARY } NAME_WE )
if ( LAME_HIP_LIBRARY )
get_filename_component ( LAME_HIP_WE ${ LAME_HIP_LIBRARY } NAME_WE )
endif ( )
if ( CMAKE_IMPORT_LIBRARY_PREFIX )
string ( REGEX REPLACE "^${CMAKE_IMPORT_LIBRARY_PREFIX}" "" LAME_WE_NO_PREFIX ${ LAME_WE } )
if ( LAME_HIP_LIBRARY )
string ( REGEX REPLACE "^${CMAKE_IMPORT_LIBRARY_PREFIX}" "" LAME_HIP_WE_NO_PREFIX ${ LAME_HIP_WE } )
endif ( )
endif ( )
set ( EXTERNAL_MPEG_LIBS "-l${LAME_WE_NO_PREFIX}" )
if ( LAME_HIP_LIBRARY )
set ( EXTERNAL_MPEG_LIBS "${MPEG_LIBS} -l${LAME_HIP_WE}" )
endif ( )
endif ( )
2020-08-18 06:27:43 +00:00
configure_file ( sndfile.pc.in sndfile.pc @ONLY )
2016-07-26 08:41:17 +00:00
endif ( )
2014-07-29 05:33:18 +00:00
2016-07-26 08:41:17 +00:00
#
# libsndfile
#
2014-07-12 08:00:51 +00:00
2016-07-26 08:41:17 +00:00
# Public libsndfile headers
2018-08-19 03:56:17 +00:00
set ( sndfile_HDRS
2020-08-26 06:23:33 +00:00
i n c l u d e / s n d f i l e . h h
$ { C M A K E _ C U R R E N T _ B I N A R Y _ D I R } / i n c l u d e / s n d f i l e . h
2018-08-19 03:56:17 +00:00
)
2014-07-12 08:35:41 +00:00
2018-08-19 03:56:17 +00:00
#
# libsndfile static library
#
add_library ( sndfile
2016-07-26 08:41:17 +00:00
s r c / s f c o n f i g . h
s r c / s f e n d i a n . h
s r c / s f _ u n i s t d . h
2018-08-19 03:56:17 +00:00
s r c / c o m m o n . h
2016-07-26 08:41:17 +00:00
s r c / c o m m o n . c
s r c / f i l e _ i o . c
s r c / c o m m a n d . c
s r c / p c m . c
s r c / u l a w . c
s r c / a l a w . c
s r c / f l o a t 3 2 . c
s r c / d o u b l e 6 4 . c
s r c / i m a _ a d p c m . c
s r c / m s _ a d p c m . c
s r c / g s m 6 1 0 . c
s r c / d w v w . c
s r c / v o x _ a d p c m . c
s r c / i n t e r l e a v e . c
s r c / s t r i n g s . c
s r c / d i t h e r . c
s r c / c a r t . c
s r c / b r o a d c a s t . c
s r c / a u d i o _ d e t e c t . c
s r c / i m a _ o k i _ a d p c m . c
s r c / i m a _ o k i _ a d p c m . h
s r c / a l a c . c
s r c / c h u n k . c
2018-08-19 03:56:17 +00:00
s r c / o g g . h
2016-07-26 08:41:17 +00:00
s r c / o g g . c
2018-08-19 03:56:17 +00:00
s r c / c h a n m a p . h
2016-07-26 08:41:17 +00:00
s r c / c h a n m a p . c
2019-02-10 06:45:55 +00:00
s r c / i d 3 . h
2018-08-19 03:56:17 +00:00
s r c / i d 3 . c
$ < $ < B O O L : $ { WIN32 } > : s r c / w i n d o w s . c >
2016-07-26 08:41:17 +00:00
s r c / s n d f i l e . c
2014-07-12 08:00:51 +00:00
s r c / a i f f . c
s r c / a u . c
s r c / a v r . c
2014-07-12 16:37:10 +00:00
s r c / c a f . c
2014-07-12 08:00:51 +00:00
s r c / d w d . c
s r c / f l a c . c
s r c / g 7 2 x . c
s r c / h t k . c
s r c / i r c a m . c
s r c / m a c o s . c
s r c / m a t 4 . c
s r c / m a t 5 . c
s r c / n i s t . c
s r c / p a f . c
s r c / p v f . c
s r c / r a w . c
s r c / r x 2 . c
s r c / s d 2 . c
s r c / s d s . c
s r c / s v x . c
s r c / t x w . c
s r c / v o c . c
2016-07-26 08:41:17 +00:00
s r c / w v e . c
2014-07-12 08:00:51 +00:00
s r c / w 6 4 . c
2018-08-19 03:56:17 +00:00
s r c / w a v l i k e . h
2016-02-07 03:57:31 +00:00
s r c / w a v l i k e . c
2016-07-26 08:41:17 +00:00
s r c / w a v . c
2014-07-12 08:00:51 +00:00
s r c / x i . c
2016-07-26 08:41:17 +00:00
s r c / m p c 2 k . c
s r c / r f 6 4 . c
s r c / o g g _ v o r b i s . c
s r c / o g g _ s p e e x . c
s r c / o g g _ p c m . c
2017-05-19 21:15:24 +00:00
s r c / o g g _ o p u s . c
2019-02-10 06:45:55 +00:00
s r c / o g g _ v c o m m e n t . h
Opus file support
Ogg: Introduce new functions ogg_sync_fseek(), ogg_ftell(), ogg_next_page(),
ogg_stream_next_page(), ogg_sync_last_page_before(), and
ogg_stream_unpack_page(). Use ogg_sync_* for ogg_read_first_page(). Bump libogg
version requirement from 1.1.3 to 1.3.0 as LibOgg 1.3.0 is required for
ogg_stream_pageout_fill() and ogg_stream_flush_fill().
Opus: Add opus support. Document added commands
SFC_(GET|SET)_ORIGINAL_SAMPLERATE. Added or extended tests ogg_opus_test,
compression_size_test, floating_point_test, lossy_comp_test, string_test,
external_libs_test. Change Opus to non-experimental.
2018-07-09 21:37:06 +00:00
s r c / o g g _ v c o m m e n t . c
2018-08-19 03:56:17 +00:00
s r c / n m s _ a d p c m . c
2021-01-12 05:51:16 +00:00
s r c / m p e g . c
2019-02-10 06:45:55 +00:00
s r c / m p e g _ d e c o d e . c
s r c / m p e g _ l 3 _ e n c o d e . c
2016-07-26 08:41:17 +00:00
s r c / G S M 6 1 0 / c o n f i g . h
s r c / G S M 6 1 0 / g s m . h
s r c / G S M 6 1 0 / g s m 6 1 0 _ p r i v . h
s r c / G S M 6 1 0 / a d d . c
s r c / G S M 6 1 0 / c o d e . c
s r c / G S M 6 1 0 / d e c o d e . c
s r c / G S M 6 1 0 / g s m _ c r e a t e . c
s r c / G S M 6 1 0 / g s m _ d e c o d e . c
s r c / G S M 6 1 0 / g s m _ d e s t r o y . c
s r c / G S M 6 1 0 / g s m _ e n c o d e . c
s r c / G S M 6 1 0 / g s m _ o p t i o n . c
s r c / G S M 6 1 0 / l o n g _ t e r m . c
s r c / G S M 6 1 0 / l p c . c
s r c / G S M 6 1 0 / p r e p r o c e s s . c
s r c / G S M 6 1 0 / r p e . c
s r c / G S M 6 1 0 / s h o r t _ t e r m . c
2018-08-19 03:56:17 +00:00
s r c / G S M 6 1 0 / t a b l e . c
2016-07-26 08:41:17 +00:00
s r c / G 7 2 x / g 7 2 x . h
s r c / G 7 2 x / g 7 2 x _ p r i v . h
s r c / G 7 2 x / g 7 2 1 . c
s r c / G 7 2 x / g 7 2 3 _ 1 6 . c
s r c / G 7 2 x / g 7 2 3 _ 2 4 . c
s r c / G 7 2 x / g 7 2 3 _ 4 0 . c
2018-08-19 03:56:17 +00:00
s r c / G 7 2 x / g 7 2 x . c
2016-07-26 08:41:17 +00:00
s r c / A L A C / A L A C A u d i o T y p e s . h
s r c / A L A C / A L A C B i t U t i l i t i e s . h
s r c / A L A C / E n d i a n P o r t a b l e . h
s r c / A L A C / a g l i b . h
s r c / A L A C / d p l i b . h
s r c / A L A C / m a t r i x l i b . h
s r c / A L A C / a l a c _ c o d e c . h
s r c / A L A C / s h i f t . h
s r c / A L A C / A L A C B i t U t i l i t i e s . c
s r c / A L A C / a g _ d e c . c
s r c / A L A C / a g _ e n c . c
s r c / A L A C / d p _ d e c . c
s r c / A L A C / d p _ e n c . c
s r c / A L A C / m a t r i x _ d e c . c
s r c / A L A C / m a t r i x _ e n c . c
s r c / A L A C / a l a c _ d e c o d e r . c
2018-08-19 03:56:17 +00:00
s r c / A L A C / a l a c _ e n c o d e r . c
$ { s n d f i l e _ H D R S }
$ { C M A K E _ C U R R E N T _ B I N A R Y _ D I R } / s r c / c o n f i g . h
)
2020-08-03 09:11:31 +00:00
add_library ( SndFile::sndfile ALIAS sndfile )
2020-08-26 06:23:33 +00:00
target_include_directories ( sndfile
2018-08-19 03:56:17 +00:00
P U B L I C
2020-08-26 06:23:33 +00:00
$ < B U I L D _ I N T E R F A C E : $ { C M A K E _ C U R R E N T _ S O U R C E _ D I R } / i n c l u d e >
$ < B U I L D _ I N T E R F A C E : $ { C M A K E _ C U R R E N T _ B I N A R Y _ D I R } / i n c l u d e >
2018-08-19 03:56:17 +00:00
$ < I N S T A L L _ I N T E R F A C E : $ { C M A K E _ I N S T A L L _ I N C L U D E D I R } >
2020-08-26 06:23:33 +00:00
P R I V A T E
s r c
$ < B U I L D _ I N T E R F A C E : $ { C M A K E _ C U R R E N T _ B I N A R Y _ D I R } / s r c >
2018-08-19 03:56:17 +00:00
)
target_link_libraries ( sndfile
P R I V A T E
$ < $ < B O O L : $ { L I B M _ R E Q U I R E D } > : m >
2020-04-11 06:42:21 +00:00
$ < $ < B O O L : $ { H A V E _ E X T E R N A L _ X I P H _ L I B S } > : V o r b i s : : v o r b i s e n c >
2018-08-19 03:56:17 +00:00
$ < $ < B O O L : $ { H A V E _ E X T E R N A L _ X I P H _ L I B S } > : F L A C : : F L A C >
$ < $ < A N D : $ < B O O L : $ { E N A B L E _ E X P E R I M E N T A L } > , $ < B O O L : $ { H A V E _ E X T E R N A L _ X I P H _ L I B S } > , $ < B O O L : $ { H A V E _ S P E E X } > > : S p e e x : : S p e e x >
2020-03-08 05:28:46 +00:00
$ < $ < B O O L : $ { H A V E _ E X T E R N A L _ X I P H _ L I B S } > : O p u s : : o p u s >
2021-03-26 07:32:45 +00:00
$ < $ < B O O L : $ { H A V E _ M P E G } > : M P G 1 2 3 : : l i b m p g 1 2 3 >
$ < $ < B O O L : $ { H A V E _ M P E G } > : L a m e : : L a m e >
2018-08-19 03:56:17 +00:00
)
set_target_properties ( sndfile PROPERTIES
2018-08-20 05:47:26 +00:00
P U B L I C _ H E A D E R " $ { s n d f i l e _ H D R S } "
2018-08-19 03:56:17 +00:00
)
2016-07-26 08:41:17 +00:00
2018-08-20 03:03:50 +00:00
if ( ENABLE_COMPATIBLE_LIBSNDFILE_NAME )
2020-08-28 04:42:44 +00:00
if ( MINGW OR CYGWIN )
set_target_properties ( sndfile PROPERTIES
R U N T I M E _ O U T P U T _ N A M E " s n d f i l e - 1 "
)
else ( )
set_target_properties ( sndfile PROPERTIES
R U N T I M E _ O U T P U T _ N A M E " l i b s n d f i l e - 1 "
)
endif ( )
2018-08-20 03:03:50 +00:00
endif ( )
2016-07-26 08:41:17 +00:00
if ( BUILD_SHARED_LIBS )
2021-05-25 07:41:25 +00:00
#
# ABI version of library.
#
#
# Read libtool version from `configure.ac` and set libsndfile ABI version:
#
# SNDFILE_ABI_VERSION_MAJOR
# SNDFILE_ABI_VERSION_MINOR
# SNDFILE_ABI_VERSION_PATCH
# SNDFILE_ABI_VERSION
#
# and Mach-O current and compatibility versions:
#
# SNDFILE_MACHO_CURRENT_VERSION
# SNDFILE_MACHO_COMPATIBILITY_VERSION
#
include ( SetupABIVersions )
setup_abi_versions ( )
2016-07-26 08:41:17 +00:00
if ( WIN32 )
2017-04-26 07:20:44 +00:00
set ( VERSION_MAJOR ${ CPACK_PACKAGE_VERSION_MAJOR } )
set ( GEN_TOOL cmake )
2017-04-29 04:25:08 +00:00
set ( WIN_RC_VERSION "${CPACK_PACKAGE_VERSION_MAJOR},${CPACK_PACKAGE_VERSION_MINOR},${CPACK_PACKAGE_VERSION_PATCH}" )
set ( CLEAN_VERSION "${CPACK_PACKAGE_VERSION_MAJOR}.${CPACK_PACKAGE_VERSION_MINOR}.${CPACK_PACKAGE_VERSION_PATCH}" )
set ( PACKAGE_VERSION ${ CPACK_PACKAGE_VERSION } )
2017-04-26 07:20:44 +00:00
2018-08-19 03:56:17 +00:00
configure_file ( src/version-metadata.rc.in src/version-metadata.rc @ONLY )
2020-11-10 05:52:30 +00:00
target_sources ( sndfile PRIVATE ${ PROJECT_BINARY_DIR } /src/version-metadata.rc )
2018-08-19 03:56:17 +00:00
endif ( )
2016-07-26 08:41:17 +00:00
2021-05-16 09:51:13 +00:00
2018-08-19 03:56:17 +00:00
set_target_properties ( sndfile PROPERTIES
2021-04-04 14:16:38 +00:00
S O V E R S I O N $ { S N D F I L E _ A B I _ V E R S I O N _ M A J O R }
V E R S I O N $ { S N D F I L E _ A B I _ V E R S I O N }
2018-08-19 03:56:17 +00:00
)
2016-07-26 08:41:17 +00:00
2021-05-16 09:51:13 +00:00
if ( APPLE )
if ( NOT ( CMAKE_VERSION VERSION_LESS 3.17 ) )
set_target_properties ( sndfile PROPERTIES
M A C H O _ C U R R E N T _ V E R S I O N $ { S N D F I L E _ M A C H O _ C U R R E N T _ V E R S I O N }
M A C H O _ C O M P A T I B I L I T Y _ V E R S I O N $ { S N D F I L E _ M A C H O _ C O M P A T I B I L I T Y _ V E R S I O N }
)
else ( )
message ( FATAL_ERROR "Apple platform requires cmake >= 3.17 to build dylib." )
endif ( )
endif ( )
2017-05-24 06:16:54 +00:00
# Symbol files generation
if ( WIN32 )
2018-08-19 03:56:17 +00:00
set ( SYMBOL_FILENAME "sndfile.def" )
set ( SYMBOL_OS "win32" )
elseif ( ( CMAKE_SYSTEM_NAME MATCHES "Darwin" ) OR ( CMAKE_SYSTEM_NAME MATCHES "Rhapsody" ) )
set ( SYMBOL_FILENAME "Symbols.darwin" )
set ( SYMBOL_OS "darwin" )
elseif ( CMAKE_SYSTEM_NAME MATCHES "OS2" )
set ( SYMBOL_FILENAME "Symbols.os2" )
set ( SYMBOL_OS "os2" )
elseif ( UNIX )
set ( SYMBOL_FILENAME "Symbols.gnu-binutils" )
set ( SYMBOL_OS "linux" )
endif ( )
2017-05-24 06:16:54 +00:00
if ( DEFINED SYMBOL_OS )
2018-08-19 03:56:17 +00:00
add_custom_command (
2017-05-24 06:16:54 +00:00
O U T P U T $ { C M A K E _ C U R R E N T _ B I N A R Y _ D I R } / s r c / $ { S Y M B O L _ F I L E N A M E }
2021-04-04 14:16:38 +00:00
C O M M A N D $ { P Y T H O N _ E X E C U T A B L E } $ { C M A K E _ C U R R E N T _ S O U R C E _ D I R } / s r c / c r e a t e _ s y m b o l s _ f i l e . p y $ { S Y M B O L _ O S } $ { S N D F I L E _ A B I _ V E R S I O N } > $ { C M A K E _ C U R R E N T _ B I N A R Y _ D I R } / s r c / $ { S Y M B O L _ F I L E N A M E }
2018-08-19 03:56:17 +00:00
C O M M E N T " G e n e r a t i n g $ { S Y M B O L _ F I L E N A M E } . . . "
)
2017-05-24 06:16:54 +00:00
2018-08-19 03:56:17 +00:00
add_custom_target ( GENFILES DEPENDS ${ CMAKE_CURRENT_BINARY_DIR } /src/ ${ SYMBOL_FILENAME } )
2017-05-24 06:16:54 +00:00
if ( SYMBOL_OS MATCHES "win32" )
2018-08-19 03:56:17 +00:00
target_sources ( sndfile
P R I V A T E
$ { C M A K E _ C U R R E N T _ B I N A R Y _ D I R } / s r c / $ { S Y M B O L _ F I L E N A M E }
)
elseif ( SYMBOL_OS MATCHES "darwin" )
add_dependencies ( sndfile GENFILES )
2020-08-28 09:58:27 +00:00
if ( CMAKE_VERSION VERSION_LESS 3.13 )
set_property ( TARGET sndfile APPEND_STRING PROPERTY
L I N K _ F L A G S " - W l , - e x p o r t e d _ s y m b o l s _ l i s t - W l , $ { C M A K E _ C U R R E N T _ B I N A R Y _ D I R } / s r c / $ { S Y M B O L _ F I L E N A M E } "
)
else ( )
target_link_options ( sndfile PRIVATE "LINKER:-exported_symbols_list,${CMAKE_CURRENT_BINARY_DIR}/src/${SYMBOL_FILENAME}" )
endif ( )
2018-08-19 03:56:17 +00:00
elseif ( SYMBOL_OS MATCHES "os" )
add_dependencies ( sndfile GENFILES )
2020-08-28 09:58:27 +00:00
if ( CMAKE_VERSION VERSION_LESS 3.13 )
set_property ( TARGET sndfile APPEND_STRING PROPERTY
L I N K _ F L A G S " - W l , - e x p o r t - s y m b o l s $ { C M A K E _ C U R R E N T _ B I N A R Y _ D I R } / s r c / $ { S Y M B O L _ F I L E N A M E } "
)
else ( )
target_link_options ( sndfile PRIVATE "LINKER:-export-symbols ${CMAKE_CURRENT_BINARY_DIR}/src/${SYMBOL_FILENAME}" )
endif ( )
2018-08-19 03:56:17 +00:00
elseif ( UNIX )
add_dependencies ( sndfile GENFILES )
2020-08-28 09:58:27 +00:00
if ( CMAKE_VERSION VERSION_LESS 3.13 )
set_property ( TARGET sndfile APPEND_STRING PROPERTY
L I N K _ F L A G S " - W l , - - v e r s i o n - s c r i p t , $ { C M A K E _ C U R R E N T _ B I N A R Y _ D I R } / s r c / $ { S Y M B O L _ F I L E N A M E } "
)
else ( )
target_link_options ( sndfile PRIVATE "LINKER:--version-script,${CMAKE_CURRENT_BINARY_DIR}/src/${SYMBOL_FILENAME}" )
endif ( )
2017-05-24 06:16:54 +00:00
endif ( )
endif ( )
2018-08-19 03:56:17 +00:00
endif ( )
2016-07-26 08:41:17 +00:00
#
# Programs
#
2017-04-09 12:31:46 +00:00
if ( BUILD_PROGRAMS )
2016-07-26 08:41:17 +00:00
# sndfile-info
2018-08-19 03:56:17 +00:00
add_executable ( sndfile-info
2017-04-09 12:31:46 +00:00
p r o g r a m s / s n d f i l e - i n f o . c
p r o g r a m s / c o m m o n . c
2018-08-19 03:56:17 +00:00
p r o g r a m s / c o m m o n . h
)
target_link_libraries ( sndfile-info
P R I V A T E
s n d f i l e
$ < $ < B O O L : $ { L I B M _ R E Q U I R E D } > : m >
)
2016-07-26 08:41:17 +00:00
# sndfile-play
2018-08-19 03:56:17 +00:00
add_executable ( sndfile-play
$ < $ < N O T : $ < B O O L : $ { B E O S } > > : p r o g r a m s / s n d f i l e - p l a y . c >
$ < $ < N O T : $ < B O O L : $ { B E O S } > > : p r o g r a m s / c o m m o n . c >
$ < $ < N O T : $ < B O O L : $ { B E O S } > > : p r o g r a m s / s n d f i l e - p l a y . c >
$ < $ < B O O L : $ { B E O S } > : p r o g r a m s / s n d f i l e - p l a y - b e o s . c p p >
)
2020-08-26 06:23:33 +00:00
target_include_directories ( sndfile-play
P R I V A T E
s r c
$ { C M A K E _ C U R R E N T _ B I N A R Y _ D I R } / s r c
)
2019-10-12 13:42:33 +00:00
target_link_libraries ( sndfile-play PRIVATE $< $<BOOL:${LIBM_REQUIRED} > :m> )
2018-08-19 03:56:17 +00:00
target_link_libraries ( sndfile-play PRIVATE sndfile )
2017-04-09 12:31:46 +00:00
if ( WIN32 )
2018-03-17 09:09:52 +00:00
target_link_libraries ( sndfile-play PRIVATE winmm )
2017-04-09 12:31:46 +00:00
# Maybe ALSA & Sndio are present in BeOS. They are not required
# so skip them anyway.
elseif ( ( NOT BEOS ) AND ALSA_FOUND )
target_include_directories ( sndfile-play PRIVATE ${ ALSA_INCLUDE_DIRS } )
2018-08-19 03:56:17 +00:00
target_link_libraries ( sndfile-play PRIVATE ${ ALSA_LIBRARIES } )
2020-12-11 07:16:28 +00:00
elseif ( CMAKE_SYSTEM_NAME STREQUAL "OpenBSD" )
2018-08-19 03:56:17 +00:00
target_link_libraries ( sndfile-play PRIVATE Sndio::Sndio )
2017-04-09 12:31:46 +00:00
endif ( )
2016-07-26 08:41:17 +00:00
# sndfile-convert
2018-08-19 03:56:17 +00:00
add_executable ( sndfile-convert
2017-04-09 12:31:46 +00:00
p r o g r a m s / s n d f i l e - c o n v e r t . c
p r o g r a m s / c o m m o n . c
2018-08-19 03:56:17 +00:00
p r o g r a m s / c o m m o n . h
)
2019-10-12 13:42:33 +00:00
target_link_libraries ( sndfile-convert PRIVATE sndfile $< $<BOOL:${LIBM_REQUIRED} > :m> )
2016-07-26 08:41:17 +00:00
# sndfile-cmp
2018-08-19 03:56:17 +00:00
add_executable ( sndfile-cmp
2017-04-09 12:31:46 +00:00
p r o g r a m s / s n d f i l e - c m p . c
p r o g r a m s / c o m m o n . c
2018-08-19 03:56:17 +00:00
p r o g r a m s / c o m m o n . h
)
2020-08-26 06:23:33 +00:00
target_include_directories ( sndfile-cmp
P U B L I C
s r c
$ { C M A K E _ C U R R E N T _ B I N A R Y _ D I R } / s r c
$ { C M A K E _ C U R R E N T _ B I N A R Y _ D I R } / t e s t s
)
2019-10-12 13:42:33 +00:00
target_link_libraries ( sndfile-cmp PRIVATE sndfile $< $<BOOL:${LIBM_REQUIRED} > :m> )
2016-07-26 08:41:17 +00:00
# sndfile-metadata-set
2018-08-19 03:56:17 +00:00
add_executable ( sndfile-metadata-set
2017-04-09 12:31:46 +00:00
p r o g r a m s / s n d f i l e - m e t a d a t a - s e t . c
p r o g r a m s / c o m m o n . c
2018-08-19 03:56:17 +00:00
p r o g r a m s / c o m m o n . h
)
2020-08-26 06:23:33 +00:00
target_include_directories ( sndfile-metadata-set
P U B L I C
s r c
$ { C M A K E _ C U R R E N T _ B I N A R Y _ D I R } / s r c
$ { C M A K E _ C U R R E N T _ B I N A R Y _ D I R } / t e s t s
)
2019-10-12 13:42:33 +00:00
target_link_libraries ( sndfile-metadata-set PRIVATE sndfile $< $<BOOL:${LIBM_REQUIRED} > :m> )
2016-07-26 08:41:17 +00:00
# sndfile-metadata-get
2018-08-19 03:56:17 +00:00
add_executable ( sndfile-metadata-get
2017-04-09 12:31:46 +00:00
p r o g r a m s / s n d f i l e - m e t a d a t a - g e t . c
p r o g r a m s / c o m m o n . c
2018-08-19 03:56:17 +00:00
p r o g r a m s / c o m m o n . h
)
2020-08-26 06:23:33 +00:00
target_include_directories ( sndfile-metadata-get
P U B L I C
s r c
$ { C M A K E _ C U R R E N T _ B I N A R Y _ D I R } / s r c
$ { C M A K E _ C U R R E N T _ B I N A R Y _ D I R } / t e s t s
)
2019-10-12 13:42:33 +00:00
target_link_libraries ( sndfile-metadata-get PRIVATE sndfile $< $<BOOL:${LIBM_REQUIRED} > :m> )
2016-07-26 08:41:17 +00:00
# sndfile-interleave
2018-08-19 03:56:17 +00:00
add_executable ( sndfile-interleave
2017-04-09 12:31:46 +00:00
p r o g r a m s / s n d f i l e - i n t e r l e a v e . c
p r o g r a m s / c o m m o n . c
2018-08-19 03:56:17 +00:00
p r o g r a m s / c o m m o n . h
)
2019-10-12 13:42:33 +00:00
target_link_libraries ( sndfile-interleave PRIVATE sndfile $< $<BOOL:${LIBM_REQUIRED} > :m> )
2016-07-26 08:41:17 +00:00
# sndfile-deinterleave
2018-08-19 03:56:17 +00:00
add_executable ( sndfile-deinterleave
2017-04-09 12:31:46 +00:00
p r o g r a m s / s n d f i l e - d e i n t e r l e a v e . c
p r o g r a m s / c o m m o n . c
2018-08-19 03:56:17 +00:00
p r o g r a m s / c o m m o n . h
)
2019-10-12 13:42:33 +00:00
target_link_libraries ( sndfile-deinterleave PRIVATE sndfile $< $<BOOL:${LIBM_REQUIRED} > :m> )
2016-07-26 08:41:17 +00:00
# sndfile-concat
2018-08-19 03:56:17 +00:00
add_executable ( sndfile-concat
2017-04-09 12:31:46 +00:00
p r o g r a m s / s n d f i l e - c o n c a t . c
p r o g r a m s / c o m m o n . c
2018-08-19 03:56:17 +00:00
p r o g r a m s / c o m m o n . h
)
2019-10-12 13:42:33 +00:00
target_link_libraries ( sndfile-concat PRIVATE sndfile $< $<BOOL:${LIBM_REQUIRED} > :m> )
2016-07-26 08:41:17 +00:00
# sndfile-salvage
2018-08-19 03:56:17 +00:00
add_executable ( sndfile-salvage
2017-04-09 12:31:46 +00:00
p r o g r a m s / s n d f i l e - s a l v a g e . c
p r o g r a m s / c o m m o n . c
2018-08-19 03:56:17 +00:00
p r o g r a m s / c o m m o n . h
)
2020-08-26 06:23:33 +00:00
target_include_directories ( sndfile-salvage
P U B L I C
s r c
$ { C M A K E _ C U R R E N T _ B I N A R Y _ D I R } / s r c
$ { C M A K E _ C U R R E N T _ B I N A R Y _ D I R } / t e s t s
)
2019-10-12 13:42:33 +00:00
target_link_libraries ( sndfile-salvage PRIVATE sndfile $< $<BOOL:${LIBM_REQUIRED} > :m> )
2017-04-09 12:31:46 +00:00
2017-04-13 06:11:02 +00:00
set ( SNDFILE_PROGRAM_TARGETS
2017-04-09 12:31:46 +00:00
s n d f i l e - i n f o
s n d f i l e - p l a y
s n d f i l e - c o n v e r t
s n d f i l e - c m p
s n d f i l e - m e t a d a t a - s e t
s n d f i l e - m e t a d a t a - g e t
s n d f i l e - i n t e r l e a v e
s n d f i l e - d e i n t e r l e a v e
s n d f i l e - c o n c a t
2018-08-19 03:56:17 +00:00
s n d f i l e - s a l v a g e
)
2017-04-09 12:31:46 +00:00
2017-04-13 06:11:02 +00:00
set_target_properties ( ${ SNDFILE_PROGRAM_TARGETS } PROPERTIES FOLDER Programs )
2018-08-19 03:56:17 +00:00
endif ( )
2016-07-26 08:41:17 +00:00
2017-04-13 06:11:02 +00:00
#
# Examples
#
if ( BUILD_EXAMPLES )
# sndfile-to-text
2018-08-19 03:56:17 +00:00
add_executable ( sndfile-to-text examples/sndfile-to-text.c )
target_link_libraries ( sndfile-to-text PRIVATE sndfile )
2017-04-13 06:11:02 +00:00
# sndfile-loopify
2018-08-19 03:56:17 +00:00
add_executable ( sndfile-loopify examples/sndfile-loopify.c )
target_link_libraries ( sndfile-loopify PRIVATE sndfile )
2017-04-13 06:11:02 +00:00
# make_sine
2018-08-19 03:56:17 +00:00
add_executable ( make_sine examples/make_sine.c )
target_link_libraries ( make_sine
P R I V A T E
s n d f i l e
$ < $ < B O O L : $ { L I B M _ R E Q U I R E D } > : m >
)
2017-04-13 06:11:02 +00:00
# sfprocess
2018-08-19 03:56:17 +00:00
add_executable ( sfprocess examples/sfprocess.c )
target_link_libraries ( sfprocess
P R I V A T E
s n d f i l e
$ < $ < B O O L : $ { L I B M _ R E Q U I R E D } > : m >
)
2017-04-13 06:11:02 +00:00
# list_formats
2018-08-19 03:56:17 +00:00
add_executable ( list_formats examples/list_formats.c )
target_link_libraries ( list_formats
P R I V A T E
s n d f i l e
$ < $ < B O O L : $ { L I B M _ R E Q U I R E D } > : m >
)
2017-04-13 06:11:02 +00:00
2021-01-31 21:19:59 +00:00
# generate
add_executable ( generate examples/generate.c )
target_link_libraries ( generate PRIVATE sndfile )
2017-04-13 06:11:02 +00:00
# sndfilehandle
2018-08-19 03:56:17 +00:00
add_executable ( sndfilehandle examples/sndfilehandle.cc )
target_link_libraries ( sndfilehandle PUBLIC sndfile )
2017-04-13 06:11:02 +00:00
set ( SNDFILE_EXAMPLE_TARGETS
s n d f i l e - t o - t e x t
s n d f i l e - l o o p i f y
m a k e _ s i n e
s f p r o c e s s
l i s t _ f o r m a t s
2021-01-31 21:19:59 +00:00
g e n e r a t e
2018-08-19 03:56:17 +00:00
s n d f i l e h a n d l e
)
2017-04-13 06:11:02 +00:00
set_target_properties ( ${ SNDFILE_EXAMPLE_TARGETS } PROPERTIES FOLDER Examples )
2018-08-19 03:56:17 +00:00
endif ( )
2017-04-13 06:11:02 +00:00
#
# sndfile-regtest
#
if ( BUILD_REGTEST )
2018-08-19 03:56:17 +00:00
add_executable ( sndfile-regtest
2017-04-13 06:11:02 +00:00
r e g t e s t / s n d f i l e - r e g t e s t . c
r e g t e s t / d a t a b a s e . c
2018-08-19 03:56:17 +00:00
r e g t e s t / c h e c k s u m . c
)
2020-08-26 06:23:33 +00:00
target_include_directories ( sndfile-regtest
P U B L I C
s r c
$ { C M A K E _ C U R R E N T _ B I N A R Y _ D I R } / s r c
$ { C M A K E _ C U R R E N T _ B I N A R Y _ D I R } / t e s t s
)
2018-08-19 03:56:17 +00:00
target_link_libraries ( sndfile-regtest
P R I V A T E
s n d f i l e
2020-10-27 09:23:51 +00:00
S Q L i t e : : S Q L i t e 3
2018-08-19 03:56:17 +00:00
$ < $ < B O O L : $ { L I B M _ R E Q U I R E D } > : m >
)
2017-04-13 06:11:02 +00:00
2018-08-19 03:56:17 +00:00
endif ( )
2017-04-13 06:11:02 +00:00
2016-07-26 08:41:17 +00:00
#
# Installation
#
2017-04-13 06:11:02 +00:00
if ( ENABLE_PACKAGE_CONFIG )
2020-03-08 05:28:46 +00:00
if ( WIN32 AND ( NOT MINGW ) AND ( NOT CYGWIN ) )
set ( CMAKE_INSTALL_PACKAGEDIR cmake )
else ( )
set ( CMAKE_INSTALL_PACKAGEDIR ${ CMAKE_INSTALL_LIBDIR } /cmake/SndFile )
2017-04-13 06:11:02 +00:00
endif ( )
2020-08-03 09:11:31 +00:00
install ( TARGETS ${ SNDFILE_PROGRAM_TARGETS }
R U N T I M E D E S T I N A T I O N $ { C M A K E _ I N S T A L L _ B I N D I R }
)
2017-04-13 06:11:02 +00:00
2020-08-03 09:11:31 +00:00
install ( TARGETS sndfile
2020-03-08 05:28:46 +00:00
E X P O R T S n d F i l e T a r g e t s
2018-08-19 03:56:17 +00:00
R U N T I M E D E S T I N A T I O N $ { C M A K E _ I N S T A L L _ B I N D I R }
A R C H I V E D E S T I N A T I O N $ { C M A K E _ I N S T A L L _ L I B D I R }
L I B R A R Y D E S T I N A T I O N $ { C M A K E _ I N S T A L L _ L I B D I R }
P U B L I C _ H E A D E R D E S T I N A T I O N $ { C M A K E _ I N S T A L L _ I N C L U D E D I R }
)
2017-04-13 06:11:02 +00:00
include ( CMakePackageConfigHelpers )
2020-03-08 05:28:46 +00:00
if ( ENABLE_EXTERNAL_LIBS )
set ( SndFile_WITH_EXTERNAL_LIBS 1 )
else ( )
set ( SndFile_WITH_EXTERNAL_LIBS 0 )
endif ( )
set ( INCLUDE_INSTALL_DIR ${ CMAKE_INSTALL_INCLUDEDIR } )
configure_package_config_file ( cmake/SndFileConfig.cmake.in SndFileConfig.cmake
I N S T A L L _ D E S T I N A T I O N $ { C M A K E _ I N S T A L L _ P A C K A G E D I R }
P A T H _ V A R S I N C L U D E _ I N S T A L L _ D I R
)
2018-08-19 03:56:17 +00:00
write_basic_package_version_file ( SndFileConfigVersion.cmake COMPATIBILITY SameMajorVersion )
2017-04-13 06:11:02 +00:00
2020-03-08 05:28:46 +00:00
install ( EXPORT SndFileTargets
2018-08-19 03:56:17 +00:00
N A M E S P A C E S n d F i l e : :
D E S T I N A T I O N $ { C M A K E _ I N S T A L L _ P A C K A G E D I R }
)
install (
2020-03-08 05:28:46 +00:00
F I L E S
$ { C M A K E _ C U R R E N T _ B I N A R Y _ D I R } / S n d F i l e C o n f i g . c m a k e
$ { C M A K E _ C U R R E N T _ B I N A R Y _ D I R } / S n d F i l e C o n f i g V e r s i o n . c m a k e
2018-08-19 03:56:17 +00:00
D E S T I N A T I O N $ { C M A K E _ I N S T A L L _ P A C K A G E D I R }
)
2017-04-13 06:11:02 +00:00
2018-08-19 03:56:17 +00:00
else ( )
2017-04-13 06:11:02 +00:00
2018-08-19 03:56:17 +00:00
install ( TARGETS sndfile ${ sdnfile_PROGRAMS }
R U N T I M E D E S T I N A T I O N $ { C M A K E _ I N S T A L L _ B I N D I R }
A R C H I V E D E S T I N A T I O N $ { C M A K E _ I N S T A L L _ L I B D I R }
L I B R A R Y D E S T I N A T I O N $ { C M A K E _ I N S T A L L _ L I B D I R }
P U B L I C _ H E A D E R D E S T I N A T I O N $ { C M A K E _ I N S T A L L _ I N C L U D E D I R } )
2016-07-26 08:41:17 +00:00
2018-08-19 03:56:17 +00:00
endif ( )
2017-04-13 06:11:02 +00:00
2020-08-28 04:54:31 +00:00
if ( INSTALL_MANPAGES )
2020-08-28 13:38:06 +00:00
2016-07-26 08:41:17 +00:00
set ( man_MANS
m a n / s n d f i l e - i n f o . 1
m a n / s n d f i l e - p l a y . 1
m a n / s n d f i l e - c o n v e r t . 1
m a n / s n d f i l e - c m p . 1
m a n / s n d f i l e - m e t a d a t a - g e t . 1
m a n / s n d f i l e - c o n c a t . 1
m a n / s n d f i l e - i n t e r l e a v e . 1
2018-08-19 03:56:17 +00:00
m a n / s n d f i l e - s a l v a g e . 1
)
2019-03-27 20:27:33 +00:00
install ( FILES ${ man_MANS } DESTINATION ${ CMAKE_INSTALL_MANDIR } /man1 )
2020-08-28 13:38:06 +00:00
install ( FILES man/sndfile-metadata-get.1 DESTINATION ${ CMAKE_INSTALL_MANDIR } /man1 RENAME sndfile-metadata-set.1 )
install ( FILES man/sndfile-interleave.1 DESTINATION ${ CMAKE_INSTALL_MANDIR } /man1 RENAME sndfile-deinterleave.1 )
2016-07-26 08:41:17 +00:00
endif ( )
2017-04-13 06:11:02 +00:00
if ( ENABLE_BOW_DOCS )
set ( HTML_BGCOLOUR "white" )
set ( HTML_FGCOLOUR "black" )
2018-08-19 03:56:17 +00:00
else ( )
2017-04-13 06:11:02 +00:00
set ( HTML_BGCOLOUR "black" )
set ( HTML_FGCOLOUR "white" )
endif ( )
2020-10-18 07:14:45 +00:00
set ( dist_doc_DATA
d o c s / i n d e x . m d
d o c s / l i b s n d f i l e . j p g
d o c s / l i b s n d f i l e . c s s
d o c s / p r i n t . c s s
d o c s / a p i . m d
d o c s / c o m m a n d . m d
d o c s / b u g s . m d
d o c s / f o r m a t s . m d
d o c s / s n d f i l e _ i n f o . m d
d o c s / n e w _ f i l e _ t y p e _ h o w t o . m d
d o c s / w i n 3 2 . m d
d o c s / F A Q . m d
d o c s / l i s t s . m d
d o c s / e m b e d d e d _ f i l e s . m d
d o c s / o c t a v e . m d
d o c s / t u t o r i a l . m d
2018-08-19 03:56:17 +00:00
)
2020-10-18 07:14:45 +00:00
install ( FILES ${ dist_doc_DATA } DESTINATION ${ CMAKE_INSTALL_DOCDIR } )
2016-07-26 08:41:17 +00:00
2020-08-18 06:27:43 +00:00
if ( INSTALL_PKGCONFIG_MODULE )
install ( FILES ${ CMAKE_CURRENT_BINARY_DIR } /sndfile.pc DESTINATION ${ CMAKE_INSTALL_LIBDIR } /pkgconfig )
endif ( )
2016-07-26 08:41:17 +00:00
#
# Testing
#
if ( BUILD_TESTING )
2018-08-19 03:56:17 +00:00
2017-04-13 06:11:02 +00:00
enable_testing ( )
2017-04-10 13:46:31 +00:00
2018-08-25 20:03:09 +00:00
include ( CMakeAutoGen )
2018-08-19 03:56:17 +00:00
2017-04-10 13:46:31 +00:00
# generate tests sources from autogen templates
2018-08-19 03:56:17 +00:00
lsf_autogen ( tests benchmark c )
lsf_autogen ( tests floating_point_test c )
lsf_autogen ( tests header_test c )
lsf_autogen ( tests pcm_test c )
lsf_autogen ( tests pipe_test c )
lsf_autogen ( tests rdwr_test c )
lsf_autogen ( tests scale_clip_test c )
lsf_autogen ( tests utils c h )
lsf_autogen ( tests write_read_test c )
lsf_autogen ( src test_endswap c )
2017-04-10 13:46:31 +00:00
# utils static library
add_library ( test_utils STATIC tests/utils.c )
2020-08-26 06:23:33 +00:00
target_include_directories ( test_utils
P U B L I C
s r c
$ { C M A K E _ C U R R E N T _ B I N A R Y _ D I R } / s r c
$ { C M A K E _ C U R R E N T _ B I N A R Y _ D I R } / t e s t s
)
2018-08-19 03:56:17 +00:00
target_link_libraries ( test_utils PRIVATE sndfile )
2016-07-26 08:41:17 +00:00
### test_main
2018-08-19 03:56:17 +00:00
add_executable ( test_main
2016-07-26 08:41:17 +00:00
s r c / t e s t _ m a i n . c
s r c / t e s t _ m a i n . h
s r c / t e s t _ c o n v e r s i o n s . c
s r c / t e s t _ f l o a t . c
s r c / t e s t _ e n d s w a p . c
s r c / t e s t _ a u d i o _ d e t e c t . c
s r c / t e s t _ l o g _ p r i n t f . c
s r c / t e s t _ f i l e _ i o . c
s r c / t e s t _ i m a _ o k i _ a d p c m . c
s r c / t e s t _ s t r n c p y _ c r l f . c
s r c / t e s t _ b r o a d c a s t _ v a r . c
s r c / t e s t _ c a r t _ v a r . c
2017-05-19 21:15:24 +00:00
s r c / t e s t _ b i n h e a d e r _ w r i t e f . c
2018-08-19 03:56:17 +00:00
s r c / t e s t _ n m s _ a d p c m . c
)
2020-08-26 06:23:33 +00:00
target_include_directories ( test_main
P U B L I C
s r c
$ { C M A K E _ C U R R E N T _ B I N A R Y _ D I R } / s r c
$ { C M A K E _ C U R R E N T _ B I N A R Y _ D I R } / t e s t s
)
2018-08-19 03:56:17 +00:00
target_link_libraries ( test_main PRIVATE sndfile )
2017-04-13 06:11:02 +00:00
if ( MSVC )
target_compile_definitions ( test_main PRIVATE _USE_MATH_DEFINES )
2018-08-19 03:56:17 +00:00
endif ( )
2016-07-26 08:41:17 +00:00
add_test ( test_main test_main )
### sfversion_test
2018-08-19 03:56:17 +00:00
add_executable ( sfversion tests/sfversion.c )
2020-08-26 06:23:33 +00:00
target_include_directories ( sfversion
P R I V A T E
s r c
$ { C M A K E _ C U R R E N T _ B I N A R Y _ D I R } / s r c
)
2018-08-19 03:56:17 +00:00
target_link_libraries ( sfversion sndfile )
2016-07-26 08:41:17 +00:00
add_test ( sfversion sfversion )
set_tests_properties ( sfversion PROPERTIES
2018-08-19 03:56:17 +00:00
P A S S _ R E G U L A R _ E X P R E S S I O N " $ { P A C K A G E _ N A M E } - $ { C P A C K _ P A C K A G E _ V E R S I O N _ F U L L } "
)
2016-07-26 08:41:17 +00:00
### error_test
2018-08-19 03:56:17 +00:00
add_executable ( error_test tests/error_test.c )
target_link_libraries ( error_test
P R I V A T E
s n d f i l e
t e s t _ u t i l s
$ < $ < B O O L : $ { L I B M _ R E Q U I R E D } > : m >
)
2016-07-26 08:41:17 +00:00
add_test ( error_test error_test )
### ulaw_test
2018-08-19 03:56:17 +00:00
add_executable ( ulaw_test tests/ulaw_test.c )
target_link_libraries ( ulaw_test
P R I V A T E
s n d f i l e
t e s t _ u t i l s
$ < $ < B O O L : $ { L I B M _ R E Q U I R E D } > : m >
)
2016-07-26 08:41:17 +00:00
add_test ( ulaw_test ulaw_test )
### alaw_test
2018-08-19 03:56:17 +00:00
add_executable ( alaw_test tests/alaw_test.c )
target_link_libraries ( alaw_test
P R I V A T E
s n d f i l e
t e s t _ u t i l s
$ < $ < B O O L : $ { L I B M _ R E Q U I R E D } > : m >
)
2016-07-26 08:41:17 +00:00
add_test ( alaw_test alaw_test )
### dwvw_test
2018-08-19 03:56:17 +00:00
add_executable ( dwvw_test tests/dwvw_test.c )
target_link_libraries ( dwvw_test
P R I V A T E
s n d f i l e
t e s t _ u t i l s
$ < $ < B O O L : $ { L I B M _ R E Q U I R E D } > : m >
)
2016-07-26 08:41:17 +00:00
add_test ( dwvw_test dwvw_test )
### command_test
2018-08-19 03:56:17 +00:00
add_executable ( command_test tests/command_test.c )
target_link_libraries ( command_test
P R I V A T E
s n d f i l e
t e s t _ u t i l s
$ < $ < B O O L : $ { L I B M _ R E Q U I R E D } > : m >
)
2016-07-26 08:41:17 +00:00
add_test ( command_test command_test all )
### floating_point_test
2018-08-19 03:56:17 +00:00
add_executable ( floating_point_test
t e s t s / d f t _ c m p . c
t e s t s / f l o a t i n g _ p o i n t _ t e s t . c
)
target_link_libraries ( floating_point_test
P R I V A T E
s n d f i l e
t e s t _ u t i l s
$ < $ < B O O L : $ { L I B M _ R E Q U I R E D } > : m >
)
target_include_directories ( floating_point_test PRIVATE tests )
2016-07-26 08:41:17 +00:00
add_test ( floating_point_test floating_point_test )
### checksum_test
2018-08-19 03:56:17 +00:00
add_executable ( checksum_test tests/checksum_test.c )
target_link_libraries ( checksum_test
P R I V A T E
s n d f i l e
t e s t _ u t i l s
$ < $ < B O O L : $ { L I B M _ R E Q U I R E D } > : m >
)
2016-07-26 08:41:17 +00:00
add_test ( checksum_test checksum_test )
### scale_clip_test
2018-08-19 03:56:17 +00:00
add_executable ( scale_clip_test tests/scale_clip_test.c )
target_link_libraries ( scale_clip_test
P R I V A T E
s n d f i l e
t e s t _ u t i l s
$ < $ < B O O L : $ { L I B M _ R E Q U I R E D } > : m >
)
2016-07-26 08:41:17 +00:00
add_test ( scale_clip_test scale_clip_test )
### headerless_test
2018-08-19 03:56:17 +00:00
add_executable ( headerless_test tests/headerless_test.c )
target_link_libraries ( headerless_test
P R I V A T E
s n d f i l e
t e s t _ u t i l s
$ < $ < B O O L : $ { L I B M _ R E Q U I R E D } > : m >
)
2016-07-26 08:41:17 +00:00
add_test ( headerless_test headerless_test )
### rdwr_test
2018-08-19 03:56:17 +00:00
add_executable ( rdwr_test tests/rdwr_test.c )
target_link_libraries ( rdwr_test
P R I V A T E
s n d f i l e
t e s t _ u t i l s
$ < $ < B O O L : $ { L I B M _ R E Q U I R E D } > : m >
)
2016-07-26 08:41:17 +00:00
add_test ( rdwr_test rdwr_test )
### locale_test
2018-08-19 03:56:17 +00:00
add_executable ( locale_test tests/locale_test.c )
target_link_libraries ( locale_test
P R I V A T E
s n d f i l e
t e s t _ u t i l s
$ < $ < B O O L : $ { L I B M _ R E Q U I R E D } > : m >
)
2016-07-26 08:41:17 +00:00
add_test ( locale_test locale_test )
### win32_ordinal_test
2018-08-19 03:56:17 +00:00
# Disabled because we cannot test with shared sndfile library
# if (WIN32 AND BUILD_SHARED_LIBS)
# add_executable (win32_ordinal_test tests/win32_ordinal_test.c)
# target_link_libraries (win32_ordinal_test PRIVATE sndfile test_utils)
# add_test (win32_ordinal_test win32_ordinal_test)
# endif ()
2016-07-26 08:41:17 +00:00
### cpp_test
2018-08-19 03:56:17 +00:00
add_executable ( cpp_test tests/cpp_test.cc )
target_link_libraries ( cpp_test
P R I V A T E
s n d f i l e
t e s t _ u t i l s
$ < $ < B O O L : $ { L I B M _ R E Q U I R E D } > : m >
)
2016-07-26 08:41:17 +00:00
add_test ( cpp_test cpp_test )
### external_libs_test
2018-08-19 03:56:17 +00:00
add_executable ( external_libs_test tests/external_libs_test.c )
target_link_libraries ( external_libs_test
P R I V A T E
s n d f i l e
t e s t _ u t i l s
$ < $ < B O O L : $ { L I B M _ R E Q U I R E D } > : m >
)
2016-07-26 08:41:17 +00:00
add_test ( external_libs_test external_libs_test )
### format_check_test
2018-08-19 03:56:17 +00:00
add_executable ( format_check_test tests/format_check_test.c )
target_link_libraries ( format_check_test
P R I V A T E
s n d f i l e
t e s t _ u t i l s
$ < $ < B O O L : $ { L I B M _ R E Q U I R E D } > : m >
)
2016-07-26 08:41:17 +00:00
add_test ( format_check_test format_check_test )
### channel_test
2018-08-19 03:56:17 +00:00
add_executable ( channel_test tests/channel_test.c )
target_link_libraries ( channel_test
P R I V A T E
s n d f i l e
t e s t _ u t i l s
$ < $ < B O O L : $ { L I B M _ R E Q U I R E D } > : m >
)
2016-07-26 08:41:17 +00:00
add_test ( channel_test channel_test )
2017-04-10 13:46:31 +00:00
### pcm_test
2018-08-19 03:56:17 +00:00
add_executable ( pcm_test tests/pcm_test.c )
target_link_libraries ( pcm_test
P R I V A T E
s n d f i l e
t e s t _ u t i l s
$ < $ < B O O L : $ { L I B M _ R E Q U I R E D } > : m >
)
2017-04-10 13:46:31 +00:00
add_test ( pcm_test pcm_test )
2016-07-26 08:41:17 +00:00
### common test executables
2018-08-19 03:56:17 +00:00
add_executable ( write_read_test
t e s t s / g e n e r a t e . c
t e s t s / w r i t e _ r e a d _ t e s t . c
)
target_link_libraries ( write_read_test
P R I V A T E
s n d f i l e
t e s t _ u t i l s
$ < $ < B O O L : $ { L I B M _ R E Q U I R E D } > : m >
)
target_include_directories ( write_read_test PRIVATE tests )
add_executable ( lossy_comp_test tests/lossy_comp_test.c )
target_link_libraries ( lossy_comp_test
P R I V A T E
s n d f i l e
t e s t _ u t i l s
$ < $ < B O O L : $ { L I B M _ R E Q U I R E D } > : m >
)
add_executable ( peak_chunk_test tests/peak_chunk_test.c )
target_link_libraries ( peak_chunk_test
P R I V A T E
s n d f i l e
t e s t _ u t i l s
$ < $ < B O O L : $ { L I B M _ R E Q U I R E D } > : m >
)
add_executable ( header_test tests/header_test.c )
target_link_libraries ( header_test
P R I V A T E
s n d f i l e
t e s t _ u t i l s
$ < $ < B O O L : $ { L I B M _ R E Q U I R E D } > : m >
)
add_executable ( misc_test tests/misc_test.c )
target_link_libraries ( misc_test
P R I V A T E
s n d f i l e
t e s t _ u t i l s
$ < $ < B O O L : $ { L I B M _ R E Q U I R E D } > : m >
)
add_executable ( string_test tests/string_test.c )
target_link_libraries ( string_test
P R I V A T E
s n d f i l e
t e s t _ u t i l s
$ < $ < B O O L : $ { L I B M _ R E Q U I R E D } > : m >
)
add_executable ( multi_file_test tests/multi_file_test.c )
target_link_libraries ( multi_file_test
P R I V A T E
s n d f i l e
t e s t _ u t i l s
$ < $ < B O O L : $ { L I B M _ R E Q U I R E D } > : m >
)
add_executable ( aiff_rw_test tests/aiff_rw_test.c )
target_link_libraries ( aiff_rw_test
P R I V A T E
s n d f i l e
t e s t _ u t i l s
$ < $ < B O O L : $ { L I B M _ R E Q U I R E D } > : m >
)
add_executable ( chunk_test tests/chunk_test.c )
target_link_libraries ( chunk_test
P R I V A T E
s n d f i l e
t e s t _ u t i l s
$ < $ < B O O L : $ { L I B M _ R E Q U I R E D } > : m >
)
add_executable ( long_read_write_test tests/long_read_write_test.c )
target_link_libraries ( long_read_write_test
P R I V A T E
s n d f i l e
t e s t _ u t i l s
$ < $ < B O O L : $ { L I B M _ R E Q U I R E D } > : m >
)
add_executable ( raw_test tests/raw_test.c )
target_link_libraries ( raw_test
P R I V A T E
s n d f i l e
t e s t _ u t i l s
$ < $ < B O O L : $ { L I B M _ R E Q U I R E D } > : m >
)
add_executable ( compression_size_test tests/compression_size_test.c )
target_link_libraries ( compression_size_test
P R I V A T E
s n d f i l e
t e s t _ u t i l s
$ < $ < B O O L : $ { L I B M _ R E Q U I R E D } > : m >
)
add_executable ( ogg_test tests/ogg_test.c )
target_link_libraries ( ogg_test
P R I V A T E
s n d f i l e
t e s t _ u t i l s
$ < $ < B O O L : $ { L I B M _ R E Q U I R E D } > : m >
)
Opus file support
Ogg: Introduce new functions ogg_sync_fseek(), ogg_ftell(), ogg_next_page(),
ogg_stream_next_page(), ogg_sync_last_page_before(), and
ogg_stream_unpack_page(). Use ogg_sync_* for ogg_read_first_page(). Bump libogg
version requirement from 1.1.3 to 1.3.0 as LibOgg 1.3.0 is required for
ogg_stream_pageout_fill() and ogg_stream_flush_fill().
Opus: Add opus support. Document added commands
SFC_(GET|SET)_ORIGINAL_SAMPLERATE. Added or extended tests ogg_opus_test,
compression_size_test, floating_point_test, lossy_comp_test, string_test,
external_libs_test. Change Opus to non-experimental.
2018-07-09 21:37:06 +00:00
add_executable ( ogg_opus_test tests/ogg_opus_test.c )
target_link_libraries ( ogg_opus_test
P R I V A T E
s n d f i l e
t e s t _ u t i l s
$ < $ < B O O L : $ { L I B M _ R E Q U I R E D } > : m >
)
2021-01-12 05:51:16 +00:00
add_executable ( mpeg_test tests/mpeg_test.c )
target_link_libraries ( mpeg_test
2019-02-10 06:45:55 +00:00
P R I V A T E
s n d f i l e
t e s t _ u t i l s
$ < $ < B O O L : $ { L I B M _ R E Q U I R E D } > : m >
)
2018-08-19 03:56:17 +00:00
add_executable ( stdin_test tests/stdin_test.c )
target_link_libraries ( stdin_test
P R I V A T E
s n d f i l e
t e s t _ u t i l s
$ < $ < B O O L : $ { L I B M _ R E Q U I R E D } > : m >
)
set_target_properties ( stdin_test PROPERTIES RUNTIME_OUTPUT_DIRECTORY "tests" )
add_executable ( stdout_test tests/stdout_test.c )
target_link_libraries ( stdout_test
P R I V A T E
s n d f i l e
t e s t _ u t i l s
$ < $ < B O O L : $ { L I B M _ R E Q U I R E D } > : m >
)
set_target_properties ( stdout_test PROPERTIES RUNTIME_OUTPUT_DIRECTORY "tests" )
add_executable ( stdio_test tests/stdio_test.c )
target_link_libraries ( stdio_test
P R I V A T E
s n d f i l e
t e s t _ u t i l s
$ < $ < B O O L : $ { L I B M _ R E Q U I R E D } > : m >
)
add_executable ( pipe_test tests/pipe_test.c )
target_link_libraries ( pipe_test
P R I V A T E
s n d f i l e
t e s t _ u t i l s
$ < $ < B O O L : $ { L I B M _ R E Q U I R E D } > : m >
)
add_executable ( virtual_io_test tests/virtual_io_test.c )
target_link_libraries ( virtual_io_test
P R I V A T E
s n d f i l e
t e s t _ u t i l s
$ < $ < B O O L : $ { L I B M _ R E Q U I R E D } > : m >
)
2016-07-26 08:41:17 +00:00
### g72x_test
2018-08-19 03:56:17 +00:00
add_executable ( g72x_test src/G72x/g72x_test.c )
2020-08-26 06:23:33 +00:00
target_include_directories ( g72x_test
P R I V A T E
s r c
$ { C M A K E _ C U R R E N T _ B I N A R Y _ D I R } / s r c
)
2018-08-19 03:56:17 +00:00
target_link_libraries ( g72x_test
P R I V A T E
s n d f i l e
$ < $ < B O O L : $ { L I B M _ R E Q U I R E D } > : m >
)
2016-07-26 08:41:17 +00:00
add_test ( g72x_test g72x_test all )
### aiff-tests
add_test ( write_read_test_aiff write_read_test aiff )
add_test ( lossy_comp_test_aiff_ulaw lossy_comp_test aiff_ulaw )
add_test ( lossy_comp_test_aiff_alaw lossy_comp_test aiff_alaw )
add_test ( lossy_comp_test_aiff_gsm610 lossy_comp_test aiff_gsm610 )
add_test ( peak_chunk_test_aiff peak_chunk_test aiff )
add_test ( header_test_aiff header_test aiff )
add_test ( misc_test_aiff misc_test aiff )
add_test ( string_test_aiff string_test aiff )
add_test ( multi_file_test_aiff multi_file_test aiff )
add_test ( aiff_rw_test aiff_rw_test )
### au-tests
add_test ( write_read_test_au write_read_test au )
add_test ( lossy_comp_test_au_ulaw lossy_comp_test au_ulaw )
add_test ( lossy_comp_test_au_alaw lossy_comp_test au_alaw )
add_test ( lossy_comp_test_au_g721 lossy_comp_test au_g721 )
add_test ( lossy_comp_test_au_g723 lossy_comp_test au_g723 )
add_test ( header_test_au header_test au )
add_test ( misc_test_au misc_test au )
add_test ( multi_file_test_au multi_file_test au )
### caf-tests
add_test ( write_read_test_caf write_read_test caf )
add_test ( lossy_comp_test_caf_ulaw lossy_comp_test caf_ulaw )
add_test ( lossy_comp_test_caf_alaw lossy_comp_test caf_alaw )
add_test ( header_test_caf header_test caf )
add_test ( peak_chunk_test_caf peak_chunk_test caf )
add_test ( misc_test_caf misc_test caf )
add_test ( chunk_test_caf chunk_test caf )
add_test ( string_test_caf string_test caf )
add_test ( long_read_write_test_alac long_read_write_test alac )
# wav-tests
add_test ( write_read_test_wav write_read_test wav )
add_test ( lossy_comp_test_wav_pcm lossy_comp_test wav_pcm )
add_test ( lossy_comp_test_wav_ima lossy_comp_test wav_ima )
add_test ( lossy_comp_test_wav_msadpcm lossy_comp_test wav_msadpcm )
add_test ( lossy_comp_test_wav_ulaw lossy_comp_test wav_ulaw )
add_test ( lossy_comp_test_wav_alaw lossy_comp_test wav_alaw )
add_test ( lossy_comp_test_wav_gsm610 lossy_comp_test wav_gsm610 )
add_test ( lossy_comp_test_wav_g721 lossy_comp_test wav_g721 )
2018-03-10 10:46:51 +00:00
add_test ( lossy_comp_test_wav_nmsadpcm lossy_comp_test wav_nmsadpcm )
2016-07-26 08:41:17 +00:00
add_test ( peak_chunk_test_wav peak_chunk_test wav )
add_test ( header_test_wav header_test wav )
add_test ( misc_test_wav misc_test wav )
add_test ( string_test_wav string_test wav )
add_test ( multi_file_test_wav multi_file_test wav )
add_test ( chunk_test_wav chunk_test wav )
### w64-tests
add_test ( write_read_test_w64 write_read_test w64 )
add_test ( lossy_comp_test_w64_ima lossy_comp_test w64_ima )
add_test ( lossy_comp_test_w64_msadpcm lossy_comp_test w64_msadpcm )
add_test ( lossy_comp_test_w64_ulaw lossy_comp_test w64_ulaw )
add_test ( lossy_comp_test_w64_alaw lossy_comp_test w64_alaw )
add_test ( lossy_comp_test_w64_gsm610 lossy_comp_test w64_gsm610 )
add_test ( header_test_w64 header_test w64 )
add_test ( misc_test_w64 misc_test w64 )
### rf64-tests
add_test ( write_read_test_rf64 write_read_test rf64 )
add_test ( header_test_rf64 header_test rf64 )
add_test ( misc_test_rf64 misc_test rf64 )
add_test ( string_test_rf64 string_test rf64 )
add_test ( peak_chunk_test_rf64 peak_chunk_test rf64 )
add_test ( chunk_test_rf64 chunk_test rf64 )
### raw-tests
add_test ( write_read_test_raw write_read_test raw )
add_test ( lossy_comp_test_raw_ulaw lossy_comp_test raw_ulaw )
add_test ( lossy_comp_test_raw_alaw lossy_comp_test raw_alaw )
add_test ( lossy_comp_test_raw_gsm610 lossy_comp_test raw_gsm610 )
add_test ( lossy_comp_test_vox_adpcm lossy_comp_test vox_adpcm )
add_test ( raw_test raw_test )
### paf-tests
add_test ( write_read_test_paf write_read_test paf )
add_test ( header_test_paf header_test paf )
add_test ( misc_test_paf misc_test paf )
### svx-tests
add_test ( write_read_test_svx write_read_test svx )
add_test ( header_test_svx header_test svx )
add_test ( misc_test_svx misc_test svx )
### nist-tests
add_test ( write_read_test_nist write_read_test nist )
add_test ( lossy_comp_test_nist_ulaw lossy_comp_test nist_ulaw )
add_test ( lossy_comp_test_nist_alaw lossy_comp_test nist_alaw )
add_test ( header_test_nist header_test nist )
add_test ( misc_test_nist misc_test nist )
### ircam-tests
add_test ( write_read_test_ircam write_read_test ircam )
add_test ( lossy_comp_test_ircam_ulaw lossy_comp_test ircam_ulaw )
add_test ( lossy_comp_test_ircam_alaw lossy_comp_test ircam_alaw )
add_test ( header_test_ircam header_test ircam )
add_test ( misc_test_ircam misc_test ircam )
### voc-tests
add_test ( write_read_test_voc write_read_test voc )
add_test ( lossy_comp_test_voc_ulaw lossy_comp_test voc_ulaw )
add_test ( lossy_comp_test_voc_alaw lossy_comp_test voc_alaw )
add_test ( header_test_voc header_test voc )
add_test ( misc_test_voc misc_test voc )
### mat4-tests
add_test ( write_read_test_mat4 write_read_test mat4 )
add_test ( header_test_mat4 header_test mat4 )
add_test ( misc_test_mat4 misc_test mat4 )
### mat5-tests
add_test ( write_read_test_mat5 write_read_test mat5 )
add_test ( header_test_mat5 header_test mat5 )
add_test ( misc_test_mat5 misc_test mat5 )
### pvf-tests
add_test ( write_read_test_pvf write_read_test pvf )
add_test ( header_test_pvf header_test pvf )
add_test ( misc_test_pvf misc_test pvf )
### xi-tests
add_test ( lossy_comp_test_xi_dpcm lossy_comp_test xi_dpcm )
### htk-tests
add_test ( write_read_test_htk write_read_test htk )
add_test ( header_test_htk header_test htk )
add_test ( misc_test_htk misc_test htk )
### avr-tests
add_test ( write_read_test_avr write_read_test avr )
add_test ( header_test_avr header_test avr )
add_test ( misc_test_avr misc_test avr )
### sds-tests
add_test ( write_read_test_sds write_read_test sds )
add_test ( header_test_sds header_test sds )
add_test ( misc_test_sds misc_test sds )
# sd2-tests
add_test ( write_read_test_sd2 write_read_test sd2 )
### wve-tests
add_test ( lossy_comp_test_wve lossy_comp_test wve )
### mpc2k-tests
add_test ( write_read_test_mpc2k write_read_test mpc2k )
add_test ( header_test_mpc2k header_test mpc2k )
add_test ( misc_test_mpc2k misc_test mpc2k )
### flac-tests
add_test ( write_read_test_flac write_read_test flac )
add_test ( compression_size_test_flac compression_size_test flac )
add_test ( string_test_flac string_test flac )
### vorbis-tests
add_test ( ogg_test ogg_test )
add_test ( compression_size_test_vorbis compression_size_test vorbis )
add_test ( lossy_comp_test_ogg_vorbis lossy_comp_test ogg_vorbis )
add_test ( string_test_ogg string_test ogg )
add_test ( misc_test_ogg misc_test ogg )
Opus file support
Ogg: Introduce new functions ogg_sync_fseek(), ogg_ftell(), ogg_next_page(),
ogg_stream_next_page(), ogg_sync_last_page_before(), and
ogg_stream_unpack_page(). Use ogg_sync_* for ogg_read_first_page(). Bump libogg
version requirement from 1.1.3 to 1.3.0 as LibOgg 1.3.0 is required for
ogg_stream_pageout_fill() and ogg_stream_flush_fill().
Opus: Add opus support. Document added commands
SFC_(GET|SET)_ORIGINAL_SAMPLERATE. Added or extended tests ogg_opus_test,
compression_size_test, floating_point_test, lossy_comp_test, string_test,
external_libs_test. Change Opus to non-experimental.
2018-07-09 21:37:06 +00:00
### opus-tests ###
add_test ( ogg_opus_test ogg_opus_test )
add_test ( compression_size_test_opus compression_size_test opus )
add_test ( lossy_comp_test_ogg_opus lossy_comp_test ogg_opus )
add_test ( string_test_opus string_test opus )
2021-01-12 05:51:16 +00:00
### mpeg-tests ###
add_test ( mpeg_test mpeg_test )
2019-02-10 06:45:55 +00:00
add_test ( compression_size_test_mpeg compression_size_test mpeg )
2016-07-26 08:41:17 +00:00
### io-tests
add_test ( stdio_test stdio_test )
add_test ( pipe_test pipe_test )
add_test ( virtual_io_test virtual_io_test )
2017-04-13 06:11:02 +00:00
set ( SNDFILE_TEST_TARGETS
t e s t _ u t i l s
t e s t _ m a i n
s f v e r s i o n
e r r o r _ t e s t
u l a w _ t e s t
a l a w _ t e s t
d w v w _ t e s t
c o m m a n d _ t e s t
f l o a t i n g _ p o i n t _ t e s t
c h e c k s u m _ t e s t
s c a l e _ c l i p _ t e s t
h e a d e r l e s s _ t e s t
r d w r _ t e s t
l o c a l e _ t e s t
c p p _ t e s t
e x t e r n a l _ l i b s _ t e s t
f o r m a t _ c h e c k _ t e s t
c h a n n e l _ t e s t
p c m _ t e s t
w r i t e _ r e a d _ t e s t
l o s s y _ c o m p _ t e s t
p e a k _ c h u n k _ t e s t
h e a d e r _ t e s t
m i s c _ t e s t
s t r i n g _ t e s t
m u l t i _ f i l e _ t e s t
a i f f _ r w _ t e s t
c h u n k _ t e s t
l o n g _ r e a d _ w r i t e _ t e s t
r a w _ t e s t
c o m p r e s s i o n _ s i z e _ t e s t
o g g _ t e s t
s t d i n _ t e s t
s t d o u t _ t e s t
s t d i o _ t e s t
p i p e _ t e s t
v i r t u a l _ i o _ t e s t
2018-08-19 03:56:17 +00:00
g 7 2 x _ t e s t
)
2017-04-13 06:11:02 +00:00
2018-08-19 03:56:17 +00:00
# if (WIN32 AND BUILD_SHARED_LIBS)
# list (APPEND SNDFILE_TEST_TARGETS win32_ordinal_test)
# endif ()
2017-04-13 06:11:02 +00:00
set_target_properties ( ${ SNDFILE_TEST_TARGETS } PROPERTIES FOLDER Tests )
2018-08-19 03:56:17 +00:00
endif ( )
2020-08-18 06:08:51 +00:00
if ( ENABLE_CPACK )
2021-05-25 12:10:29 +00:00
if ( ( NOT CPACK_PACKAGE_VERSION ) AND CPACK_PACKAGE_VERSION_STAGE )
set ( CPACK_PACKAGE_VERSION "${CPACK_PACKAGE_VERSION_FULL}" )
endif ( )
2020-08-18 06:08:51 +00:00
include ( CPack )
endif ( )