Skip to content

Commit

Permalink
Add CMake build script
Browse files Browse the repository at this point in the history
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.
  • Loading branch information
evpobr committed May 23, 2017
1 parent cae5026 commit 4415a69
Show file tree
Hide file tree
Showing 10 changed files with 616 additions and 9 deletions.
10 changes: 10 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -43,3 +43,13 @@ src/speexdec
src/speexenc
stamp-*
patches

CMakeCache.txt
CMakeFiles
CMakeScripts
Testing
Makefile
cmake_install.cmake
install_manifest.txt
compile_commands.json
CTestTestfile.cmake
34 changes: 26 additions & 8 deletions .travis.yml
Original file line number Diff line number Diff line change
@@ -1,11 +1,25 @@
language: c
sudo: false
dist: trusty
addons:
apt:
packages:
- libogg-dev
- libspeexdsp-dev
- libfftw3-dev

env:
- CONFIG=""
- CONFIG="--enable-fixed-point"
- CONFIG="--enable-fixed-point --disable-float-api"
- CONFIG="--enable-vorbis-psy"
- CONFIG="--disable-binaries"
matrix:
- CMAKE=1 CONFIG=""
- CMAKE=1 CONFIG="-DENABLE_FIXED_POINT:BOOL=TRUE -DENABLE_FLOATING_POINT:BOOL=FALSE"
- CMAKE=1 CONFIG="-DENABLE_FIXED_POINT:BOOL=TRUE -DENABLE_FLOATING_POINT:BOOL=FALSE -DDISABLE_FLOAT_API:BOOL=TRUE"
- CMAKE=1 CONFIG="-DENABLE_VORBIS_PSY:BOOL=TRUE"
- CMAKE=1 CONFIG="-DDISABLE_BINARIES:BOOL=TRUE"
- AUTOTOOLS=1 CONFIG=""
- AUTOTOOLS=1 CONFIG="--enable-fixed-point"
- AUTOTOOLS=1 CONFIG="--enable-fixed-point --disable-float-api"
- AUTOTOOLS=1 CONFIG="--enable-vorbis-psy"
- AUTOTOOLS=1 CONFIG="--disable-binaries"

os:
- linux
Expand All @@ -15,7 +29,11 @@ compiler:
- gcc
- clang

before_install:
- if [[ "${TRAVIS_OS_NAME}" == "osx" ]]; then
brew install libogg speexdsp fftw;
fi

script:
- ./autogen.sh
- ./configure $CONFIG
- make distcheck
- 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
- if [ "$AUTOTOOLS" == "1" ]; then ./autogen.sh; ./configure $CONFIG; make distcheck; fi
Loading

0 comments on commit 4415a69

Please sign in to comment.