• Home
  • Raw
  • Download

Lines Matching +full:ubuntu +full:- +full:clang +full:- +full:cmake +full:- +full:shared

11 Erik de Castro Lopo <erikd@mega-nerd.com> aka @erikd. The project was developed
30 modern CMake based build system. Use of the CMake build system is documented
33 Setting up a build environment for libsndfile on Debian or Ubuntu is as simple as:
35 sudo apt install autoconf autogen automake build-essential libasound2-dev \
36 libflac-dev libogg-dev libtool libvorbis-dev libopus-dev libmp3lame-dev \
37 libmpg123-dev pkg-config python
44 brew install autoconf autogen automake flac libogg libtool libvorbis opus mpg123 pkg-config
49 autoreconf -vif
50 ./configure --enable-werror
54 ## The CMake build system
56 Although Autotools is the primary and recommended build toolchain, CMake meta
57 build generator is also available. The build process with CMake takes
60 building. CMake can produce Microsoft Visual Studio project and solution files,
61 Unix Makefiles, Xcode projects and [many more](https://cmake.org/cmake/help/latest/manual/cmake-gen…
63 Some IDE support CMake natively or with plugins, check you IDE documentation
68 1. C99-compliant compiler toolchain (tested with GCC, Clang and Visual
70 2. CMake 3.1.3 or newer
75 2. ALSA development package under Linux to build sndfile-play utility
76 3. Sndio development package under BSD to build sndfile-play utility
80 CMake can handle out-of-place builds, enabling several builds from
81 the same source tree, and cross-compilation. The ability to build a directory
88 Then run `cmake` command with directory where CMakeLists.txt script is located
91 cmake ..
94 directory. CMake is smart enough to create Unix makefiles under Linux or Visual
96 [generator](https://cmake.org/cmake/help/latest/manual/cmake-generators.7.html)
97 with `-G` command line parameter:
99 cmake .. -G"Unix Makefiles"
111 cmake --build .
113 CMake also provides Qt-based cross platform GUI, cmake-gui. Using it is trivial
116 ### Configuring CMake
119 `cmake` command. Some useful system options:
121 * `CMAKE_C_FLAGS` - additional C compiler flags
122 * `CMAKE_BUILD_TYPE` - configuration type, `DEBUG`, `RELEASE`, `RELWITHDEBINFO`
124 * `CMAKE_INSTALL_PREFIX` - build install location, the same as `--prefix` option
129 * `BUILD_SHARED_LIBS` - build shared library (DLL under Windows) when `ON`,
131 * `BUILD_PROGRAMS` - build libsndfile's utilities from `programs/` directory,
133 * `BUILD_EXAMPLES` - build examples, `ON` by default.
134 * `BUILD_TESTING` - build tests. Then you can run tests with `ctest` command,
136 * `ENABLE_EXTERNAL_LIBS` - enable Ogg, Vorbis, FLAC and Opus support. This
138 * `ENABLE_MPEG` - MP3 support. This option is available and set to `ON` if all
140 * `ENABLE_CPU_CLIP` - enable tricky cpu specific clipper. Enabled and set to
142 * `ENABLE_BOW_DOCS` - enable black-on-white documentation theme, `OFF` by
144 * `ENABLE_EXPERIMENTAL` - enable experimental code. Don't use it if you are
146 * `ENABLE_CPACK` - enable [CPack](https://cmake.org/cmake/help/latest/module/CPack.html) support.
148 …ACKAGE_CONFIG` - generate and install [package config file](https://cmake.org/cmake/help/latest/ma…
149 * `INSTALL_PKGCONFIG_MODULE` - generate and install [pkg-config module](https://people.freedesktop.…
150 * `INSTALL_MANPAGES` - install [man pages](https://en.wikipedia.org/wiki/Man_page) for programs. Th…
151 * `ENABLE_STATIC_RUNTIME` - enable static runtime on Windows platform (MSVC and
154 **Note**: For MSVC compiler this option is deprecated for CMake >= 3.15, see
155 policy [CMP0091](https://cmake.org/cmake/help/latest/policy/CMP0091.html).
159 and then disabled again, you need to clear CMake cache (delete CMakeCache.txt).
160 * `ENABLE_COMPATIBLE_LIBSNDFILE_NAME` - set DLL name to `libsndfile-1.dll`
163 DLL name on Windows platform is `libsndfile-1.dll`, because the only way to
166 rules from `sndfile` target. But when you build with CMake using native
169 because you can search library using package manager or CMake's
172 * `ENABLE_SSE2` - add compiler flag to enable SSE2 if required, `ON` by default.
184 * `DISABLE_EXTERNAL_LIBS` - disable Ogg, Vorbis and FLAC support. Replaced by
186 * `DISABLE_CPU_CLIP` - disable tricky cpu specific clipper. Replaced by
188 * `BUILD_STATIC_LIBS` - build static library. Use `BUILD_SHARED_LIBS` instead
190 ### Linking from CMake projects
192 First you need to add `FindOgg.cmake`, `FindVorbis.cmake`, `FindFLAC.cmake` and
193 `FindOpus.cmake` files to some directory inside your CMake project (usually
194 `cmake`) and add it to `CMAKE_MODULE_PATH`:
198 list(APPEND CMAKE_MODULE_PATH ${CMAKE_CURRENT_SOURCE_DIR}/cmake)
231 … CRT libraries](https://docs.microsoft.com/en-us/cpp/c-runtime-library/c-run-time-library-referenc…
236 C/C++ -> Code Generation -> Runtime Library
242 …"The program can't start because <crt-dll-name>.dll is missing from your computer. Try reinstallin…
249 CMake project will use dynamic system CRT libraries by default, just like
256 If you have CMake >= 3.15 you should use
257 [`CMAKE_MSVC_RUNTIME_LIBRARY`](https://cmake.org/cmake/help/v3.15/variable/CMAKE_MSVC_RUNTIME_LIBRA…
261 cmake .. -D"MultiThreaded$<$<CONFIG:Debug>:Debug>"
264 linking for CMake project: `OFF` or unset (default) for dynamic, and `ON` for
267 cmake .. -DENABLE_STATIC_RUNTIME=ON
278 Install Vcpkg and then add this parameter to cmake command line:
280 -DCMAKE_TOOLCHAIN_FILE=<path-to-vcpkg>/scripts/buildsystems/vcpkg.cmake
284 -DVCPKG_TARGET_TRIPLET=x64-windows-static
296 -DVCPKG_MANIFEST_MODE=OFF
300 vcpkg install libvorbis:x64-windows-static libflac:x64-windows-static
301 opus:x64-windows-static mp3lame:x86-windows-static mpg123:x86-windows-static
302 libvorbis:x86-windows-static libflac:x86-windows-static
303 opus:x86-windows-static mp3lame:x86-windows-static mpg123:x86-windows-static
306 libsndfile library itself. For `*-static` triplets Vcpkg uses
315 [BuildingForAndroid]: https://github.com/libsndfile/libsndfile/blob/master/Building-for-Android.md