Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add CMake build script #6

Open
wants to merge 12 commits into
base: master
Choose a base branch
from
Open

Add CMake build script #6

wants to merge 12 commits into from

Conversation

evpobr
Copy link

@evpobr evpobr commented May 20, 2017

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
  • 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.

@evpobr evpobr changed the title Add CMake build script, closes #5 Add CMake build script May 20, 2017
@bagong
Copy link

bagong commented May 20, 2017

I tried it with Visual Studio 2015 and worked nicely - I cannot really test anything though for the time being ;)

Two question:

  • which precision-version of fftw3 is used/needed? double? I built with single, and it built, but...
  • is SpeexDSP important? If yes, how would one build that on Windows?

Thanks!

@evpobr
Copy link
Author

evpobr commented May 21, 2017

Thanks.

which precision-version of fftw3 is used/needed? double? I built with single, and it built, but...

CMake only searches fftw3.h header and fftw3 library, i don't know how to distinguish between single/double float version. Check FFTW_INCLUDE_DIR and FFTW_LIBRARY to see what is found. You can set them manually of course.

is SpeexDSP important? If yes, how would one build that on Windows?

It is used in speexenc utility only to make optional preprocessing, it is not required by libspeex. I don't have Win32 build, tested under Linux.

@bagong
Copy link

bagong commented May 21, 2017

which precision-version of fftw3 is used/needed? double? I built with single, and it built, but...

CMake only searches fftw3.h header and fftw3 library, i don't know how to distinguish between single/double float version. Check FFTW_INCLUDE_DIR and FFTW_LIBRARY to see what is found. You can set them manually of course.

Typically the versions are distinguished with a suffixed letter: double: no suffix, single: f, double-long: l. So if cmake looks for the base-name, it will find double. I built with single, because I need it in another project, and the build succeeded. I wonder now if speex can work with different versions, or if it won't work (background is that the vcpkg for fftw only allows a single version and doesn't output different names, as opposed to established package mangers like homebrew. I am considering trying to change that). Maybe somebody knows if a specific precision version is needed?

@evpobr
Copy link
Author

evpobr commented May 21, 2017

FFTW is optional, without it speex uses internal FFT routines with ASM optimizations. For Win32 there is SSE optimized code, configured and enabled automatically if supported. I don't think it is much slower then FFTW code.

@evpobr evpobr force-pushed the cmake branch 5 times, most recently from 96d5c95 to 4415a69 Compare May 23, 2017 08:41
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.
@bagong
Copy link

bagong commented Jun 27, 2017

microsoft/vcpkg#1357

@tmatth
Copy link
Member

tmatth commented Nov 13, 2019

Failing with:

CMake Error at cmake_install.cmake:136 (file):

  file INSTALL cannot find

  "/Users/travis/build/xiph/speex/cmake/speex-config.cmake".

make: *** [install] Error 1

The command "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" exited with 2.

0.01s$ if [ "$AUTOTOOLS" == "1" ]; then ./autogen.sh; ./configure $CONFIG; make distcheck; fi

The command "if [ "$AUTOTOOLS" == "1" ]; then ./autogen.sh; ./configure $CONFIG; make distcheck; fi" exited with 0.

Done. Your build exited with 1.

See the Travis links.

@1480c1
Copy link

1480c1 commented Apr 30, 2021

Any updates on this?


project(speex VERSION 1.2.0 LANGUAGES C)

set(CMAKE_MODULE_PATH "${CMAKE_CURRENT_SOURCE_DIR}/cmake/")

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
set(CMAKE_MODULE_PATH "${CMAKE_CURRENT_SOURCE_DIR}/cmake/")
list(APPEND CMAKE_MODULE_PATH ${CMAKE_CURRENT_SOURCE_DIR}/cmake/)

Otherwise some of the includes below may not be found (we had this issue with cross-compiling for emscripten)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants