Skip to content

Commit 4415a69

Browse files
committed
Add CMake build script
Description =========== This patch adds support of CMake meta build system, so you can generate Unix makefiles, VS 6.0-2017 projects and many more. Features ======== * Win32 and Linux tested * Travis CI test added * Generates working Visual Studio 6.0-2017 solutions * Generates working Unix Makefile * Supported options (<option> - <default value>): * `ENABLE_FLOATING_POINT` - on * `ENABLE_FIXED_POINT` - off * `ENABLE_FIXED_POINT_DEBUG` - off * `USE_GPL_FFTW3` - off * `DISABLE_FLOAT_API` - off * `DISABLE_VBR` - off * `ENABLE_VORBIS_PSY` - off * `ENABLE_SSE` - on if supported * `ENABLE_ARM4_ASM` - off * `ENABLE_ARM5E_ASM` - off * `ENABLE_BLACKFIN_ASM` - off * `ENABLE_TI_C55X` - off * `USE_SPEEXDSP` - on if library found * `DISABLE_BINARIES` - off * `ENABLE_PACKAGE_CONFIG` - on, [CMake specific](https://cmake.org/cmake/help/latest/manual/cmake-packages.7.html#package-configuration-file) * Configured conditionals (`config.h`): * `WORDS_BIGENDIAN` * `FLOATING_POINT` * `FIXED_POINT` * `FIXED_POINT_DEBUG` * `DISABLE_FLOAT_API` * `_USE_SSE` * `ARM4_ASM` * `ARM5E_ASM` * `BFIN_ASM` * `TI_C55X` * `DISABLE_VBR` * `USE_SPEEXDSP` * `VORBIS_PSYCHO` * `HAVE_GETOPT_H` * `HAVE_GETOPT_LONG` * `VAR_ARRAYS` * `USE_ALLOCA` * `HAVE_ALLOCA_H` * `USE_SMALLFT` * `USE_KISS_FFT` * `USE_GPL_FFTW3` * `EXPORT` * Installation supported * Package config mode supported How to use ========== Required tools and libraries: * CMake >= 3.1 * Ogg, SpeexDSP packages (headers and import libraries), recommended * FFTW3 package, optional Type commands: ``` mkdir cmake-build cd cmake-build cmake .. cmake . --build ``` or use CMake GUI.
1 parent cae5026 commit 4415a69

10 files changed

+616
-9
lines changed

.gitignore

+10
Original file line numberDiff line numberDiff line change
@@ -43,3 +43,13 @@ src/speexdec
4343
src/speexenc
4444
stamp-*
4545
patches
46+
47+
CMakeCache.txt
48+
CMakeFiles
49+
CMakeScripts
50+
Testing
51+
Makefile
52+
cmake_install.cmake
53+
install_manifest.txt
54+
compile_commands.json
55+
CTestTestfile.cmake

.travis.yml

+26-8
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,25 @@
11
language: c
2+
sudo: false
3+
dist: trusty
4+
addons:
5+
apt:
6+
packages:
7+
- libogg-dev
8+
- libspeexdsp-dev
9+
- libfftw3-dev
210

311
env:
4-
- CONFIG=""
5-
- CONFIG="--enable-fixed-point"
6-
- CONFIG="--enable-fixed-point --disable-float-api"
7-
- CONFIG="--enable-vorbis-psy"
8-
- CONFIG="--disable-binaries"
12+
matrix:
13+
- CMAKE=1 CONFIG=""
14+
- CMAKE=1 CONFIG="-DENABLE_FIXED_POINT:BOOL=TRUE -DENABLE_FLOATING_POINT:BOOL=FALSE"
15+
- CMAKE=1 CONFIG="-DENABLE_FIXED_POINT:BOOL=TRUE -DENABLE_FLOATING_POINT:BOOL=FALSE -DDISABLE_FLOAT_API:BOOL=TRUE"
16+
- CMAKE=1 CONFIG="-DENABLE_VORBIS_PSY:BOOL=TRUE"
17+
- CMAKE=1 CONFIG="-DDISABLE_BINARIES:BOOL=TRUE"
18+
- AUTOTOOLS=1 CONFIG=""
19+
- AUTOTOOLS=1 CONFIG="--enable-fixed-point"
20+
- AUTOTOOLS=1 CONFIG="--enable-fixed-point --disable-float-api"
21+
- AUTOTOOLS=1 CONFIG="--enable-vorbis-psy"
22+
- AUTOTOOLS=1 CONFIG="--disable-binaries"
923

1024
os:
1125
- linux
@@ -15,7 +29,11 @@ compiler:
1529
- gcc
1630
- clang
1731

32+
before_install:
33+
- if [[ "${TRAVIS_OS_NAME}" == "osx" ]]; then
34+
brew install libogg speexdsp fftw;
35+
fi
36+
1837
script:
19-
- ./autogen.sh
20-
- ./configure $CONFIG
21-
- make distcheck
38+
- if [ "$CMAKE" == "1" ]; then mkdir cmake-build; cd cmake-build; cmake .. $CONFIG -DBUILD_SHARED_LIBS:BOOL=TRUE -DCMAKE_INSTALL_PREFIX:PATH=$HOME/cmake-check; make install; fi
39+
- if [ "$AUTOTOOLS" == "1" ]; then ./autogen.sh; ./configure $CONFIG; make distcheck; fi

0 commit comments

Comments
 (0)