1b815c7f3Sopenharmony_cicmake_minimum_required (VERSION 3.1..3.18) 2b815c7f3Sopenharmony_ci 3b815c7f3Sopenharmony_ci# MSVC runtime library flags are selected by an abstraction, CMake >= 3.15 4b815c7f3Sopenharmony_ci# This policy still need to be set even with cmake_minimum_required() command above. 5b815c7f3Sopenharmony_ciif (POLICY CMP0091) 6b815c7f3Sopenharmony_ci if ((DEFINED ENABLE_STATIC_RUNTIME) AND (DEFINED CMAKE_MSVC_RUNTIME_LIBRARY)) 7b815c7f3Sopenharmony_ci message (FATAL_ERROR "Both ENABLE_STATIC_RUNTIME and CMAKE_MSVC_RUNTIME_LIBRARY are set.") 8b815c7f3Sopenharmony_ci return () 9b815c7f3Sopenharmony_ci endif () 10b815c7f3Sopenharmony_ci 11b815c7f3Sopenharmony_ci if (DEFINED CMAKE_MSVC_RUNTIME_LIBRARY) 12b815c7f3Sopenharmony_ci cmake_policy (SET CMP0091 NEW) 13b815c7f3Sopenharmony_ci else () 14b815c7f3Sopenharmony_ci cmake_policy (SET CMP0091 OLD) 15b815c7f3Sopenharmony_ci endif () 16b815c7f3Sopenharmony_ciendif () 17b815c7f3Sopenharmony_ci 18b815c7f3Sopenharmony_cioption (ENABLE_EXTERNAL_LIBS "Enable FLAC, Vorbis, and Opus codecs" ON) 19b815c7f3Sopenharmony_ciif (ENABLE_EXTERNAL_LIBS) 20b815c7f3Sopenharmony_ci list (APPEND VCPKG_MANIFEST_FEATURES "external-libs") 21b815c7f3Sopenharmony_ciendif () 22b815c7f3Sopenharmony_ci 23b815c7f3Sopenharmony_cioption (ENABLE_MPEG "Enable MPEG codecs" ON) 24b815c7f3Sopenharmony_ciif (ENABLE_MPEG) 25b815c7f3Sopenharmony_ci list (APPEND VCPKG_MANIFEST_FEATURES "mpeg") 26b815c7f3Sopenharmony_ciendif () 27b815c7f3Sopenharmony_ci 28b815c7f3Sopenharmony_cioption (ENABLE_EXPERIMENTAL "Enable experimental code" OFF) 29b815c7f3Sopenharmony_ciif (ENABLE_EXPERIMENTAL) 30b815c7f3Sopenharmony_ci list (APPEND VCPKG_MANIFEST_FEATURES "speex") 31b815c7f3Sopenharmony_ciendif () 32b815c7f3Sopenharmony_ci 33b815c7f3Sopenharmony_cioption (BUILD_REGTEST "Build regtest" OFF) 34b815c7f3Sopenharmony_ciif (BUILD_REGTEST) 35b815c7f3Sopenharmony_ci list (APPEND VCPKG_MANIFEST_FEATURES "regtest") 36b815c7f3Sopenharmony_ciendif () 37b815c7f3Sopenharmony_ci 38b815c7f3Sopenharmony_ciproject(libsndfile VERSION 1.2.0) 39b815c7f3Sopenharmony_ci 40b815c7f3Sopenharmony_ci# 41b815c7f3Sopenharmony_ci# Variables 42b815c7f3Sopenharmony_ci# 43b815c7f3Sopenharmony_ci 44b815c7f3Sopenharmony_ciset (CMAKE_C_STANDARD 99) 45b815c7f3Sopenharmony_ciset (CMAKE_C_STANDARD_REQUIRED TRUE) 46b815c7f3Sopenharmony_ciset_property(GLOBAL PROPERTY USE_FOLDERS ON) 47b815c7f3Sopenharmony_ci 48b815c7f3Sopenharmony_ciset (PACKAGE_NAME ${PROJECT_NAME}) 49b815c7f3Sopenharmony_ciset (CPACK_PACKAGE_VERSION_MAJOR ${PROJECT_VERSION_MAJOR}) 50b815c7f3Sopenharmony_ciset (CPACK_PACKAGE_VERSION_MINOR ${PROJECT_VERSION_MINOR}) 51b815c7f3Sopenharmony_ciset (CPACK_PACKAGE_VERSION_PATCH ${PROJECT_VERSION_PATCH}) 52b815c7f3Sopenharmony_ciset (CPACK_PACKAGE_VERSION_STAGE "") 53b815c7f3Sopenharmony_ciset (CPACK_PACKAGE_VERSION_FULL "${PROJECT_VERSION}${CPACK_PACKAGE_VERSION_STAGE}") 54b815c7f3Sopenharmony_ci 55b815c7f3Sopenharmony_ci# 56b815c7f3Sopenharmony_ci# System-wide includes 57b815c7f3Sopenharmony_ci# 58b815c7f3Sopenharmony_ci 59b815c7f3Sopenharmony_ciinclude (GNUInstallDirs) 60b815c7f3Sopenharmony_ciinclude (FeatureSummary) 61b815c7f3Sopenharmony_ciinclude (CMakeDependentOption) 62b815c7f3Sopenharmony_ciinclude (CTest) 63b815c7f3Sopenharmony_ciinclude (CheckCCompilerFlag) 64b815c7f3Sopenharmony_ci 65b815c7f3Sopenharmony_ci# 66b815c7f3Sopenharmony_ci# Options 67b815c7f3Sopenharmony_ci# 68b815c7f3Sopenharmony_ci 69b815c7f3Sopenharmony_cioption (BUILD_SHARED_LIBS "Build shared libraries" OFF) 70b815c7f3Sopenharmony_ciif (BUILD_SHARED_LIBS AND BUILD_TESTING) 71b815c7f3Sopenharmony_ci set (BUILD_TESTING OFF) 72b815c7f3Sopenharmony_ci message ("Build testing required static libraries. To prevent build errors BUILD_TESTING disabled.") 73b815c7f3Sopenharmony_ciendif () 74b815c7f3Sopenharmony_cioption (BUILD_PROGRAMS "Build programs" ON) 75b815c7f3Sopenharmony_cioption (BUILD_EXAMPLES "Build examples" ON) 76b815c7f3Sopenharmony_cioption (ENABLE_CPACK "Enable CPack support" ON) 77b815c7f3Sopenharmony_cioption (ENABLE_BOW_DOCS "Enable black-on-white html docs" OFF) 78b815c7f3Sopenharmony_ciif (MSVC AND (DEFINED ENABLE_STATIC_RUNTIME)) 79b815c7f3Sopenharmony_ci option (ENABLE_STATIC_RUNTIME "Enable static runtime" ${ENABLE_STATIC_RUNTIME}) 80b815c7f3Sopenharmony_cielseif (MINGW) 81b815c7f3Sopenharmony_ci option (ENABLE_STATIC_RUNTIME "Enable static runtime" OFF) 82b815c7f3Sopenharmony_ciendif () 83b815c7f3Sopenharmony_cioption (ENABLE_PACKAGE_CONFIG "Generate and install package config file" ON) 84b815c7f3Sopenharmony_cioption (INSTALL_PKGCONFIG_MODULE "Generate and install pkg-config module" ON) 85b815c7f3Sopenharmony_ci 86b815c7f3Sopenharmony_cilist (APPEND CMAKE_MODULE_PATH "${CMAKE_CURRENT_SOURCE_DIR}/cmake") 87b815c7f3Sopenharmony_ciif (CMAKE_VERSION VERSION_LESS 3.14) 88b815c7f3Sopenharmony_ci list (APPEND CMAKE_MODULE_PATH "${CMAKE_CURRENT_SOURCE_DIR}/cmake/sqlite") 89b815c7f3Sopenharmony_ciendif () 90b815c7f3Sopenharmony_ci 91b815c7f3Sopenharmony_ci# 92b815c7f3Sopenharmony_ci# Setup definitions 93b815c7f3Sopenharmony_ci# 94b815c7f3Sopenharmony_ci 95b815c7f3Sopenharmony_ciinclude(SndFileChecks) 96b815c7f3Sopenharmony_ci 97b815c7f3Sopenharmony_ciif (ENABLE_EXTERNAL_LIBS AND NOT (Vorbis_FOUND OR FLAC_FOUND OR OPUS_FOUND)) 98b815c7f3Sopenharmony_ci set (ENABLE_EXTERNAL_LIBS OFF) 99b815c7f3Sopenharmony_ciendif() 100b815c7f3Sopenharmony_ciif(ENABLE_MPEG AND (NOT HAVE_MPEG_LIBS)) 101b815c7f3Sopenharmony_ci set (ENABLE_MPEG OFF) 102b815c7f3Sopenharmony_ciendif() 103b815c7f3Sopenharmony_ciif (BUILD_REGTEST AND (NOT SQLITE3_FOUND)) 104b815c7f3Sopenharmony_ci set (BUILD_REGTEST OFF) 105b815c7f3Sopenharmony_ciendif() 106b815c7f3Sopenharmony_ci 107b815c7f3Sopenharmony_cicmake_dependent_option (ENABLE_CPU_CLIP "Enable tricky cpu specific clipper" ON "CPU_CLIPS_POSITIVE;CPU_CLIPS_NEGATIVE" OFF) 108b815c7f3Sopenharmony_ciif (NOT ENABLE_CPU_CLIP) 109b815c7f3Sopenharmony_ci set (CPU_CLIPS_POSITIVE FALSE) 110b815c7f3Sopenharmony_ci set (CPU_CLIPS_NEGATIVE FALSE) 111b815c7f3Sopenharmony_ciendif () 112b815c7f3Sopenharmony_cicmake_dependent_option (ENABLE_COMPATIBLE_LIBSNDFILE_NAME "Set DLL name to libsndfile-1.dll (canonical name), sndfile.dll otherwise" OFF "WIN32;BUILD_SHARED_LIBS" OFF) 113b815c7f3Sopenharmony_cicmake_dependent_option (INSTALL_MANPAGES "Install man pages for programs" ON "BUILD_PROGRAMS" OFF) 114b815c7f3Sopenharmony_ci 115b815c7f3Sopenharmony_ciif (NOT MSVC) 116b815c7f3Sopenharmony_ci if (CPU_IS_X86) 117b815c7f3Sopenharmony_ci check_c_compiler_flag (-msse2 HAVE_MSSE2_COMPILER_FLAG) 118b815c7f3Sopenharmony_ci if (HAVE_MSSE2_COMPILER_FLAG) 119b815c7f3Sopenharmony_ci cmake_dependent_option (ENABLE_SSE2 "Add SSE2 compiler flag" ON "HAVE_MSSE2_COMPILER_FLAG" OFF) 120b815c7f3Sopenharmony_ci endif () 121b815c7f3Sopenharmony_ci endif () 122b815c7f3Sopenharmony_ciendif () 123b815c7f3Sopenharmony_ciif (ENABLE_SSE2) 124b815c7f3Sopenharmony_ci add_compile_options (-msse2) 125b815c7f3Sopenharmony_ciendif () 126b815c7f3Sopenharmony_ci 127b815c7f3Sopenharmony_ciset (HAVE_EXTERNAL_XIPH_LIBS ${ENABLE_EXTERNAL_LIBS}) 128b815c7f3Sopenharmony_ciset (HAVE_SQLITE3 ${BUILD_REGTEST}) 129b815c7f3Sopenharmony_ciset (HAVE_ALSA_ASOUNDLIB_H ${ALSA_FOUND}) 130b815c7f3Sopenharmony_ciset (HAVE_SNDIO_H ${SNDIO_FOUND}) 131b815c7f3Sopenharmony_ci 132b815c7f3Sopenharmony_ciset (ENABLE_EXPERIMENTAL_CODE ${ENABLE_EXPERIMENTAL}) 133b815c7f3Sopenharmony_ciset (HAVE_MPEG ${ENABLE_MPEG}) 134b815c7f3Sopenharmony_ciset (HAVE_SPEEX ${ENABLE_EXPERIMENTAL}) 135b815c7f3Sopenharmony_ci 136b815c7f3Sopenharmony_ciadd_feature_info (BUILD_SHARED_LIBS BUILD_SHARED_LIBS "build shared libraries") 137b815c7f3Sopenharmony_ciadd_feature_info (ENABLE_EXTERNAL_LIBS ENABLE_EXTERNAL_LIBS "enable FLAC, Vorbis, and Opus codecs") 138b815c7f3Sopenharmony_ciadd_feature_info (ENABLE_MPEG ENABLE_MPEG "enable MPEG audio (including mp3) codecs") 139b815c7f3Sopenharmony_ciadd_feature_info (ENABLE_EXPERIMENTAL ENABLE_EXPERIMENTAL "enable experimental code") 140b815c7f3Sopenharmony_ciadd_feature_info (BUILD_TESTING BUILD_TESTING "build tests") 141b815c7f3Sopenharmony_ciadd_feature_info (BUILD_REGTEST BUILD_REGTEST "build regtest") 142b815c7f3Sopenharmony_ciadd_feature_info (ENABLE_CPACK ENABLE_CPACK "enable CPack support") 143b815c7f3Sopenharmony_ciadd_feature_info (ENABLE_CPU_CLIP ENABLE_CPU_CLIP "Enable tricky cpu specific clipper") 144b815c7f3Sopenharmony_ciadd_feature_info (ENABLE_BOW_DOCS ENABLE_BOW_DOCS "enable black-on-white html docs") 145b815c7f3Sopenharmony_ciadd_feature_info (ENABLE_PACKAGE_CONFIG ENABLE_PACKAGE_CONFIG "generate and install package config file") 146b815c7f3Sopenharmony_ciadd_feature_info (INSTALL_PKGCONFIG_MODULE INSTALL_PKGCONFIG_MODULE "generate and install pkg-config module") 147b815c7f3Sopenharmony_ciadd_feature_info (INSTALL_MANPAGES INSTALL_MANPAGES "install man pages for programs") 148b815c7f3Sopenharmony_ciif (WIN32 AND BUILD_SHARED_LIBS) 149b815c7f3Sopenharmony_ci add_feature_info (ENABLE_COMPATIBLE_LIBSNDFILE_NAME ENABLE_COMPATIBLE_LIBSNDFILE_NAME "Set DLL name to libsndfile-1.dll (canonical name), sndfile.dll otherwise") 150b815c7f3Sopenharmony_ciendif () 151b815c7f3Sopenharmony_ci 152b815c7f3Sopenharmony_ciif (HAVE_MSSE2_COMPILER_FLAG) 153b815c7f3Sopenharmony_ci add_feature_info (ENABLE_SSE2 ENABLE_SSE2 "add SSE2 compiler flag") 154b815c7f3Sopenharmony_ciendif () 155b815c7f3Sopenharmony_ci 156b815c7f3Sopenharmony_ci 157b815c7f3Sopenharmony_ci 158b815c7f3Sopenharmony_ci 159b815c7f3Sopenharmony_ciset_package_properties (Ogg PROPERTIES 160b815c7f3Sopenharmony_ci TYPE RECOMMENDED 161b815c7f3Sopenharmony_ci URL "www.xiph.org/ogg/" 162b815c7f3Sopenharmony_ci DESCRIPTION "library for manipulating ogg bitstreams" 163b815c7f3Sopenharmony_ci PURPOSE "Required to enable Vorbis, Speex, and Opus support" 164b815c7f3Sopenharmony_ci ) 165b815c7f3Sopenharmony_ciset_package_properties (Vorbis PROPERTIES 166b815c7f3Sopenharmony_ci TYPE RECOMMENDED 167b815c7f3Sopenharmony_ci URL "www.vorbis.com/" 168b815c7f3Sopenharmony_ci DESCRIPTION "open source lossy audio codec" 169b815c7f3Sopenharmony_ci PURPOSE "Enables Vorbis support" 170b815c7f3Sopenharmony_ci ) 171b815c7f3Sopenharmony_ciset_package_properties (FLAC PROPERTIES 172b815c7f3Sopenharmony_ci TYPE RECOMMENDED 173b815c7f3Sopenharmony_ci URL "www.xiph.org/flac/" 174b815c7f3Sopenharmony_ci DESCRIPTION "Free Lossless Audio Codec Library" 175b815c7f3Sopenharmony_ci PURPOSE "Enables FLAC support" 176b815c7f3Sopenharmony_ci ) 177b815c7f3Sopenharmony_ciset_package_properties (mp3lame PROPERTIES 178b815c7f3Sopenharmony_ci TYPE RECOMMENDED 179b815c7f3Sopenharmony_ci URL "https://lame.sourceforge.io/" 180b815c7f3Sopenharmony_ci DESCRIPTION "High quality MPEG Audio Layer III (MP3) encoder" 181b815c7f3Sopenharmony_ci PURPOSE "Enables MPEG layer III (MP3) writing support" 182b815c7f3Sopenharmony_ci ) 183b815c7f3Sopenharmony_ciset_package_properties (MPG123 PROPERTIES 184b815c7f3Sopenharmony_ci TYPE RECOMMENDED 185b815c7f3Sopenharmony_ci URL "https://www.mpg123.de/" 186b815c7f3Sopenharmony_ci DESCRIPTION "MPEG Audio Layer I/II/III decoder" 187b815c7f3Sopenharmony_ci PURPOSE "Enables MPEG Audio reading support" 188b815c7f3Sopenharmony_ci ) 189b815c7f3Sopenharmony_ciset_package_properties(Opus PROPERTIES 190b815c7f3Sopenharmony_ci TYPE RECOMMENDED 191b815c7f3Sopenharmony_ci URL "www.opus-codec.org/" 192b815c7f3Sopenharmony_ci DESCRIPTION "Standardized open source low-latency fullband codec" 193b815c7f3Sopenharmony_ci PURPOSE "Enables experimental Opus support" 194b815c7f3Sopenharmony_ci ) 195b815c7f3Sopenharmony_ciset_package_properties(Speex PROPERTIES TYPE OPTIONAL 196b815c7f3Sopenharmony_ci URL "www.speex.org/" 197b815c7f3Sopenharmony_ci DESCRIPTION "an audio codec tuned for speech" 198b815c7f3Sopenharmony_ci PURPOSE "Enables experemental Speex support" 199b815c7f3Sopenharmony_ci ) 200b815c7f3Sopenharmony_ciset_package_properties (SQLite3 PROPERTIES 201b815c7f3Sopenharmony_ci TYPE OPTIONAL 202b815c7f3Sopenharmony_ci URL "www.sqlite.org/" 203b815c7f3Sopenharmony_ci DESCRIPTION "light weight SQL database engine." 204b815c7f3Sopenharmony_ci PURPOSE "Enables regtest" 205b815c7f3Sopenharmony_ci ) 206b815c7f3Sopenharmony_ciif (BUILD_SHARED_LIBS) 207b815c7f3Sopenharmony_ci set_package_properties (PythonInterp PROPERTIES 208b815c7f3Sopenharmony_ci TYPE REQUIRED 209b815c7f3Sopenharmony_ci URL "www.python.org/" 210b815c7f3Sopenharmony_ci DESCRIPTION "Python is a widely used high-level programming language." 211b815c7f3Sopenharmony_ci PURPOSE "Required to build shared libraries" 212b815c7f3Sopenharmony_ci ) 213b815c7f3Sopenharmony_ciendif() 214b815c7f3Sopenharmony_ci 215b815c7f3Sopenharmony_cifeature_summary (WHAT ALL) 216b815c7f3Sopenharmony_ci 217b815c7f3Sopenharmony_ci# 218b815c7f3Sopenharmony_ci# Setup configuration 219b815c7f3Sopenharmony_ci# 220b815c7f3Sopenharmony_ci 221b815c7f3Sopenharmony_ciconfigure_file (src/config.h.cmake src/config.h) 222b815c7f3Sopenharmony_ci 223b815c7f3Sopenharmony_ciif (INSTALL_PKGCONFIG_MODULE) 224b815c7f3Sopenharmony_ci 225b815c7f3Sopenharmony_ci set (prefix ${CMAKE_INSTALL_PREFIX}) 226b815c7f3Sopenharmony_ci set (exec_prefix "\$\{prefix\}") 227b815c7f3Sopenharmony_ci set (libdir "\$\{prefix\}/${CMAKE_INSTALL_LIBDIR}") 228b815c7f3Sopenharmony_ci set (includedir "\$\{prefix\}/${CMAKE_INSTALL_INCLUDEDIR}") 229b815c7f3Sopenharmony_ci set (VERSION ${PROJECT_VERSION}) 230b815c7f3Sopenharmony_ci if (ENABLE_EXTERNAL_LIBS) 231b815c7f3Sopenharmony_ci set (EXTERNAL_XIPH_REQUIRE "flac ogg vorbis vorbisenc opus") 232b815c7f3Sopenharmony_ci if (ENABLE_EXPERIMENTAL) 233b815c7f3Sopenharmony_ci set (EXTERNAL_XIPH_REQUIRE "${EXTERNAL_XIPH_REQUIRE} speex") 234b815c7f3Sopenharmony_ci endif () 235b815c7f3Sopenharmony_ci endif () 236b815c7f3Sopenharmony_ci if (ENABLE_MPEG) 237b815c7f3Sopenharmony_ci set (EXTERNAL_MPEG_REQUIRE "libmpg123") 238b815c7f3Sopenharmony_ci set (EXTERNAL_MPEG_LIBS "-lmp3lame") 239b815c7f3Sopenharmony_ci endif () 240b815c7f3Sopenharmony_ci 241b815c7f3Sopenharmony_ci configure_file (sndfile.pc.in sndfile.pc @ONLY) 242b815c7f3Sopenharmony_ci 243b815c7f3Sopenharmony_ciendif () 244b815c7f3Sopenharmony_ci 245b815c7f3Sopenharmony_ci# 246b815c7f3Sopenharmony_ci# libsndfile 247b815c7f3Sopenharmony_ci# 248b815c7f3Sopenharmony_ci 249b815c7f3Sopenharmony_ci# Public libsndfile headers 250b815c7f3Sopenharmony_ciset (sndfile_HDRS 251b815c7f3Sopenharmony_ci include/sndfile.h 252b815c7f3Sopenharmony_ci include/sndfile.hh 253b815c7f3Sopenharmony_ci ) 254b815c7f3Sopenharmony_ci 255b815c7f3Sopenharmony_ci# 256b815c7f3Sopenharmony_ci# libsndfile static library 257b815c7f3Sopenharmony_ci# 258b815c7f3Sopenharmony_ci 259b815c7f3Sopenharmony_ciadd_library (sndfile 260b815c7f3Sopenharmony_ci src/sfconfig.h 261b815c7f3Sopenharmony_ci src/sfendian.h 262b815c7f3Sopenharmony_ci src/sf_unistd.h 263b815c7f3Sopenharmony_ci src/common.h 264b815c7f3Sopenharmony_ci src/common.c 265b815c7f3Sopenharmony_ci src/file_io.c 266b815c7f3Sopenharmony_ci src/command.c 267b815c7f3Sopenharmony_ci src/pcm.c 268b815c7f3Sopenharmony_ci src/ulaw.c 269b815c7f3Sopenharmony_ci src/alaw.c 270b815c7f3Sopenharmony_ci src/float32.c 271b815c7f3Sopenharmony_ci src/double64.c 272b815c7f3Sopenharmony_ci src/ima_adpcm.c 273b815c7f3Sopenharmony_ci src/ms_adpcm.c 274b815c7f3Sopenharmony_ci src/gsm610.c 275b815c7f3Sopenharmony_ci src/dwvw.c 276b815c7f3Sopenharmony_ci src/vox_adpcm.c 277b815c7f3Sopenharmony_ci src/interleave.c 278b815c7f3Sopenharmony_ci src/strings.c 279b815c7f3Sopenharmony_ci src/dither.c 280b815c7f3Sopenharmony_ci src/cart.c 281b815c7f3Sopenharmony_ci src/broadcast.c 282b815c7f3Sopenharmony_ci src/audio_detect.c 283b815c7f3Sopenharmony_ci src/ima_oki_adpcm.c 284b815c7f3Sopenharmony_ci src/ima_oki_adpcm.h 285b815c7f3Sopenharmony_ci src/alac.c 286b815c7f3Sopenharmony_ci src/chunk.c 287b815c7f3Sopenharmony_ci src/ogg.h 288b815c7f3Sopenharmony_ci src/ogg.c 289b815c7f3Sopenharmony_ci src/chanmap.h 290b815c7f3Sopenharmony_ci src/chanmap.c 291b815c7f3Sopenharmony_ci src/id3.h 292b815c7f3Sopenharmony_ci src/id3.c 293b815c7f3Sopenharmony_ci $<$<BOOL:${WIN32}>:src/windows.c> 294b815c7f3Sopenharmony_ci src/sndfile.c 295b815c7f3Sopenharmony_ci src/aiff.c 296b815c7f3Sopenharmony_ci src/au.c 297b815c7f3Sopenharmony_ci src/avr.c 298b815c7f3Sopenharmony_ci src/caf.c 299b815c7f3Sopenharmony_ci src/dwd.c 300b815c7f3Sopenharmony_ci src/flac.c 301b815c7f3Sopenharmony_ci src/g72x.c 302b815c7f3Sopenharmony_ci src/htk.c 303b815c7f3Sopenharmony_ci src/ircam.c 304b815c7f3Sopenharmony_ci src/macos.c 305b815c7f3Sopenharmony_ci src/mat4.c 306b815c7f3Sopenharmony_ci src/mat5.c 307b815c7f3Sopenharmony_ci src/nist.c 308b815c7f3Sopenharmony_ci src/paf.c 309b815c7f3Sopenharmony_ci src/pvf.c 310b815c7f3Sopenharmony_ci src/raw.c 311b815c7f3Sopenharmony_ci src/rx2.c 312b815c7f3Sopenharmony_ci src/sd2.c 313b815c7f3Sopenharmony_ci src/sds.c 314b815c7f3Sopenharmony_ci src/svx.c 315b815c7f3Sopenharmony_ci src/txw.c 316b815c7f3Sopenharmony_ci src/voc.c 317b815c7f3Sopenharmony_ci src/wve.c 318b815c7f3Sopenharmony_ci src/w64.c 319b815c7f3Sopenharmony_ci src/wavlike.h 320b815c7f3Sopenharmony_ci src/wavlike.c 321b815c7f3Sopenharmony_ci src/wav.c 322b815c7f3Sopenharmony_ci src/xi.c 323b815c7f3Sopenharmony_ci src/mpc2k.c 324b815c7f3Sopenharmony_ci src/rf64.c 325b815c7f3Sopenharmony_ci src/ogg_vorbis.c 326b815c7f3Sopenharmony_ci src/ogg_speex.c 327b815c7f3Sopenharmony_ci src/ogg_pcm.c 328b815c7f3Sopenharmony_ci src/ogg_opus.c 329b815c7f3Sopenharmony_ci src/ogg_vcomment.h 330b815c7f3Sopenharmony_ci src/ogg_vcomment.c 331b815c7f3Sopenharmony_ci src/nms_adpcm.c 332b815c7f3Sopenharmony_ci src/mpeg.c 333b815c7f3Sopenharmony_ci src/mpeg_decode.c 334b815c7f3Sopenharmony_ci src/mpeg_l3_encode.c 335b815c7f3Sopenharmony_ci src/GSM610/config.h 336b815c7f3Sopenharmony_ci src/GSM610/gsm.h 337b815c7f3Sopenharmony_ci src/GSM610/gsm610_priv.h 338b815c7f3Sopenharmony_ci src/GSM610/add.c 339b815c7f3Sopenharmony_ci src/GSM610/code.c 340b815c7f3Sopenharmony_ci src/GSM610/decode.c 341b815c7f3Sopenharmony_ci src/GSM610/gsm_create.c 342b815c7f3Sopenharmony_ci src/GSM610/gsm_decode.c 343b815c7f3Sopenharmony_ci src/GSM610/gsm_destroy.c 344b815c7f3Sopenharmony_ci src/GSM610/gsm_encode.c 345b815c7f3Sopenharmony_ci src/GSM610/gsm_option.c 346b815c7f3Sopenharmony_ci src/GSM610/long_term.c 347b815c7f3Sopenharmony_ci src/GSM610/lpc.c 348b815c7f3Sopenharmony_ci src/GSM610/preprocess.c 349b815c7f3Sopenharmony_ci src/GSM610/rpe.c 350b815c7f3Sopenharmony_ci src/GSM610/short_term.c 351b815c7f3Sopenharmony_ci src/GSM610/table.c 352b815c7f3Sopenharmony_ci src/G72x/g72x.h 353b815c7f3Sopenharmony_ci src/G72x/g72x_priv.h 354b815c7f3Sopenharmony_ci src/G72x/g721.c 355b815c7f3Sopenharmony_ci src/G72x/g723_16.c 356b815c7f3Sopenharmony_ci src/G72x/g723_24.c 357b815c7f3Sopenharmony_ci src/G72x/g723_40.c 358b815c7f3Sopenharmony_ci src/G72x/g72x.c 359b815c7f3Sopenharmony_ci src/ALAC/ALACAudioTypes.h 360b815c7f3Sopenharmony_ci src/ALAC/ALACBitUtilities.h 361b815c7f3Sopenharmony_ci src/ALAC/EndianPortable.h 362b815c7f3Sopenharmony_ci src/ALAC/aglib.h 363b815c7f3Sopenharmony_ci src/ALAC/dplib.h 364b815c7f3Sopenharmony_ci src/ALAC/matrixlib.h 365b815c7f3Sopenharmony_ci src/ALAC/alac_codec.h 366b815c7f3Sopenharmony_ci src/ALAC/shift.h 367b815c7f3Sopenharmony_ci src/ALAC/ALACBitUtilities.c 368b815c7f3Sopenharmony_ci src/ALAC/ag_dec.c 369b815c7f3Sopenharmony_ci src/ALAC/ag_enc.c 370b815c7f3Sopenharmony_ci src/ALAC/dp_dec.c 371b815c7f3Sopenharmony_ci src/ALAC/dp_enc.c 372b815c7f3Sopenharmony_ci src/ALAC/matrix_dec.c 373b815c7f3Sopenharmony_ci src/ALAC/matrix_enc.c 374b815c7f3Sopenharmony_ci src/ALAC/alac_decoder.c 375b815c7f3Sopenharmony_ci src/ALAC/alac_encoder.c 376b815c7f3Sopenharmony_ci ${sndfile_HDRS} 377b815c7f3Sopenharmony_ci ${CMAKE_CURRENT_BINARY_DIR}/src/config.h 378b815c7f3Sopenharmony_ci ) 379b815c7f3Sopenharmony_ci 380b815c7f3Sopenharmony_ciadd_library (SndFile::sndfile ALIAS sndfile) 381b815c7f3Sopenharmony_ci 382b815c7f3Sopenharmony_citarget_include_directories (sndfile 383b815c7f3Sopenharmony_ci PUBLIC 384b815c7f3Sopenharmony_ci $<BUILD_INTERFACE:${CMAKE_CURRENT_SOURCE_DIR}/include> 385b815c7f3Sopenharmony_ci $<BUILD_INTERFACE:${CMAKE_CURRENT_BINARY_DIR}/include> 386b815c7f3Sopenharmony_ci $<INSTALL_INTERFACE:${CMAKE_INSTALL_INCLUDEDIR}> 387b815c7f3Sopenharmony_ci PRIVATE 388b815c7f3Sopenharmony_ci src 389b815c7f3Sopenharmony_ci $<BUILD_INTERFACE:${CMAKE_CURRENT_BINARY_DIR}/src> 390b815c7f3Sopenharmony_ci ) 391b815c7f3Sopenharmony_citarget_link_libraries (sndfile 392b815c7f3Sopenharmony_ci PRIVATE 393b815c7f3Sopenharmony_ci $<$<BOOL:${LIBM_REQUIRED}>:m> 394b815c7f3Sopenharmony_ci $<$<BOOL:${HAVE_EXTERNAL_XIPH_LIBS}>:Vorbis::vorbisenc> 395b815c7f3Sopenharmony_ci $<$<BOOL:${HAVE_EXTERNAL_XIPH_LIBS}>:FLAC::FLAC> 396b815c7f3Sopenharmony_ci $<$<AND:$<BOOL:${ENABLE_EXPERIMENTAL}>,$<BOOL:${HAVE_EXTERNAL_XIPH_LIBS}>,$<BOOL:${HAVE_SPEEX}>>:Speex::Speex> 397b815c7f3Sopenharmony_ci $<$<BOOL:${HAVE_EXTERNAL_XIPH_LIBS}>:Opus::opus> 398b815c7f3Sopenharmony_ci $<$<BOOL:${HAVE_MPEG}>:MPG123::libmpg123> 399b815c7f3Sopenharmony_ci $<$<BOOL:${HAVE_MPEG}>:mp3lame::mp3lame> 400b815c7f3Sopenharmony_ci ) 401b815c7f3Sopenharmony_ciset_target_properties (sndfile PROPERTIES 402b815c7f3Sopenharmony_ci PUBLIC_HEADER "${sndfile_HDRS}" 403b815c7f3Sopenharmony_ci ) 404b815c7f3Sopenharmony_ci 405b815c7f3Sopenharmony_ciif (ENABLE_COMPATIBLE_LIBSNDFILE_NAME) 406b815c7f3Sopenharmony_ci if (MINGW OR CYGWIN) 407b815c7f3Sopenharmony_ci set_target_properties (sndfile PROPERTIES 408b815c7f3Sopenharmony_ci RUNTIME_OUTPUT_NAME "sndfile-1" 409b815c7f3Sopenharmony_ci ) 410b815c7f3Sopenharmony_ci else () 411b815c7f3Sopenharmony_ci set_target_properties (sndfile PROPERTIES 412b815c7f3Sopenharmony_ci RUNTIME_OUTPUT_NAME "libsndfile-1" 413b815c7f3Sopenharmony_ci ) 414b815c7f3Sopenharmony_ci endif () 415b815c7f3Sopenharmony_ciendif () 416b815c7f3Sopenharmony_ci 417b815c7f3Sopenharmony_ciif (BUILD_SHARED_LIBS) 418b815c7f3Sopenharmony_ci 419b815c7f3Sopenharmony_ci # 420b815c7f3Sopenharmony_ci # ABI version of library. 421b815c7f3Sopenharmony_ci # 422b815c7f3Sopenharmony_ci 423b815c7f3Sopenharmony_ci # 424b815c7f3Sopenharmony_ci # Read libtool version from `configure.ac` and set libsndfile ABI version: 425b815c7f3Sopenharmony_ci # 426b815c7f3Sopenharmony_ci # SNDFILE_ABI_VERSION_MAJOR 427b815c7f3Sopenharmony_ci # SNDFILE_ABI_VERSION_MINOR 428b815c7f3Sopenharmony_ci # SNDFILE_ABI_VERSION_PATCH 429b815c7f3Sopenharmony_ci # SNDFILE_ABI_VERSION 430b815c7f3Sopenharmony_ci # 431b815c7f3Sopenharmony_ci # and Mach-O current and compatibility versions: 432b815c7f3Sopenharmony_ci # 433b815c7f3Sopenharmony_ci # SNDFILE_MACHO_CURRENT_VERSION 434b815c7f3Sopenharmony_ci # SNDFILE_MACHO_COMPATIBILITY_VERSION 435b815c7f3Sopenharmony_ci # 436b815c7f3Sopenharmony_ci 437b815c7f3Sopenharmony_ci include (SetupABIVersions) 438b815c7f3Sopenharmony_ci 439b815c7f3Sopenharmony_ci setup_abi_versions() 440b815c7f3Sopenharmony_ci 441b815c7f3Sopenharmony_ci if (WIN32) 442b815c7f3Sopenharmony_ci set (VERSION_MAJOR ${CPACK_PACKAGE_VERSION_MAJOR}) 443b815c7f3Sopenharmony_ci set (GEN_TOOL cmake) 444b815c7f3Sopenharmony_ci 445b815c7f3Sopenharmony_ci set (WIN_RC_VERSION "${CPACK_PACKAGE_VERSION_MAJOR},${CPACK_PACKAGE_VERSION_MINOR},${CPACK_PACKAGE_VERSION_PATCH}") 446b815c7f3Sopenharmony_ci set (CLEAN_VERSION "${CPACK_PACKAGE_VERSION_MAJOR}.${CPACK_PACKAGE_VERSION_MINOR}.${CPACK_PACKAGE_VERSION_PATCH}") 447b815c7f3Sopenharmony_ci set (PACKAGE_VERSION ${CPACK_PACKAGE_VERSION}) 448b815c7f3Sopenharmony_ci 449b815c7f3Sopenharmony_ci configure_file (src/version-metadata.rc.in src/version-metadata.rc @ONLY) 450b815c7f3Sopenharmony_ci target_sources (sndfile PRIVATE ${PROJECT_BINARY_DIR}/src/version-metadata.rc) 451b815c7f3Sopenharmony_ci endif () 452b815c7f3Sopenharmony_ci 453b815c7f3Sopenharmony_ci 454b815c7f3Sopenharmony_ci set_target_properties (sndfile PROPERTIES 455b815c7f3Sopenharmony_ci SOVERSION ${SNDFILE_ABI_VERSION_MAJOR} 456b815c7f3Sopenharmony_ci VERSION ${SNDFILE_ABI_VERSION} 457b815c7f3Sopenharmony_ci ) 458b815c7f3Sopenharmony_ci 459b815c7f3Sopenharmony_ci if (APPLE) 460b815c7f3Sopenharmony_ci if (NOT (CMAKE_VERSION VERSION_LESS 3.17)) 461b815c7f3Sopenharmony_ci set_target_properties (sndfile PROPERTIES 462b815c7f3Sopenharmony_ci MACHO_CURRENT_VERSION ${SNDFILE_MACHO_CURRENT_VERSION} 463b815c7f3Sopenharmony_ci MACHO_COMPATIBILITY_VERSION ${SNDFILE_MACHO_COMPATIBILITY_VERSION} 464b815c7f3Sopenharmony_ci ) 465b815c7f3Sopenharmony_ci else () 466b815c7f3Sopenharmony_ci message (FATAL_ERROR "Apple platform requires cmake >= 3.17 to build dylib.") 467b815c7f3Sopenharmony_ci endif () 468b815c7f3Sopenharmony_ci endif () 469b815c7f3Sopenharmony_ci 470b815c7f3Sopenharmony_ci # Symbol files generation 471b815c7f3Sopenharmony_ci 472b815c7f3Sopenharmony_ci if (WIN32) 473b815c7f3Sopenharmony_ci set (SYMBOL_FILENAME "sndfile.def") 474b815c7f3Sopenharmony_ci set (SYMBOL_OS "win32") 475b815c7f3Sopenharmony_ci elseif ((CMAKE_SYSTEM_NAME MATCHES "Darwin") OR (CMAKE_SYSTEM_NAME MATCHES "Rhapsody")) 476b815c7f3Sopenharmony_ci set (SYMBOL_FILENAME "Symbols.darwin") 477b815c7f3Sopenharmony_ci set (SYMBOL_OS "darwin") 478b815c7f3Sopenharmony_ci elseif (CMAKE_SYSTEM_NAME MATCHES "OS2") 479b815c7f3Sopenharmony_ci set (SYMBOL_FILENAME "Symbols.os2") 480b815c7f3Sopenharmony_ci set (SYMBOL_OS "os2") 481b815c7f3Sopenharmony_ci elseif (UNIX) 482b815c7f3Sopenharmony_ci set (SYMBOL_FILENAME "Symbols.gnu-binutils") 483b815c7f3Sopenharmony_ci set (SYMBOL_OS "linux") 484b815c7f3Sopenharmony_ci endif () 485b815c7f3Sopenharmony_ci 486b815c7f3Sopenharmony_ci if (DEFINED SYMBOL_OS) 487b815c7f3Sopenharmony_ci add_custom_command ( 488b815c7f3Sopenharmony_ci OUTPUT ${CMAKE_CURRENT_BINARY_DIR}/src/${SYMBOL_FILENAME} 489b815c7f3Sopenharmony_ci COMMAND ${PYTHON_EXECUTABLE} ${CMAKE_CURRENT_SOURCE_DIR}/src/create_symbols_file.py ${SYMBOL_OS} ${SNDFILE_ABI_VERSION} > ${CMAKE_CURRENT_BINARY_DIR}/src/${SYMBOL_FILENAME} 490b815c7f3Sopenharmony_ci COMMENT "Generating ${SYMBOL_FILENAME}..." 491b815c7f3Sopenharmony_ci ) 492b815c7f3Sopenharmony_ci 493b815c7f3Sopenharmony_ci add_custom_target (GENFILES DEPENDS ${CMAKE_CURRENT_BINARY_DIR}/src/${SYMBOL_FILENAME}) 494b815c7f3Sopenharmony_ci if (SYMBOL_OS MATCHES "win32") 495b815c7f3Sopenharmony_ci target_sources (sndfile 496b815c7f3Sopenharmony_ci PRIVATE 497b815c7f3Sopenharmony_ci ${CMAKE_CURRENT_BINARY_DIR}/src/${SYMBOL_FILENAME} 498b815c7f3Sopenharmony_ci ) 499b815c7f3Sopenharmony_ci elseif (SYMBOL_OS MATCHES "darwin") 500b815c7f3Sopenharmony_ci add_dependencies (sndfile GENFILES) 501b815c7f3Sopenharmony_ci if (CMAKE_VERSION VERSION_LESS 3.13) 502b815c7f3Sopenharmony_ci set_property (TARGET sndfile APPEND_STRING PROPERTY 503b815c7f3Sopenharmony_ci LINK_FLAGS "-Wl,-exported_symbols_list -Wl,${CMAKE_CURRENT_BINARY_DIR}/src/${SYMBOL_FILENAME}" 504b815c7f3Sopenharmony_ci ) 505b815c7f3Sopenharmony_ci else () 506b815c7f3Sopenharmony_ci target_link_options (sndfile PRIVATE "LINKER:-exported_symbols_list,${CMAKE_CURRENT_BINARY_DIR}/src/${SYMBOL_FILENAME}") 507b815c7f3Sopenharmony_ci endif() 508b815c7f3Sopenharmony_ci elseif (SYMBOL_OS MATCHES "os") 509b815c7f3Sopenharmony_ci add_dependencies (sndfile GENFILES) 510b815c7f3Sopenharmony_ci if (CMAKE_VERSION VERSION_LESS 3.13) 511b815c7f3Sopenharmony_ci set_property (TARGET sndfile APPEND_STRING PROPERTY 512b815c7f3Sopenharmony_ci LINK_FLAGS "-Wl,-export-symbols ${CMAKE_CURRENT_BINARY_DIR}/src/${SYMBOL_FILENAME}" 513b815c7f3Sopenharmony_ci ) 514b815c7f3Sopenharmony_ci else () 515b815c7f3Sopenharmony_ci target_link_options (sndfile PRIVATE "LINKER:-export-symbols ${CMAKE_CURRENT_BINARY_DIR}/src/${SYMBOL_FILENAME}") 516b815c7f3Sopenharmony_ci endif() 517b815c7f3Sopenharmony_ci elseif (UNIX) 518b815c7f3Sopenharmony_ci add_dependencies (sndfile GENFILES) 519b815c7f3Sopenharmony_ci if (CMAKE_VERSION VERSION_LESS 3.13) 520b815c7f3Sopenharmony_ci set_property (TARGET sndfile APPEND_STRING PROPERTY 521b815c7f3Sopenharmony_ci LINK_FLAGS "-Wl,--version-script,${CMAKE_CURRENT_BINARY_DIR}/src/${SYMBOL_FILENAME}" 522b815c7f3Sopenharmony_ci ) 523b815c7f3Sopenharmony_ci else () 524b815c7f3Sopenharmony_ci target_link_options (sndfile PRIVATE "LINKER:--version-script,${CMAKE_CURRENT_BINARY_DIR}/src/${SYMBOL_FILENAME}") 525b815c7f3Sopenharmony_ci endif() 526b815c7f3Sopenharmony_ci endif() 527b815c7f3Sopenharmony_ci endif() 528b815c7f3Sopenharmony_ci 529b815c7f3Sopenharmony_ciendif () 530b815c7f3Sopenharmony_ci 531b815c7f3Sopenharmony_ci# 532b815c7f3Sopenharmony_ci# Programs 533b815c7f3Sopenharmony_ci# 534b815c7f3Sopenharmony_ci 535b815c7f3Sopenharmony_ciif (BUILD_PROGRAMS) 536b815c7f3Sopenharmony_ci 537b815c7f3Sopenharmony_ci# sndfile-info 538b815c7f3Sopenharmony_ci 539b815c7f3Sopenharmony_ci add_executable (sndfile-info 540b815c7f3Sopenharmony_ci programs/sndfile-info.c 541b815c7f3Sopenharmony_ci programs/common.c 542b815c7f3Sopenharmony_ci programs/common.h 543b815c7f3Sopenharmony_ci ) 544b815c7f3Sopenharmony_ci target_link_libraries (sndfile-info 545b815c7f3Sopenharmony_ci PRIVATE 546b815c7f3Sopenharmony_ci sndfile 547b815c7f3Sopenharmony_ci $<$<BOOL:${LIBM_REQUIRED}>:m> 548b815c7f3Sopenharmony_ci ) 549b815c7f3Sopenharmony_ci 550b815c7f3Sopenharmony_ci# sndfile-play 551b815c7f3Sopenharmony_ci 552b815c7f3Sopenharmony_ci add_executable (sndfile-play 553b815c7f3Sopenharmony_ci $<$<NOT:$<BOOL:${BEOS}>>:programs/sndfile-play.c> 554b815c7f3Sopenharmony_ci $<$<NOT:$<BOOL:${BEOS}>>:programs/common.c> 555b815c7f3Sopenharmony_ci $<$<NOT:$<BOOL:${BEOS}>>:programs/sndfile-play.c> 556b815c7f3Sopenharmony_ci $<$<BOOL:${BEOS}>:programs/sndfile-play-beos.cpp> 557b815c7f3Sopenharmony_ci ) 558b815c7f3Sopenharmony_ci target_include_directories (sndfile-play 559b815c7f3Sopenharmony_ci PRIVATE 560b815c7f3Sopenharmony_ci src 561b815c7f3Sopenharmony_ci ${CMAKE_CURRENT_BINARY_DIR}/src 562b815c7f3Sopenharmony_ci ) 563b815c7f3Sopenharmony_ci target_link_libraries (sndfile-play PRIVATE $<$<BOOL:${LIBM_REQUIRED}>:m>) 564b815c7f3Sopenharmony_ci target_link_libraries (sndfile-play PRIVATE sndfile) 565b815c7f3Sopenharmony_ci if (WIN32) 566b815c7f3Sopenharmony_ci target_link_libraries(sndfile-play PRIVATE winmm) 567b815c7f3Sopenharmony_ci # Maybe ALSA & Sndio are present in BeOS. They are not required 568b815c7f3Sopenharmony_ci # so skip them anyway. 569b815c7f3Sopenharmony_ci elseif ((NOT BEOS) AND ALSA_FOUND) 570b815c7f3Sopenharmony_ci target_include_directories (sndfile-play PRIVATE ${ALSA_INCLUDE_DIRS}) 571b815c7f3Sopenharmony_ci target_link_libraries (sndfile-play PRIVATE ${ALSA_LIBRARIES}) 572b815c7f3Sopenharmony_ci elseif (CMAKE_SYSTEM_NAME STREQUAL "OpenBSD") 573b815c7f3Sopenharmony_ci target_link_libraries (sndfile-play PRIVATE Sndio::Sndio) 574b815c7f3Sopenharmony_ci endif () 575b815c7f3Sopenharmony_ci 576b815c7f3Sopenharmony_ci# sndfile-convert 577b815c7f3Sopenharmony_ci 578b815c7f3Sopenharmony_ci add_executable (sndfile-convert 579b815c7f3Sopenharmony_ci programs/sndfile-convert.c 580b815c7f3Sopenharmony_ci programs/common.c 581b815c7f3Sopenharmony_ci programs/common.h 582b815c7f3Sopenharmony_ci ) 583b815c7f3Sopenharmony_ci target_link_libraries (sndfile-convert PRIVATE sndfile $<$<BOOL:${LIBM_REQUIRED}>:m>) 584b815c7f3Sopenharmony_ci 585b815c7f3Sopenharmony_ci# sndfile-cmp 586b815c7f3Sopenharmony_ci 587b815c7f3Sopenharmony_ci add_executable (sndfile-cmp 588b815c7f3Sopenharmony_ci programs/sndfile-cmp.c 589b815c7f3Sopenharmony_ci programs/common.c 590b815c7f3Sopenharmony_ci programs/common.h 591b815c7f3Sopenharmony_ci ) 592b815c7f3Sopenharmony_ci target_include_directories (sndfile-cmp 593b815c7f3Sopenharmony_ci PUBLIC 594b815c7f3Sopenharmony_ci src 595b815c7f3Sopenharmony_ci ${CMAKE_CURRENT_BINARY_DIR}/src 596b815c7f3Sopenharmony_ci ${CMAKE_CURRENT_BINARY_DIR}/tests 597b815c7f3Sopenharmony_ci ) 598b815c7f3Sopenharmony_ci target_link_libraries (sndfile-cmp PRIVATE sndfile $<$<BOOL:${LIBM_REQUIRED}>:m>) 599b815c7f3Sopenharmony_ci 600b815c7f3Sopenharmony_ci# sndfile-metadata-set 601b815c7f3Sopenharmony_ci 602b815c7f3Sopenharmony_ci add_executable (sndfile-metadata-set 603b815c7f3Sopenharmony_ci programs/sndfile-metadata-set.c 604b815c7f3Sopenharmony_ci programs/common.c 605b815c7f3Sopenharmony_ci programs/common.h 606b815c7f3Sopenharmony_ci ) 607b815c7f3Sopenharmony_ci target_include_directories (sndfile-metadata-set 608b815c7f3Sopenharmony_ci PUBLIC 609b815c7f3Sopenharmony_ci src 610b815c7f3Sopenharmony_ci ${CMAKE_CURRENT_BINARY_DIR}/src 611b815c7f3Sopenharmony_ci ${CMAKE_CURRENT_BINARY_DIR}/tests 612b815c7f3Sopenharmony_ci ) 613b815c7f3Sopenharmony_ci target_link_libraries (sndfile-metadata-set PRIVATE sndfile $<$<BOOL:${LIBM_REQUIRED}>:m>) 614b815c7f3Sopenharmony_ci 615b815c7f3Sopenharmony_ci# sndfile-metadata-get 616b815c7f3Sopenharmony_ci 617b815c7f3Sopenharmony_ci add_executable (sndfile-metadata-get 618b815c7f3Sopenharmony_ci programs/sndfile-metadata-get.c 619b815c7f3Sopenharmony_ci programs/common.c 620b815c7f3Sopenharmony_ci programs/common.h 621b815c7f3Sopenharmony_ci ) 622b815c7f3Sopenharmony_ci target_include_directories (sndfile-metadata-get 623b815c7f3Sopenharmony_ci PUBLIC 624b815c7f3Sopenharmony_ci src 625b815c7f3Sopenharmony_ci ${CMAKE_CURRENT_BINARY_DIR}/src 626b815c7f3Sopenharmony_ci ${CMAKE_CURRENT_BINARY_DIR}/tests 627b815c7f3Sopenharmony_ci ) 628b815c7f3Sopenharmony_ci target_link_libraries (sndfile-metadata-get PRIVATE sndfile $<$<BOOL:${LIBM_REQUIRED}>:m>) 629b815c7f3Sopenharmony_ci 630b815c7f3Sopenharmony_ci# sndfile-interleave 631b815c7f3Sopenharmony_ci 632b815c7f3Sopenharmony_ci add_executable (sndfile-interleave 633b815c7f3Sopenharmony_ci programs/sndfile-interleave.c 634b815c7f3Sopenharmony_ci programs/common.c 635b815c7f3Sopenharmony_ci programs/common.h 636b815c7f3Sopenharmony_ci ) 637b815c7f3Sopenharmony_ci target_link_libraries (sndfile-interleave PRIVATE sndfile $<$<BOOL:${LIBM_REQUIRED}>:m>) 638b815c7f3Sopenharmony_ci 639b815c7f3Sopenharmony_ci# sndfile-deinterleave 640b815c7f3Sopenharmony_ci 641b815c7f3Sopenharmony_ci add_executable (sndfile-deinterleave 642b815c7f3Sopenharmony_ci programs/sndfile-deinterleave.c 643b815c7f3Sopenharmony_ci programs/common.c 644b815c7f3Sopenharmony_ci programs/common.h 645b815c7f3Sopenharmony_ci ) 646b815c7f3Sopenharmony_ci target_link_libraries (sndfile-deinterleave PRIVATE sndfile $<$<BOOL:${LIBM_REQUIRED}>:m>) 647b815c7f3Sopenharmony_ci 648b815c7f3Sopenharmony_ci# sndfile-concat 649b815c7f3Sopenharmony_ci 650b815c7f3Sopenharmony_ci add_executable (sndfile-concat 651b815c7f3Sopenharmony_ci programs/sndfile-concat.c 652b815c7f3Sopenharmony_ci programs/common.c 653b815c7f3Sopenharmony_ci programs/common.h 654b815c7f3Sopenharmony_ci ) 655b815c7f3Sopenharmony_ci target_link_libraries (sndfile-concat PRIVATE sndfile $<$<BOOL:${LIBM_REQUIRED}>:m>) 656b815c7f3Sopenharmony_ci 657b815c7f3Sopenharmony_ci# sndfile-salvage 658b815c7f3Sopenharmony_ci 659b815c7f3Sopenharmony_ci add_executable (sndfile-salvage 660b815c7f3Sopenharmony_ci programs/sndfile-salvage.c 661b815c7f3Sopenharmony_ci programs/common.c 662b815c7f3Sopenharmony_ci programs/common.h 663b815c7f3Sopenharmony_ci ) 664b815c7f3Sopenharmony_ci target_include_directories (sndfile-salvage 665b815c7f3Sopenharmony_ci PUBLIC 666b815c7f3Sopenharmony_ci src 667b815c7f3Sopenharmony_ci ${CMAKE_CURRENT_BINARY_DIR}/src 668b815c7f3Sopenharmony_ci ${CMAKE_CURRENT_BINARY_DIR}/tests 669b815c7f3Sopenharmony_ci ) 670b815c7f3Sopenharmony_ci target_link_libraries (sndfile-salvage PRIVATE sndfile $<$<BOOL:${LIBM_REQUIRED}>:m>) 671b815c7f3Sopenharmony_ci 672b815c7f3Sopenharmony_ci set (SNDFILE_PROGRAM_TARGETS 673b815c7f3Sopenharmony_ci sndfile-info 674b815c7f3Sopenharmony_ci sndfile-play 675b815c7f3Sopenharmony_ci sndfile-convert 676b815c7f3Sopenharmony_ci sndfile-cmp 677b815c7f3Sopenharmony_ci sndfile-metadata-set 678b815c7f3Sopenharmony_ci sndfile-metadata-get 679b815c7f3Sopenharmony_ci sndfile-interleave 680b815c7f3Sopenharmony_ci sndfile-deinterleave 681b815c7f3Sopenharmony_ci sndfile-concat 682b815c7f3Sopenharmony_ci sndfile-salvage 683b815c7f3Sopenharmony_ci ) 684b815c7f3Sopenharmony_ci 685b815c7f3Sopenharmony_ci set_target_properties(${SNDFILE_PROGRAM_TARGETS} PROPERTIES FOLDER Programs) 686b815c7f3Sopenharmony_ci 687b815c7f3Sopenharmony_ciendif () 688b815c7f3Sopenharmony_ci 689b815c7f3Sopenharmony_ci# 690b815c7f3Sopenharmony_ci# Examples 691b815c7f3Sopenharmony_ci# 692b815c7f3Sopenharmony_ci 693b815c7f3Sopenharmony_ciif (BUILD_EXAMPLES) 694b815c7f3Sopenharmony_ci 695b815c7f3Sopenharmony_ci# sndfile-to-text 696b815c7f3Sopenharmony_ci 697b815c7f3Sopenharmony_ci add_executable (sndfile-to-text examples/sndfile-to-text.c) 698b815c7f3Sopenharmony_ci target_link_libraries (sndfile-to-text PRIVATE sndfile) 699b815c7f3Sopenharmony_ci 700b815c7f3Sopenharmony_ci# sndfile-loopify 701b815c7f3Sopenharmony_ci 702b815c7f3Sopenharmony_ci add_executable (sndfile-loopify examples/sndfile-loopify.c) 703b815c7f3Sopenharmony_ci target_link_libraries (sndfile-loopify PRIVATE sndfile) 704b815c7f3Sopenharmony_ci 705b815c7f3Sopenharmony_ci# make_sine 706b815c7f3Sopenharmony_ci 707b815c7f3Sopenharmony_ci add_executable (make_sine examples/make_sine.c) 708b815c7f3Sopenharmony_ci target_link_libraries (make_sine 709b815c7f3Sopenharmony_ci PRIVATE 710b815c7f3Sopenharmony_ci sndfile 711b815c7f3Sopenharmony_ci $<$<BOOL:${LIBM_REQUIRED}>:m> 712b815c7f3Sopenharmony_ci ) 713b815c7f3Sopenharmony_ci 714b815c7f3Sopenharmony_ci# sfprocess 715b815c7f3Sopenharmony_ci 716b815c7f3Sopenharmony_ci add_executable (sfprocess examples/sfprocess.c) 717b815c7f3Sopenharmony_ci target_link_libraries (sfprocess 718b815c7f3Sopenharmony_ci PRIVATE 719b815c7f3Sopenharmony_ci sndfile 720b815c7f3Sopenharmony_ci $<$<BOOL:${LIBM_REQUIRED}>:m> 721b815c7f3Sopenharmony_ci ) 722b815c7f3Sopenharmony_ci 723b815c7f3Sopenharmony_ci# list_formats 724b815c7f3Sopenharmony_ci 725b815c7f3Sopenharmony_ci add_executable (list_formats examples/list_formats.c) 726b815c7f3Sopenharmony_ci target_link_libraries (list_formats 727b815c7f3Sopenharmony_ci PRIVATE 728b815c7f3Sopenharmony_ci sndfile 729b815c7f3Sopenharmony_ci $<$<BOOL:${LIBM_REQUIRED}>:m> 730b815c7f3Sopenharmony_ci ) 731b815c7f3Sopenharmony_ci 732b815c7f3Sopenharmony_ci# generate 733b815c7f3Sopenharmony_ci 734b815c7f3Sopenharmony_ci add_executable (generate examples/generate.c) 735b815c7f3Sopenharmony_ci target_link_libraries (generate PRIVATE sndfile) 736b815c7f3Sopenharmony_ci 737b815c7f3Sopenharmony_ci# sndfilehandle 738b815c7f3Sopenharmony_ci 739b815c7f3Sopenharmony_ci add_executable (sndfilehandle examples/sndfilehandle.cc) 740b815c7f3Sopenharmony_ci target_link_libraries (sndfilehandle PUBLIC sndfile) 741b815c7f3Sopenharmony_ci 742b815c7f3Sopenharmony_ci set (SNDFILE_EXAMPLE_TARGETS 743b815c7f3Sopenharmony_ci sndfile-to-text 744b815c7f3Sopenharmony_ci sndfile-loopify 745b815c7f3Sopenharmony_ci make_sine 746b815c7f3Sopenharmony_ci sfprocess 747b815c7f3Sopenharmony_ci list_formats 748b815c7f3Sopenharmony_ci generate 749b815c7f3Sopenharmony_ci sndfilehandle 750b815c7f3Sopenharmony_ci ) 751b815c7f3Sopenharmony_ci 752b815c7f3Sopenharmony_ci set_target_properties(${SNDFILE_EXAMPLE_TARGETS} PROPERTIES FOLDER Examples) 753b815c7f3Sopenharmony_ci 754b815c7f3Sopenharmony_ci 755b815c7f3Sopenharmony_ciendif () 756b815c7f3Sopenharmony_ci 757b815c7f3Sopenharmony_ci# 758b815c7f3Sopenharmony_ci# sndfile-regtest 759b815c7f3Sopenharmony_ci# 760b815c7f3Sopenharmony_ci 761b815c7f3Sopenharmony_ciif (BUILD_REGTEST) 762b815c7f3Sopenharmony_ci 763b815c7f3Sopenharmony_ci add_executable (sndfile-regtest 764b815c7f3Sopenharmony_ci regtest/sndfile-regtest.c 765b815c7f3Sopenharmony_ci regtest/database.c 766b815c7f3Sopenharmony_ci regtest/checksum.c 767b815c7f3Sopenharmony_ci ) 768b815c7f3Sopenharmony_ci target_include_directories (sndfile-regtest 769b815c7f3Sopenharmony_ci PUBLIC 770b815c7f3Sopenharmony_ci src 771b815c7f3Sopenharmony_ci ${CMAKE_CURRENT_BINARY_DIR}/src 772b815c7f3Sopenharmony_ci ${CMAKE_CURRENT_BINARY_DIR}/tests 773b815c7f3Sopenharmony_ci ) 774b815c7f3Sopenharmony_ci target_link_libraries(sndfile-regtest 775b815c7f3Sopenharmony_ci PRIVATE 776b815c7f3Sopenharmony_ci sndfile 777b815c7f3Sopenharmony_ci SQLite::SQLite3 778b815c7f3Sopenharmony_ci $<$<BOOL:${LIBM_REQUIRED}>:m> 779b815c7f3Sopenharmony_ci ) 780b815c7f3Sopenharmony_ci 781b815c7f3Sopenharmony_ciendif () 782b815c7f3Sopenharmony_ci 783b815c7f3Sopenharmony_ci# 784b815c7f3Sopenharmony_ci# Installation 785b815c7f3Sopenharmony_ci# 786b815c7f3Sopenharmony_ci 787b815c7f3Sopenharmony_ciif (ENABLE_PACKAGE_CONFIG) 788b815c7f3Sopenharmony_ci 789b815c7f3Sopenharmony_ci if (WIN32 AND (NOT MINGW) AND (NOT CYGWIN)) 790b815c7f3Sopenharmony_ci set (CMAKE_INSTALL_PACKAGEDIR cmake) 791b815c7f3Sopenharmony_ci else () 792b815c7f3Sopenharmony_ci set (CMAKE_INSTALL_PACKAGEDIR ${CMAKE_INSTALL_LIBDIR}/cmake/SndFile) 793b815c7f3Sopenharmony_ci endif() 794b815c7f3Sopenharmony_ci 795b815c7f3Sopenharmony_ci install (TARGETS ${SNDFILE_PROGRAM_TARGETS} 796b815c7f3Sopenharmony_ci RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR} 797b815c7f3Sopenharmony_ci ) 798b815c7f3Sopenharmony_ci 799b815c7f3Sopenharmony_ci install (TARGETS sndfile 800b815c7f3Sopenharmony_ci EXPORT SndFileTargets 801b815c7f3Sopenharmony_ci RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR} 802b815c7f3Sopenharmony_ci ARCHIVE DESTINATION ${CMAKE_INSTALL_LIBDIR} 803b815c7f3Sopenharmony_ci LIBRARY DESTINATION ${CMAKE_INSTALL_LIBDIR} 804b815c7f3Sopenharmony_ci PUBLIC_HEADER DESTINATION ${CMAKE_INSTALL_INCLUDEDIR} 805b815c7f3Sopenharmony_ci ) 806b815c7f3Sopenharmony_ci 807b815c7f3Sopenharmony_ci export (EXPORT SndFileTargets NAMESPACE SndFile:: FILE ${PROJECT_BINARY_DIR}/SndFileTargets.cmake) 808b815c7f3Sopenharmony_ci 809b815c7f3Sopenharmony_ci include (CMakePackageConfigHelpers) 810b815c7f3Sopenharmony_ci 811b815c7f3Sopenharmony_ci if (ENABLE_EXTERNAL_LIBS) 812b815c7f3Sopenharmony_ci set (SndFile_WITH_EXTERNAL_LIBS 1) 813b815c7f3Sopenharmony_ci else () 814b815c7f3Sopenharmony_ci set (SndFile_WITH_EXTERNAL_LIBS 0) 815b815c7f3Sopenharmony_ci endif () 816b815c7f3Sopenharmony_ci 817b815c7f3Sopenharmony_ci if(ENABLE_MPEG) 818b815c7f3Sopenharmony_ci set (SndFile_WITH_MPEG 1) 819b815c7f3Sopenharmony_ci else () 820b815c7f3Sopenharmony_ci set (SndFile_WITH_MPEG 0) 821b815c7f3Sopenharmony_ci endif () 822b815c7f3Sopenharmony_ci 823b815c7f3Sopenharmony_ci set (INCLUDE_INSTALL_DIR ${CMAKE_INSTALL_INCLUDEDIR}) 824b815c7f3Sopenharmony_ci configure_package_config_file(cmake/SndFileConfig.cmake.in SndFileConfig.cmake 825b815c7f3Sopenharmony_ci INSTALL_DESTINATION ${PROJECT_BINARY_DIR} 826b815c7f3Sopenharmony_ci INSTALL_PREFIX ${PROJECT_BINARY_DIR} 827b815c7f3Sopenharmony_ci PATH_VARS INCLUDE_INSTALL_DIR 828b815c7f3Sopenharmony_ci ) 829b815c7f3Sopenharmony_ci configure_package_config_file(cmake/SndFileConfig.cmake.in SndFileConfig2.cmake 830b815c7f3Sopenharmony_ci INSTALL_DESTINATION ${CMAKE_INSTALL_PACKAGEDIR} 831b815c7f3Sopenharmony_ci PATH_VARS INCLUDE_INSTALL_DIR 832b815c7f3Sopenharmony_ci ) 833b815c7f3Sopenharmony_ci write_basic_package_version_file (SndFileConfigVersion.cmake COMPATIBILITY SameMajorVersion) 834b815c7f3Sopenharmony_ci 835b815c7f3Sopenharmony_ci install(EXPORT SndFileTargets 836b815c7f3Sopenharmony_ci NAMESPACE SndFile:: 837b815c7f3Sopenharmony_ci DESTINATION ${CMAKE_INSTALL_PACKAGEDIR} 838b815c7f3Sopenharmony_ci ) 839b815c7f3Sopenharmony_ci install( 840b815c7f3Sopenharmony_ci FILES ${CMAKE_CURRENT_BINARY_DIR}/SndFileConfig2.cmake 841b815c7f3Sopenharmony_ci RENAME SndFileConfig.cmake 842b815c7f3Sopenharmony_ci DESTINATION ${CMAKE_INSTALL_PACKAGEDIR} 843b815c7f3Sopenharmony_ci ) 844b815c7f3Sopenharmony_ci install( 845b815c7f3Sopenharmony_ci FILES 846b815c7f3Sopenharmony_ci ${CMAKE_CURRENT_BINARY_DIR}/SndFileConfigVersion.cmake 847b815c7f3Sopenharmony_ci DESTINATION ${CMAKE_INSTALL_PACKAGEDIR} 848b815c7f3Sopenharmony_ci ) 849b815c7f3Sopenharmony_ci 850b815c7f3Sopenharmony_cielse () 851b815c7f3Sopenharmony_ci 852b815c7f3Sopenharmony_ci install (TARGETS sndfile ${sdnfile_PROGRAMS} 853b815c7f3Sopenharmony_ci RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR} 854b815c7f3Sopenharmony_ci ARCHIVE DESTINATION ${CMAKE_INSTALL_LIBDIR} 855b815c7f3Sopenharmony_ci LIBRARY DESTINATION ${CMAKE_INSTALL_LIBDIR} 856b815c7f3Sopenharmony_ci PUBLIC_HEADER DESTINATION ${CMAKE_INSTALL_INCLUDEDIR}) 857b815c7f3Sopenharmony_ci 858b815c7f3Sopenharmony_ciendif () 859b815c7f3Sopenharmony_ci 860b815c7f3Sopenharmony_ciif (INSTALL_MANPAGES) 861b815c7f3Sopenharmony_ci 862b815c7f3Sopenharmony_ci set (man_MANS 863b815c7f3Sopenharmony_ci man/sndfile-info.1 864b815c7f3Sopenharmony_ci man/sndfile-play.1 865b815c7f3Sopenharmony_ci man/sndfile-convert.1 866b815c7f3Sopenharmony_ci man/sndfile-cmp.1 867b815c7f3Sopenharmony_ci man/sndfile-metadata-get.1 868b815c7f3Sopenharmony_ci man/sndfile-concat.1 869b815c7f3Sopenharmony_ci man/sndfile-interleave.1 870b815c7f3Sopenharmony_ci man/sndfile-salvage.1 871b815c7f3Sopenharmony_ci ) 872b815c7f3Sopenharmony_ci install (FILES ${man_MANS} DESTINATION ${CMAKE_INSTALL_MANDIR}/man1) 873b815c7f3Sopenharmony_ci install (FILES man/sndfile-metadata-get.1 DESTINATION ${CMAKE_INSTALL_MANDIR}/man1 RENAME sndfile-metadata-set.1) 874b815c7f3Sopenharmony_ci install (FILES man/sndfile-interleave.1 DESTINATION ${CMAKE_INSTALL_MANDIR}/man1 RENAME sndfile-deinterleave.1) 875b815c7f3Sopenharmony_ciendif () 876b815c7f3Sopenharmony_ci 877b815c7f3Sopenharmony_ciif (ENABLE_BOW_DOCS) 878b815c7f3Sopenharmony_ci set (HTML_BGCOLOUR "white") 879b815c7f3Sopenharmony_ci set (HTML_FGCOLOUR "black") 880b815c7f3Sopenharmony_cielse () 881b815c7f3Sopenharmony_ci set (HTML_BGCOLOUR "black") 882b815c7f3Sopenharmony_ci set (HTML_FGCOLOUR "white") 883b815c7f3Sopenharmony_ciendif () 884b815c7f3Sopenharmony_ciset (dist_doc_DATA 885b815c7f3Sopenharmony_ci docs/index.md 886b815c7f3Sopenharmony_ci docs/libsndfile.jpg 887b815c7f3Sopenharmony_ci docs/libsndfile.css 888b815c7f3Sopenharmony_ci docs/print.css 889b815c7f3Sopenharmony_ci docs/api.md 890b815c7f3Sopenharmony_ci docs/command.md 891b815c7f3Sopenharmony_ci docs/bugs.md 892b815c7f3Sopenharmony_ci docs/formats.md 893b815c7f3Sopenharmony_ci docs/sndfile_info.md 894b815c7f3Sopenharmony_ci docs/new_file_type_howto.md 895b815c7f3Sopenharmony_ci docs/win32.md 896b815c7f3Sopenharmony_ci docs/FAQ.md 897b815c7f3Sopenharmony_ci docs/lists.md 898b815c7f3Sopenharmony_ci docs/embedded_files.md 899b815c7f3Sopenharmony_ci docs/octave.md 900b815c7f3Sopenharmony_ci docs/tutorial.md 901b815c7f3Sopenharmony_ci ) 902b815c7f3Sopenharmony_ciinstall (FILES ${dist_doc_DATA} DESTINATION ${CMAKE_INSTALL_DOCDIR}) 903b815c7f3Sopenharmony_ci 904b815c7f3Sopenharmony_ciif (INSTALL_PKGCONFIG_MODULE) 905b815c7f3Sopenharmony_ci install (FILES ${CMAKE_CURRENT_BINARY_DIR}/sndfile.pc DESTINATION ${CMAKE_INSTALL_LIBDIR}/pkgconfig) 906b815c7f3Sopenharmony_ciendif () 907b815c7f3Sopenharmony_ci 908b815c7f3Sopenharmony_ci# 909b815c7f3Sopenharmony_ci# Testing 910b815c7f3Sopenharmony_ci# 911b815c7f3Sopenharmony_ci 912b815c7f3Sopenharmony_ciif (BUILD_TESTING) 913b815c7f3Sopenharmony_ci 914b815c7f3Sopenharmony_ci enable_testing () 915b815c7f3Sopenharmony_ci 916b815c7f3Sopenharmony_ci include (CMakeAutoGen) 917b815c7f3Sopenharmony_ci 918b815c7f3Sopenharmony_ci # generate tests sources from autogen templates 919b815c7f3Sopenharmony_ci lsf_autogen (tests benchmark c) 920b815c7f3Sopenharmony_ci lsf_autogen (tests floating_point_test c) 921b815c7f3Sopenharmony_ci lsf_autogen (tests header_test c) 922b815c7f3Sopenharmony_ci lsf_autogen (tests pcm_test c) 923b815c7f3Sopenharmony_ci lsf_autogen (tests pipe_test c) 924b815c7f3Sopenharmony_ci lsf_autogen (tests rdwr_test c) 925b815c7f3Sopenharmony_ci lsf_autogen (tests scale_clip_test c) 926b815c7f3Sopenharmony_ci lsf_autogen (tests utils c h) 927b815c7f3Sopenharmony_ci lsf_autogen (tests write_read_test c) 928b815c7f3Sopenharmony_ci lsf_autogen (src test_endswap c) 929b815c7f3Sopenharmony_ci 930b815c7f3Sopenharmony_ci # utils static library 931b815c7f3Sopenharmony_ci add_library(test_utils STATIC tests/utils.c) 932b815c7f3Sopenharmony_ci target_include_directories (test_utils 933b815c7f3Sopenharmony_ci PUBLIC 934b815c7f3Sopenharmony_ci src 935b815c7f3Sopenharmony_ci ${CMAKE_CURRENT_BINARY_DIR}/src 936b815c7f3Sopenharmony_ci ${CMAKE_CURRENT_BINARY_DIR}/tests 937b815c7f3Sopenharmony_ci ) 938b815c7f3Sopenharmony_ci target_link_libraries(test_utils PRIVATE sndfile) 939b815c7f3Sopenharmony_ci 940b815c7f3Sopenharmony_ci ### test_main 941b815c7f3Sopenharmony_ci 942b815c7f3Sopenharmony_ci add_executable (test_main 943b815c7f3Sopenharmony_ci src/test_main.c 944b815c7f3Sopenharmony_ci src/test_main.h 945b815c7f3Sopenharmony_ci src/test_conversions.c 946b815c7f3Sopenharmony_ci src/test_float.c 947b815c7f3Sopenharmony_ci src/test_endswap.c 948b815c7f3Sopenharmony_ci src/test_audio_detect.c 949b815c7f3Sopenharmony_ci src/test_log_printf.c 950b815c7f3Sopenharmony_ci src/test_file_io.c 951b815c7f3Sopenharmony_ci src/test_ima_oki_adpcm.c 952b815c7f3Sopenharmony_ci src/test_strncpy_crlf.c 953b815c7f3Sopenharmony_ci src/test_broadcast_var.c 954b815c7f3Sopenharmony_ci src/test_cart_var.c 955b815c7f3Sopenharmony_ci src/test_binheader_writef.c 956b815c7f3Sopenharmony_ci src/test_nms_adpcm.c 957b815c7f3Sopenharmony_ci ) 958b815c7f3Sopenharmony_ci target_include_directories (test_main 959b815c7f3Sopenharmony_ci PUBLIC 960b815c7f3Sopenharmony_ci src 961b815c7f3Sopenharmony_ci ${CMAKE_CURRENT_BINARY_DIR}/src 962b815c7f3Sopenharmony_ci ${CMAKE_CURRENT_BINARY_DIR}/tests 963b815c7f3Sopenharmony_ci ) 964b815c7f3Sopenharmony_ci target_link_libraries (test_main PRIVATE sndfile) 965b815c7f3Sopenharmony_ci if (MSVC) 966b815c7f3Sopenharmony_ci target_compile_definitions (test_main PRIVATE _USE_MATH_DEFINES) 967b815c7f3Sopenharmony_ci endif () 968b815c7f3Sopenharmony_ci add_test (test_main test_main) 969b815c7f3Sopenharmony_ci 970b815c7f3Sopenharmony_ci ### sfversion_test 971b815c7f3Sopenharmony_ci 972b815c7f3Sopenharmony_ci add_executable (sfversion tests/sfversion.c) 973b815c7f3Sopenharmony_ci target_include_directories (sfversion 974b815c7f3Sopenharmony_ci PRIVATE 975b815c7f3Sopenharmony_ci src 976b815c7f3Sopenharmony_ci ${CMAKE_CURRENT_BINARY_DIR}/src 977b815c7f3Sopenharmony_ci ) 978b815c7f3Sopenharmony_ci target_link_libraries (sfversion sndfile) 979b815c7f3Sopenharmony_ci add_test (sfversion sfversion) 980b815c7f3Sopenharmony_ci set_tests_properties (sfversion PROPERTIES 981b815c7f3Sopenharmony_ci PASS_REGULAR_EXPRESSION "${PACKAGE_NAME}-${CPACK_PACKAGE_VERSION_FULL}" 982b815c7f3Sopenharmony_ci ) 983b815c7f3Sopenharmony_ci 984b815c7f3Sopenharmony_ci ### error_test 985b815c7f3Sopenharmony_ci 986b815c7f3Sopenharmony_ci add_executable (error_test tests/error_test.c) 987b815c7f3Sopenharmony_ci target_link_libraries (error_test 988b815c7f3Sopenharmony_ci PRIVATE 989b815c7f3Sopenharmony_ci sndfile 990b815c7f3Sopenharmony_ci test_utils 991b815c7f3Sopenharmony_ci $<$<BOOL:${LIBM_REQUIRED}>:m> 992b815c7f3Sopenharmony_ci ) 993b815c7f3Sopenharmony_ci add_test (error_test error_test) 994b815c7f3Sopenharmony_ci 995b815c7f3Sopenharmony_ci ### ulaw_test 996b815c7f3Sopenharmony_ci add_executable (ulaw_test tests/ulaw_test.c) 997b815c7f3Sopenharmony_ci target_link_libraries (ulaw_test 998b815c7f3Sopenharmony_ci PRIVATE 999b815c7f3Sopenharmony_ci sndfile 1000b815c7f3Sopenharmony_ci test_utils 1001b815c7f3Sopenharmony_ci $<$<BOOL:${LIBM_REQUIRED}>:m> 1002b815c7f3Sopenharmony_ci ) 1003b815c7f3Sopenharmony_ci add_test (ulaw_test ulaw_test) 1004b815c7f3Sopenharmony_ci 1005b815c7f3Sopenharmony_ci ### alaw_test 1006b815c7f3Sopenharmony_ci add_executable (alaw_test tests/alaw_test.c) 1007b815c7f3Sopenharmony_ci target_link_libraries (alaw_test 1008b815c7f3Sopenharmony_ci PRIVATE 1009b815c7f3Sopenharmony_ci sndfile 1010b815c7f3Sopenharmony_ci test_utils 1011b815c7f3Sopenharmony_ci $<$<BOOL:${LIBM_REQUIRED}>:m> 1012b815c7f3Sopenharmony_ci ) 1013b815c7f3Sopenharmony_ci add_test (alaw_test alaw_test) 1014b815c7f3Sopenharmony_ci 1015b815c7f3Sopenharmony_ci ### dwvw_test 1016b815c7f3Sopenharmony_ci 1017b815c7f3Sopenharmony_ci add_executable (dwvw_test tests/dwvw_test.c) 1018b815c7f3Sopenharmony_ci target_link_libraries (dwvw_test 1019b815c7f3Sopenharmony_ci PRIVATE 1020b815c7f3Sopenharmony_ci sndfile 1021b815c7f3Sopenharmony_ci test_utils 1022b815c7f3Sopenharmony_ci $<$<BOOL:${LIBM_REQUIRED}>:m> 1023b815c7f3Sopenharmony_ci ) 1024b815c7f3Sopenharmony_ci add_test (dwvw_test dwvw_test) 1025b815c7f3Sopenharmony_ci 1026b815c7f3Sopenharmony_ci ### command_test 1027b815c7f3Sopenharmony_ci 1028b815c7f3Sopenharmony_ci add_executable (command_test tests/command_test.c) 1029b815c7f3Sopenharmony_ci target_link_libraries (command_test 1030b815c7f3Sopenharmony_ci PRIVATE 1031b815c7f3Sopenharmony_ci sndfile 1032b815c7f3Sopenharmony_ci test_utils 1033b815c7f3Sopenharmony_ci $<$<BOOL:${LIBM_REQUIRED}>:m> 1034b815c7f3Sopenharmony_ci ) 1035b815c7f3Sopenharmony_ci add_test (command_test command_test all) 1036b815c7f3Sopenharmony_ci 1037b815c7f3Sopenharmony_ci ### floating_point_test 1038b815c7f3Sopenharmony_ci 1039b815c7f3Sopenharmony_ci add_executable (floating_point_test 1040b815c7f3Sopenharmony_ci tests/dft_cmp.c 1041b815c7f3Sopenharmony_ci tests/floating_point_test.c 1042b815c7f3Sopenharmony_ci ) 1043b815c7f3Sopenharmony_ci target_link_libraries (floating_point_test 1044b815c7f3Sopenharmony_ci PRIVATE 1045b815c7f3Sopenharmony_ci sndfile 1046b815c7f3Sopenharmony_ci test_utils 1047b815c7f3Sopenharmony_ci $<$<BOOL:${LIBM_REQUIRED}>:m> 1048b815c7f3Sopenharmony_ci ) 1049b815c7f3Sopenharmony_ci target_include_directories (floating_point_test PRIVATE tests) 1050b815c7f3Sopenharmony_ci add_test (floating_point_test floating_point_test) 1051b815c7f3Sopenharmony_ci 1052b815c7f3Sopenharmony_ci ### checksum_test 1053b815c7f3Sopenharmony_ci 1054b815c7f3Sopenharmony_ci add_executable (checksum_test tests/checksum_test.c) 1055b815c7f3Sopenharmony_ci target_link_libraries (checksum_test 1056b815c7f3Sopenharmony_ci PRIVATE 1057b815c7f3Sopenharmony_ci sndfile 1058b815c7f3Sopenharmony_ci test_utils 1059b815c7f3Sopenharmony_ci $<$<BOOL:${LIBM_REQUIRED}>:m> 1060b815c7f3Sopenharmony_ci ) 1061b815c7f3Sopenharmony_ci add_test (checksum_test checksum_test) 1062b815c7f3Sopenharmony_ci 1063b815c7f3Sopenharmony_ci ### scale_clip_test 1064b815c7f3Sopenharmony_ci 1065b815c7f3Sopenharmony_ci add_executable (scale_clip_test tests/scale_clip_test.c) 1066b815c7f3Sopenharmony_ci target_link_libraries (scale_clip_test 1067b815c7f3Sopenharmony_ci PRIVATE 1068b815c7f3Sopenharmony_ci sndfile 1069b815c7f3Sopenharmony_ci test_utils 1070b815c7f3Sopenharmony_ci $<$<BOOL:${LIBM_REQUIRED}>:m> 1071b815c7f3Sopenharmony_ci ) 1072b815c7f3Sopenharmony_ci add_test (scale_clip_test scale_clip_test) 1073b815c7f3Sopenharmony_ci 1074b815c7f3Sopenharmony_ci ### headerless_test 1075b815c7f3Sopenharmony_ci 1076b815c7f3Sopenharmony_ci add_executable (headerless_test tests/headerless_test.c) 1077b815c7f3Sopenharmony_ci target_link_libraries (headerless_test 1078b815c7f3Sopenharmony_ci PRIVATE 1079b815c7f3Sopenharmony_ci sndfile 1080b815c7f3Sopenharmony_ci test_utils 1081b815c7f3Sopenharmony_ci $<$<BOOL:${LIBM_REQUIRED}>:m> 1082b815c7f3Sopenharmony_ci ) 1083b815c7f3Sopenharmony_ci add_test (headerless_test headerless_test) 1084b815c7f3Sopenharmony_ci 1085b815c7f3Sopenharmony_ci ### rdwr_test 1086b815c7f3Sopenharmony_ci 1087b815c7f3Sopenharmony_ci add_executable (rdwr_test tests/rdwr_test.c) 1088b815c7f3Sopenharmony_ci target_link_libraries (rdwr_test 1089b815c7f3Sopenharmony_ci PRIVATE 1090b815c7f3Sopenharmony_ci sndfile 1091b815c7f3Sopenharmony_ci test_utils 1092b815c7f3Sopenharmony_ci $<$<BOOL:${LIBM_REQUIRED}>:m> 1093b815c7f3Sopenharmony_ci ) 1094b815c7f3Sopenharmony_ci add_test (rdwr_test rdwr_test) 1095b815c7f3Sopenharmony_ci 1096b815c7f3Sopenharmony_ci ### locale_test 1097b815c7f3Sopenharmony_ci 1098b815c7f3Sopenharmony_ci add_executable (locale_test tests/locale_test.c) 1099b815c7f3Sopenharmony_ci target_link_libraries (locale_test 1100b815c7f3Sopenharmony_ci PRIVATE 1101b815c7f3Sopenharmony_ci sndfile 1102b815c7f3Sopenharmony_ci test_utils 1103b815c7f3Sopenharmony_ci $<$<BOOL:${LIBM_REQUIRED}>:m> 1104b815c7f3Sopenharmony_ci ) 1105b815c7f3Sopenharmony_ci add_test (locale_test locale_test) 1106b815c7f3Sopenharmony_ci 1107b815c7f3Sopenharmony_ci ### win32_ordinal_test 1108b815c7f3Sopenharmony_ci 1109b815c7f3Sopenharmony_ci# Disabled because we cannot test with shared sndfile library 1110b815c7f3Sopenharmony_ci# if (WIN32 AND BUILD_SHARED_LIBS) 1111b815c7f3Sopenharmony_ci# add_executable (win32_ordinal_test tests/win32_ordinal_test.c) 1112b815c7f3Sopenharmony_ci# target_link_libraries (win32_ordinal_test PRIVATE sndfile test_utils) 1113b815c7f3Sopenharmony_ci# add_test (win32_ordinal_test win32_ordinal_test) 1114b815c7f3Sopenharmony_ci# endif () 1115b815c7f3Sopenharmony_ci 1116b815c7f3Sopenharmony_ci ### cpp_test 1117b815c7f3Sopenharmony_ci 1118b815c7f3Sopenharmony_ci add_executable (cpp_test tests/cpp_test.cc) 1119b815c7f3Sopenharmony_ci target_link_libraries (cpp_test 1120b815c7f3Sopenharmony_ci PRIVATE 1121b815c7f3Sopenharmony_ci sndfile 1122b815c7f3Sopenharmony_ci test_utils 1123b815c7f3Sopenharmony_ci $<$<BOOL:${LIBM_REQUIRED}>:m> 1124b815c7f3Sopenharmony_ci ) 1125b815c7f3Sopenharmony_ci add_test (cpp_test cpp_test) 1126b815c7f3Sopenharmony_ci 1127b815c7f3Sopenharmony_ci ### external_libs_test 1128b815c7f3Sopenharmony_ci 1129b815c7f3Sopenharmony_ci add_executable (external_libs_test tests/external_libs_test.c) 1130b815c7f3Sopenharmony_ci target_link_libraries (external_libs_test 1131b815c7f3Sopenharmony_ci PRIVATE 1132b815c7f3Sopenharmony_ci sndfile 1133b815c7f3Sopenharmony_ci test_utils 1134b815c7f3Sopenharmony_ci $<$<BOOL:${LIBM_REQUIRED}>:m> 1135b815c7f3Sopenharmony_ci ) 1136b815c7f3Sopenharmony_ci add_test (external_libs_test external_libs_test) 1137b815c7f3Sopenharmony_ci 1138b815c7f3Sopenharmony_ci ### format_check_test 1139b815c7f3Sopenharmony_ci 1140b815c7f3Sopenharmony_ci add_executable (format_check_test tests/format_check_test.c) 1141b815c7f3Sopenharmony_ci target_link_libraries (format_check_test 1142b815c7f3Sopenharmony_ci PRIVATE 1143b815c7f3Sopenharmony_ci sndfile 1144b815c7f3Sopenharmony_ci test_utils 1145b815c7f3Sopenharmony_ci $<$<BOOL:${LIBM_REQUIRED}>:m> 1146b815c7f3Sopenharmony_ci ) 1147b815c7f3Sopenharmony_ci add_test (format_check_test format_check_test) 1148b815c7f3Sopenharmony_ci 1149b815c7f3Sopenharmony_ci ### channel_test 1150b815c7f3Sopenharmony_ci 1151b815c7f3Sopenharmony_ci add_executable (channel_test tests/channel_test.c) 1152b815c7f3Sopenharmony_ci target_link_libraries (channel_test 1153b815c7f3Sopenharmony_ci PRIVATE 1154b815c7f3Sopenharmony_ci sndfile 1155b815c7f3Sopenharmony_ci test_utils 1156b815c7f3Sopenharmony_ci $<$<BOOL:${LIBM_REQUIRED}>:m> 1157b815c7f3Sopenharmony_ci ) 1158b815c7f3Sopenharmony_ci add_test (channel_test channel_test) 1159b815c7f3Sopenharmony_ci 1160b815c7f3Sopenharmony_ci ### pcm_test 1161b815c7f3Sopenharmony_ci 1162b815c7f3Sopenharmony_ci add_executable (pcm_test tests/pcm_test.c) 1163b815c7f3Sopenharmony_ci target_link_libraries (pcm_test 1164b815c7f3Sopenharmony_ci PRIVATE 1165b815c7f3Sopenharmony_ci sndfile 1166b815c7f3Sopenharmony_ci test_utils 1167b815c7f3Sopenharmony_ci $<$<BOOL:${LIBM_REQUIRED}>:m> 1168b815c7f3Sopenharmony_ci ) 1169b815c7f3Sopenharmony_ci add_test (pcm_test pcm_test) 1170b815c7f3Sopenharmony_ci 1171b815c7f3Sopenharmony_ci ### common test executables 1172b815c7f3Sopenharmony_ci 1173b815c7f3Sopenharmony_ci add_executable (write_read_test 1174b815c7f3Sopenharmony_ci tests/generate.c 1175b815c7f3Sopenharmony_ci tests/write_read_test.c 1176b815c7f3Sopenharmony_ci ) 1177b815c7f3Sopenharmony_ci target_link_libraries (write_read_test 1178b815c7f3Sopenharmony_ci PRIVATE 1179b815c7f3Sopenharmony_ci sndfile 1180b815c7f3Sopenharmony_ci test_utils 1181b815c7f3Sopenharmony_ci $<$<BOOL:${LIBM_REQUIRED}>:m> 1182b815c7f3Sopenharmony_ci ) 1183b815c7f3Sopenharmony_ci target_include_directories (write_read_test PRIVATE tests) 1184b815c7f3Sopenharmony_ci 1185b815c7f3Sopenharmony_ci add_executable (lossy_comp_test tests/lossy_comp_test.c) 1186b815c7f3Sopenharmony_ci target_link_libraries (lossy_comp_test 1187b815c7f3Sopenharmony_ci PRIVATE 1188b815c7f3Sopenharmony_ci sndfile 1189b815c7f3Sopenharmony_ci test_utils 1190b815c7f3Sopenharmony_ci $<$<BOOL:${LIBM_REQUIRED}>:m> 1191b815c7f3Sopenharmony_ci ) 1192b815c7f3Sopenharmony_ci 1193b815c7f3Sopenharmony_ci add_executable (peak_chunk_test tests/peak_chunk_test.c) 1194b815c7f3Sopenharmony_ci target_link_libraries (peak_chunk_test 1195b815c7f3Sopenharmony_ci PRIVATE 1196b815c7f3Sopenharmony_ci sndfile 1197b815c7f3Sopenharmony_ci test_utils 1198b815c7f3Sopenharmony_ci $<$<BOOL:${LIBM_REQUIRED}>:m> 1199b815c7f3Sopenharmony_ci ) 1200b815c7f3Sopenharmony_ci 1201b815c7f3Sopenharmony_ci add_executable (header_test tests/header_test.c) 1202b815c7f3Sopenharmony_ci target_link_libraries (header_test 1203b815c7f3Sopenharmony_ci PRIVATE 1204b815c7f3Sopenharmony_ci sndfile 1205b815c7f3Sopenharmony_ci test_utils 1206b815c7f3Sopenharmony_ci $<$<BOOL:${LIBM_REQUIRED}>:m> 1207b815c7f3Sopenharmony_ci ) 1208b815c7f3Sopenharmony_ci 1209b815c7f3Sopenharmony_ci add_executable (misc_test tests/misc_test.c) 1210b815c7f3Sopenharmony_ci target_link_libraries (misc_test 1211b815c7f3Sopenharmony_ci PRIVATE 1212b815c7f3Sopenharmony_ci sndfile 1213b815c7f3Sopenharmony_ci test_utils 1214b815c7f3Sopenharmony_ci $<$<BOOL:${LIBM_REQUIRED}>:m> 1215b815c7f3Sopenharmony_ci ) 1216b815c7f3Sopenharmony_ci 1217b815c7f3Sopenharmony_ci add_executable (string_test tests/string_test.c) 1218b815c7f3Sopenharmony_ci target_link_libraries (string_test 1219b815c7f3Sopenharmony_ci PRIVATE 1220b815c7f3Sopenharmony_ci sndfile 1221b815c7f3Sopenharmony_ci test_utils 1222b815c7f3Sopenharmony_ci $<$<BOOL:${LIBM_REQUIRED}>:m> 1223b815c7f3Sopenharmony_ci ) 1224b815c7f3Sopenharmony_ci 1225b815c7f3Sopenharmony_ci add_executable (multi_file_test tests/multi_file_test.c) 1226b815c7f3Sopenharmony_ci target_link_libraries (multi_file_test 1227b815c7f3Sopenharmony_ci PRIVATE 1228b815c7f3Sopenharmony_ci sndfile 1229b815c7f3Sopenharmony_ci test_utils 1230b815c7f3Sopenharmony_ci $<$<BOOL:${LIBM_REQUIRED}>:m> 1231b815c7f3Sopenharmony_ci ) 1232b815c7f3Sopenharmony_ci 1233b815c7f3Sopenharmony_ci add_executable (aiff_rw_test tests/aiff_rw_test.c) 1234b815c7f3Sopenharmony_ci target_link_libraries (aiff_rw_test 1235b815c7f3Sopenharmony_ci PRIVATE 1236b815c7f3Sopenharmony_ci sndfile 1237b815c7f3Sopenharmony_ci test_utils 1238b815c7f3Sopenharmony_ci $<$<BOOL:${LIBM_REQUIRED}>:m> 1239b815c7f3Sopenharmony_ci ) 1240b815c7f3Sopenharmony_ci 1241b815c7f3Sopenharmony_ci add_executable (chunk_test tests/chunk_test.c) 1242b815c7f3Sopenharmony_ci target_link_libraries (chunk_test 1243b815c7f3Sopenharmony_ci PRIVATE 1244b815c7f3Sopenharmony_ci sndfile 1245b815c7f3Sopenharmony_ci test_utils 1246b815c7f3Sopenharmony_ci $<$<BOOL:${LIBM_REQUIRED}>:m> 1247b815c7f3Sopenharmony_ci ) 1248b815c7f3Sopenharmony_ci 1249b815c7f3Sopenharmony_ci add_executable (long_read_write_test tests/long_read_write_test.c) 1250b815c7f3Sopenharmony_ci target_link_libraries (long_read_write_test 1251b815c7f3Sopenharmony_ci PRIVATE 1252b815c7f3Sopenharmony_ci sndfile 1253b815c7f3Sopenharmony_ci test_utils 1254b815c7f3Sopenharmony_ci $<$<BOOL:${LIBM_REQUIRED}>:m> 1255b815c7f3Sopenharmony_ci ) 1256b815c7f3Sopenharmony_ci 1257b815c7f3Sopenharmony_ci add_executable (raw_test tests/raw_test.c) 1258b815c7f3Sopenharmony_ci target_link_libraries (raw_test 1259b815c7f3Sopenharmony_ci PRIVATE 1260b815c7f3Sopenharmony_ci sndfile 1261b815c7f3Sopenharmony_ci test_utils 1262b815c7f3Sopenharmony_ci $<$<BOOL:${LIBM_REQUIRED}>:m> 1263b815c7f3Sopenharmony_ci ) 1264b815c7f3Sopenharmony_ci 1265b815c7f3Sopenharmony_ci add_executable (compression_size_test tests/compression_size_test.c) 1266b815c7f3Sopenharmony_ci target_link_libraries (compression_size_test 1267b815c7f3Sopenharmony_ci PRIVATE 1268b815c7f3Sopenharmony_ci sndfile 1269b815c7f3Sopenharmony_ci test_utils 1270b815c7f3Sopenharmony_ci $<$<BOOL:${LIBM_REQUIRED}>:m> 1271b815c7f3Sopenharmony_ci ) 1272b815c7f3Sopenharmony_ci 1273b815c7f3Sopenharmony_ci add_executable (ogg_test tests/ogg_test.c) 1274b815c7f3Sopenharmony_ci target_link_libraries (ogg_test 1275b815c7f3Sopenharmony_ci PRIVATE 1276b815c7f3Sopenharmony_ci sndfile 1277b815c7f3Sopenharmony_ci test_utils 1278b815c7f3Sopenharmony_ci $<$<BOOL:${LIBM_REQUIRED}>:m> 1279b815c7f3Sopenharmony_ci ) 1280b815c7f3Sopenharmony_ci 1281b815c7f3Sopenharmony_ci add_executable (ogg_opus_test tests/ogg_opus_test.c) 1282b815c7f3Sopenharmony_ci target_link_libraries (ogg_opus_test 1283b815c7f3Sopenharmony_ci PRIVATE 1284b815c7f3Sopenharmony_ci sndfile 1285b815c7f3Sopenharmony_ci test_utils 1286b815c7f3Sopenharmony_ci $<$<BOOL:${LIBM_REQUIRED}>:m> 1287b815c7f3Sopenharmony_ci ) 1288b815c7f3Sopenharmony_ci 1289b815c7f3Sopenharmony_ci add_executable (mpeg_test tests/mpeg_test.c) 1290b815c7f3Sopenharmony_ci target_link_libraries (mpeg_test 1291b815c7f3Sopenharmony_ci PRIVATE 1292b815c7f3Sopenharmony_ci sndfile 1293b815c7f3Sopenharmony_ci test_utils 1294b815c7f3Sopenharmony_ci $<$<BOOL:${LIBM_REQUIRED}>:m> 1295b815c7f3Sopenharmony_ci ) 1296b815c7f3Sopenharmony_ci 1297b815c7f3Sopenharmony_ci add_executable (stdin_test tests/stdin_test.c) 1298b815c7f3Sopenharmony_ci target_link_libraries (stdin_test 1299b815c7f3Sopenharmony_ci PRIVATE 1300b815c7f3Sopenharmony_ci sndfile 1301b815c7f3Sopenharmony_ci test_utils 1302b815c7f3Sopenharmony_ci $<$<BOOL:${LIBM_REQUIRED}>:m> 1303b815c7f3Sopenharmony_ci ) 1304b815c7f3Sopenharmony_ci set_target_properties (stdin_test PROPERTIES RUNTIME_OUTPUT_DIRECTORY "tests") 1305b815c7f3Sopenharmony_ci 1306b815c7f3Sopenharmony_ci add_executable (stdout_test tests/stdout_test.c) 1307b815c7f3Sopenharmony_ci target_link_libraries (stdout_test 1308b815c7f3Sopenharmony_ci PRIVATE 1309b815c7f3Sopenharmony_ci sndfile 1310b815c7f3Sopenharmony_ci test_utils 1311b815c7f3Sopenharmony_ci $<$<BOOL:${LIBM_REQUIRED}>:m> 1312b815c7f3Sopenharmony_ci ) 1313b815c7f3Sopenharmony_ci set_target_properties (stdout_test PROPERTIES RUNTIME_OUTPUT_DIRECTORY "tests") 1314b815c7f3Sopenharmony_ci 1315b815c7f3Sopenharmony_ci add_executable (stdio_test tests/stdio_test.c) 1316b815c7f3Sopenharmony_ci target_link_libraries (stdio_test 1317b815c7f3Sopenharmony_ci PRIVATE 1318b815c7f3Sopenharmony_ci sndfile 1319b815c7f3Sopenharmony_ci test_utils 1320b815c7f3Sopenharmony_ci $<$<BOOL:${LIBM_REQUIRED}>:m> 1321b815c7f3Sopenharmony_ci ) 1322b815c7f3Sopenharmony_ci 1323b815c7f3Sopenharmony_ci add_executable (pipe_test tests/pipe_test.c) 1324b815c7f3Sopenharmony_ci target_link_libraries (pipe_test 1325b815c7f3Sopenharmony_ci PRIVATE 1326b815c7f3Sopenharmony_ci sndfile 1327b815c7f3Sopenharmony_ci test_utils 1328b815c7f3Sopenharmony_ci $<$<BOOL:${LIBM_REQUIRED}>:m> 1329b815c7f3Sopenharmony_ci ) 1330b815c7f3Sopenharmony_ci 1331b815c7f3Sopenharmony_ci add_executable (virtual_io_test tests/virtual_io_test.c) 1332b815c7f3Sopenharmony_ci target_link_libraries (virtual_io_test 1333b815c7f3Sopenharmony_ci PRIVATE 1334b815c7f3Sopenharmony_ci sndfile 1335b815c7f3Sopenharmony_ci test_utils 1336b815c7f3Sopenharmony_ci $<$<BOOL:${LIBM_REQUIRED}>:m> 1337b815c7f3Sopenharmony_ci ) 1338b815c7f3Sopenharmony_ci 1339b815c7f3Sopenharmony_ci ### g72x_test 1340b815c7f3Sopenharmony_ci 1341b815c7f3Sopenharmony_ci add_executable (g72x_test src/G72x/g72x_test.c) 1342b815c7f3Sopenharmony_ci target_include_directories (g72x_test 1343b815c7f3Sopenharmony_ci PRIVATE 1344b815c7f3Sopenharmony_ci src 1345b815c7f3Sopenharmony_ci ${CMAKE_CURRENT_BINARY_DIR}/src 1346b815c7f3Sopenharmony_ci ) 1347b815c7f3Sopenharmony_ci target_link_libraries (g72x_test 1348b815c7f3Sopenharmony_ci PRIVATE 1349b815c7f3Sopenharmony_ci sndfile 1350b815c7f3Sopenharmony_ci $<$<BOOL:${LIBM_REQUIRED}>:m> 1351b815c7f3Sopenharmony_ci ) 1352b815c7f3Sopenharmony_ci add_test (g72x_test g72x_test all) 1353b815c7f3Sopenharmony_ci 1354b815c7f3Sopenharmony_ci ### aiff-tests 1355b815c7f3Sopenharmony_ci 1356b815c7f3Sopenharmony_ci add_test (write_read_test_aiff write_read_test aiff) 1357b815c7f3Sopenharmony_ci add_test (lossy_comp_test_aiff_ulaw lossy_comp_test aiff_ulaw) 1358b815c7f3Sopenharmony_ci add_test (lossy_comp_test_aiff_alaw lossy_comp_test aiff_alaw) 1359b815c7f3Sopenharmony_ci add_test (lossy_comp_test_aiff_gsm610 lossy_comp_test aiff_gsm610) 1360b815c7f3Sopenharmony_ci add_test (peak_chunk_test_aiff peak_chunk_test aiff) 1361b815c7f3Sopenharmony_ci add_test (header_test_aiff header_test aiff) 1362b815c7f3Sopenharmony_ci add_test (misc_test_aiff misc_test aiff) 1363b815c7f3Sopenharmony_ci add_test (string_test_aiff string_test aiff) 1364b815c7f3Sopenharmony_ci add_test (multi_file_test_aiff multi_file_test aiff) 1365b815c7f3Sopenharmony_ci add_test (aiff_rw_test aiff_rw_test) 1366b815c7f3Sopenharmony_ci 1367b815c7f3Sopenharmony_ci ### au-tests 1368b815c7f3Sopenharmony_ci 1369b815c7f3Sopenharmony_ci add_test (write_read_test_au write_read_test au) 1370b815c7f3Sopenharmony_ci add_test (lossy_comp_test_au_ulaw lossy_comp_test au_ulaw) 1371b815c7f3Sopenharmony_ci add_test (lossy_comp_test_au_alaw lossy_comp_test au_alaw) 1372b815c7f3Sopenharmony_ci add_test (lossy_comp_test_au_g721 lossy_comp_test au_g721) 1373b815c7f3Sopenharmony_ci add_test (lossy_comp_test_au_g723 lossy_comp_test au_g723) 1374b815c7f3Sopenharmony_ci add_test (header_test_au header_test au) 1375b815c7f3Sopenharmony_ci add_test (misc_test_au misc_test au) 1376b815c7f3Sopenharmony_ci add_test (multi_file_test_au multi_file_test au) 1377b815c7f3Sopenharmony_ci 1378b815c7f3Sopenharmony_ci ### caf-tests 1379b815c7f3Sopenharmony_ci 1380b815c7f3Sopenharmony_ci add_test (write_read_test_caf write_read_test caf) 1381b815c7f3Sopenharmony_ci add_test (lossy_comp_test_caf_ulaw lossy_comp_test caf_ulaw) 1382b815c7f3Sopenharmony_ci add_test (lossy_comp_test_caf_alaw lossy_comp_test caf_alaw) 1383b815c7f3Sopenharmony_ci add_test (header_test_caf header_test caf) 1384b815c7f3Sopenharmony_ci add_test (peak_chunk_test_caf peak_chunk_test caf) 1385b815c7f3Sopenharmony_ci add_test (misc_test_caf misc_test caf) 1386b815c7f3Sopenharmony_ci add_test (chunk_test_caf chunk_test caf) 1387b815c7f3Sopenharmony_ci add_test (string_test_caf string_test caf) 1388b815c7f3Sopenharmony_ci add_test (long_read_write_test_alac long_read_write_test alac) 1389b815c7f3Sopenharmony_ci 1390b815c7f3Sopenharmony_ci # wav-tests 1391b815c7f3Sopenharmony_ci add_test (write_read_test_wav write_read_test wav) 1392b815c7f3Sopenharmony_ci add_test (lossy_comp_test_wav_pcm lossy_comp_test wav_pcm) 1393b815c7f3Sopenharmony_ci add_test (lossy_comp_test_wav_ima lossy_comp_test wav_ima) 1394b815c7f3Sopenharmony_ci add_test (lossy_comp_test_wav_msadpcm lossy_comp_test wav_msadpcm) 1395b815c7f3Sopenharmony_ci add_test (lossy_comp_test_wav_ulaw lossy_comp_test wav_ulaw) 1396b815c7f3Sopenharmony_ci add_test (lossy_comp_test_wav_alaw lossy_comp_test wav_alaw) 1397b815c7f3Sopenharmony_ci add_test (lossy_comp_test_wav_gsm610 lossy_comp_test wav_gsm610) 1398b815c7f3Sopenharmony_ci add_test (lossy_comp_test_wav_g721 lossy_comp_test wav_g721) 1399b815c7f3Sopenharmony_ci add_test (lossy_comp_test_wav_nmsadpcm lossy_comp_test wav_nmsadpcm) 1400b815c7f3Sopenharmony_ci add_test (peak_chunk_test_wav peak_chunk_test wav) 1401b815c7f3Sopenharmony_ci add_test (header_test_wav header_test wav) 1402b815c7f3Sopenharmony_ci add_test (misc_test_wav misc_test wav) 1403b815c7f3Sopenharmony_ci add_test (string_test_wav string_test wav) 1404b815c7f3Sopenharmony_ci add_test (multi_file_test_wav multi_file_test wav) 1405b815c7f3Sopenharmony_ci add_test (chunk_test_wav chunk_test wav) 1406b815c7f3Sopenharmony_ci 1407b815c7f3Sopenharmony_ci ### w64-tests 1408b815c7f3Sopenharmony_ci 1409b815c7f3Sopenharmony_ci add_test (write_read_test_w64 write_read_test w64) 1410b815c7f3Sopenharmony_ci add_test (lossy_comp_test_w64_ima lossy_comp_test w64_ima) 1411b815c7f3Sopenharmony_ci add_test (lossy_comp_test_w64_msadpcm lossy_comp_test w64_msadpcm) 1412b815c7f3Sopenharmony_ci add_test (lossy_comp_test_w64_ulaw lossy_comp_test w64_ulaw) 1413b815c7f3Sopenharmony_ci add_test (lossy_comp_test_w64_alaw lossy_comp_test w64_alaw) 1414b815c7f3Sopenharmony_ci add_test (lossy_comp_test_w64_gsm610 lossy_comp_test w64_gsm610) 1415b815c7f3Sopenharmony_ci add_test (header_test_w64 header_test w64) 1416b815c7f3Sopenharmony_ci add_test (misc_test_w64 misc_test w64) 1417b815c7f3Sopenharmony_ci 1418b815c7f3Sopenharmony_ci ### rf64-tests 1419b815c7f3Sopenharmony_ci 1420b815c7f3Sopenharmony_ci add_test (write_read_test_rf64 write_read_test rf64) 1421b815c7f3Sopenharmony_ci add_test (header_test_rf64 header_test rf64) 1422b815c7f3Sopenharmony_ci add_test (misc_test_rf64 misc_test rf64) 1423b815c7f3Sopenharmony_ci add_test (string_test_rf64 string_test rf64) 1424b815c7f3Sopenharmony_ci add_test (peak_chunk_test_rf64 peak_chunk_test rf64) 1425b815c7f3Sopenharmony_ci add_test (chunk_test_rf64 chunk_test rf64) 1426b815c7f3Sopenharmony_ci 1427b815c7f3Sopenharmony_ci ### raw-tests 1428b815c7f3Sopenharmony_ci add_test (write_read_test_raw write_read_test raw) 1429b815c7f3Sopenharmony_ci add_test (lossy_comp_test_raw_ulaw lossy_comp_test raw_ulaw) 1430b815c7f3Sopenharmony_ci add_test (lossy_comp_test_raw_alaw lossy_comp_test raw_alaw) 1431b815c7f3Sopenharmony_ci add_test (lossy_comp_test_raw_gsm610 lossy_comp_test raw_gsm610) 1432b815c7f3Sopenharmony_ci add_test (lossy_comp_test_vox_adpcm lossy_comp_test vox_adpcm) 1433b815c7f3Sopenharmony_ci add_test (raw_test raw_test) 1434b815c7f3Sopenharmony_ci 1435b815c7f3Sopenharmony_ci ### paf-tests 1436b815c7f3Sopenharmony_ci add_test (write_read_test_paf write_read_test paf) 1437b815c7f3Sopenharmony_ci add_test (header_test_paf header_test paf) 1438b815c7f3Sopenharmony_ci add_test (misc_test_paf misc_test paf) 1439b815c7f3Sopenharmony_ci 1440b815c7f3Sopenharmony_ci ### svx-tests 1441b815c7f3Sopenharmony_ci add_test (write_read_test_svx write_read_test svx) 1442b815c7f3Sopenharmony_ci add_test (header_test_svx header_test svx) 1443b815c7f3Sopenharmony_ci add_test (misc_test_svx misc_test svx) 1444b815c7f3Sopenharmony_ci 1445b815c7f3Sopenharmony_ci ### nist-tests 1446b815c7f3Sopenharmony_ci add_test (write_read_test_nist write_read_test nist) 1447b815c7f3Sopenharmony_ci add_test (lossy_comp_test_nist_ulaw lossy_comp_test nist_ulaw) 1448b815c7f3Sopenharmony_ci add_test (lossy_comp_test_nist_alaw lossy_comp_test nist_alaw) 1449b815c7f3Sopenharmony_ci add_test (header_test_nist header_test nist) 1450b815c7f3Sopenharmony_ci add_test (misc_test_nist misc_test nist) 1451b815c7f3Sopenharmony_ci 1452b815c7f3Sopenharmony_ci ### ircam-tests 1453b815c7f3Sopenharmony_ci add_test (write_read_test_ircam write_read_test ircam) 1454b815c7f3Sopenharmony_ci add_test (lossy_comp_test_ircam_ulaw lossy_comp_test ircam_ulaw) 1455b815c7f3Sopenharmony_ci add_test (lossy_comp_test_ircam_alaw lossy_comp_test ircam_alaw) 1456b815c7f3Sopenharmony_ci add_test (header_test_ircam header_test ircam) 1457b815c7f3Sopenharmony_ci add_test (misc_test_ircam misc_test ircam) 1458b815c7f3Sopenharmony_ci 1459b815c7f3Sopenharmony_ci ### voc-tests 1460b815c7f3Sopenharmony_ci add_test (write_read_test_voc write_read_test voc) 1461b815c7f3Sopenharmony_ci add_test (lossy_comp_test_voc_ulaw lossy_comp_test voc_ulaw) 1462b815c7f3Sopenharmony_ci add_test (lossy_comp_test_voc_alaw lossy_comp_test voc_alaw) 1463b815c7f3Sopenharmony_ci add_test (header_test_voc header_test voc) 1464b815c7f3Sopenharmony_ci add_test (misc_test_voc misc_test voc) 1465b815c7f3Sopenharmony_ci 1466b815c7f3Sopenharmony_ci ### mat4-tests 1467b815c7f3Sopenharmony_ci add_test (write_read_test_mat4 write_read_test mat4) 1468b815c7f3Sopenharmony_ci add_test (header_test_mat4 header_test mat4) 1469b815c7f3Sopenharmony_ci add_test (misc_test_mat4 misc_test mat4) 1470b815c7f3Sopenharmony_ci 1471b815c7f3Sopenharmony_ci ### mat5-tests 1472b815c7f3Sopenharmony_ci add_test (write_read_test_mat5 write_read_test mat5) 1473b815c7f3Sopenharmony_ci add_test (header_test_mat5 header_test mat5) 1474b815c7f3Sopenharmony_ci add_test (misc_test_mat5 misc_test mat5) 1475b815c7f3Sopenharmony_ci 1476b815c7f3Sopenharmony_ci ### pvf-tests 1477b815c7f3Sopenharmony_ci add_test (write_read_test_pvf write_read_test pvf) 1478b815c7f3Sopenharmony_ci add_test (header_test_pvf header_test pvf) 1479b815c7f3Sopenharmony_ci add_test (misc_test_pvf misc_test pvf) 1480b815c7f3Sopenharmony_ci 1481b815c7f3Sopenharmony_ci ### xi-tests 1482b815c7f3Sopenharmony_ci add_test (lossy_comp_test_xi_dpcm lossy_comp_test xi_dpcm) 1483b815c7f3Sopenharmony_ci 1484b815c7f3Sopenharmony_ci ### htk-tests 1485b815c7f3Sopenharmony_ci add_test (write_read_test_htk write_read_test htk) 1486b815c7f3Sopenharmony_ci add_test (header_test_htk header_test htk) 1487b815c7f3Sopenharmony_ci add_test (misc_test_htk misc_test htk) 1488b815c7f3Sopenharmony_ci 1489b815c7f3Sopenharmony_ci ### avr-tests 1490b815c7f3Sopenharmony_ci add_test (write_read_test_avr write_read_test avr) 1491b815c7f3Sopenharmony_ci add_test (header_test_avr header_test avr) 1492b815c7f3Sopenharmony_ci add_test (misc_test_avr misc_test avr) 1493b815c7f3Sopenharmony_ci 1494b815c7f3Sopenharmony_ci ### sds-tests 1495b815c7f3Sopenharmony_ci add_test (write_read_test_sds write_read_test sds) 1496b815c7f3Sopenharmony_ci add_test (header_test_sds header_test sds) 1497b815c7f3Sopenharmony_ci add_test (misc_test_sds misc_test sds) 1498b815c7f3Sopenharmony_ci 1499b815c7f3Sopenharmony_ci # sd2-tests 1500b815c7f3Sopenharmony_ci add_test (write_read_test_sd2 write_read_test sd2) 1501b815c7f3Sopenharmony_ci 1502b815c7f3Sopenharmony_ci ### wve-tests 1503b815c7f3Sopenharmony_ci add_test (lossy_comp_test_wve lossy_comp_test wve) 1504b815c7f3Sopenharmony_ci 1505b815c7f3Sopenharmony_ci ### mpc2k-tests 1506b815c7f3Sopenharmony_ci add_test (write_read_test_mpc2k write_read_test mpc2k) 1507b815c7f3Sopenharmony_ci add_test (header_test_mpc2k header_test mpc2k) 1508b815c7f3Sopenharmony_ci add_test (misc_test_mpc2k misc_test mpc2k) 1509b815c7f3Sopenharmony_ci 1510b815c7f3Sopenharmony_ci ### flac-tests 1511b815c7f3Sopenharmony_ci add_test (write_read_test_flac write_read_test flac) 1512b815c7f3Sopenharmony_ci add_test (compression_size_test_flac compression_size_test flac) 1513b815c7f3Sopenharmony_ci add_test (string_test_flac string_test flac) 1514b815c7f3Sopenharmony_ci 1515b815c7f3Sopenharmony_ci ### vorbis-tests 1516b815c7f3Sopenharmony_ci add_test (ogg_test ogg_test) 1517b815c7f3Sopenharmony_ci add_test (compression_size_test_vorbis compression_size_test vorbis) 1518b815c7f3Sopenharmony_ci add_test (lossy_comp_test_ogg_vorbis lossy_comp_test ogg_vorbis) 1519b815c7f3Sopenharmony_ci add_test (string_test_ogg string_test ogg) 1520b815c7f3Sopenharmony_ci add_test (misc_test_ogg misc_test ogg) 1521b815c7f3Sopenharmony_ci 1522b815c7f3Sopenharmony_ci ### opus-tests ### 1523b815c7f3Sopenharmony_ci add_test (ogg_opus_test ogg_opus_test) 1524b815c7f3Sopenharmony_ci add_test (compression_size_test_opus compression_size_test opus) 1525b815c7f3Sopenharmony_ci add_test (lossy_comp_test_ogg_opus lossy_comp_test ogg_opus) 1526b815c7f3Sopenharmony_ci add_test (string_test_opus string_test opus) 1527b815c7f3Sopenharmony_ci 1528b815c7f3Sopenharmony_ci ### mpeg-tests ### 1529b815c7f3Sopenharmony_ci add_test (mpeg_test mpeg_test) 1530b815c7f3Sopenharmony_ci add_test (compression_size_test_mpeg compression_size_test mpeg) 1531b815c7f3Sopenharmony_ci 1532b815c7f3Sopenharmony_ci ### io-tests 1533b815c7f3Sopenharmony_ci add_test (stdio_test stdio_test) 1534b815c7f3Sopenharmony_ci add_test (pipe_test pipe_test) 1535b815c7f3Sopenharmony_ci add_test (virtual_io_test virtual_io_test) 1536b815c7f3Sopenharmony_ci 1537b815c7f3Sopenharmony_ci set (SNDFILE_TEST_TARGETS 1538b815c7f3Sopenharmony_ci test_utils 1539b815c7f3Sopenharmony_ci test_main 1540b815c7f3Sopenharmony_ci sfversion 1541b815c7f3Sopenharmony_ci error_test 1542b815c7f3Sopenharmony_ci ulaw_test 1543b815c7f3Sopenharmony_ci alaw_test 1544b815c7f3Sopenharmony_ci dwvw_test 1545b815c7f3Sopenharmony_ci command_test 1546b815c7f3Sopenharmony_ci floating_point_test 1547b815c7f3Sopenharmony_ci checksum_test 1548b815c7f3Sopenharmony_ci scale_clip_test 1549b815c7f3Sopenharmony_ci headerless_test 1550b815c7f3Sopenharmony_ci rdwr_test 1551b815c7f3Sopenharmony_ci locale_test 1552b815c7f3Sopenharmony_ci cpp_test 1553b815c7f3Sopenharmony_ci external_libs_test 1554b815c7f3Sopenharmony_ci format_check_test 1555b815c7f3Sopenharmony_ci channel_test 1556b815c7f3Sopenharmony_ci pcm_test 1557b815c7f3Sopenharmony_ci write_read_test 1558b815c7f3Sopenharmony_ci lossy_comp_test 1559b815c7f3Sopenharmony_ci peak_chunk_test 1560b815c7f3Sopenharmony_ci header_test 1561b815c7f3Sopenharmony_ci misc_test 1562b815c7f3Sopenharmony_ci string_test 1563b815c7f3Sopenharmony_ci multi_file_test 1564b815c7f3Sopenharmony_ci aiff_rw_test 1565b815c7f3Sopenharmony_ci chunk_test 1566b815c7f3Sopenharmony_ci long_read_write_test 1567b815c7f3Sopenharmony_ci raw_test 1568b815c7f3Sopenharmony_ci compression_size_test 1569b815c7f3Sopenharmony_ci ogg_test 1570b815c7f3Sopenharmony_ci stdin_test 1571b815c7f3Sopenharmony_ci stdout_test 1572b815c7f3Sopenharmony_ci stdio_test 1573b815c7f3Sopenharmony_ci pipe_test 1574b815c7f3Sopenharmony_ci virtual_io_test 1575b815c7f3Sopenharmony_ci g72x_test 1576b815c7f3Sopenharmony_ci ) 1577b815c7f3Sopenharmony_ci 1578b815c7f3Sopenharmony_ci# if (WIN32 AND BUILD_SHARED_LIBS) 1579b815c7f3Sopenharmony_ci# list (APPEND SNDFILE_TEST_TARGETS win32_ordinal_test) 1580b815c7f3Sopenharmony_ci# endif () 1581b815c7f3Sopenharmony_ci 1582b815c7f3Sopenharmony_ci set_target_properties(${SNDFILE_TEST_TARGETS} PROPERTIES FOLDER Tests) 1583b815c7f3Sopenharmony_ci 1584b815c7f3Sopenharmony_ciendif () 1585b815c7f3Sopenharmony_ci 1586b815c7f3Sopenharmony_ciif (ENABLE_CPACK) 1587b815c7f3Sopenharmony_ci if ((NOT CPACK_PACKAGE_VERSION) AND CPACK_PACKAGE_VERSION_STAGE) 1588b815c7f3Sopenharmony_ci set(CPACK_PACKAGE_VERSION "${CPACK_PACKAGE_VERSION_FULL}") 1589b815c7f3Sopenharmony_ci endif () 1590b815c7f3Sopenharmony_ci include (CPack) 1591b815c7f3Sopenharmony_ciendif () 1592