Join GitHub today
GitHub is home to over 28 million developers working together to host and review code, manage projects, and build software together.Sign up
CMake build types and options
The following build types are supported:
DEBUG- Shows debug logs with
-O2flag and removes
MINSIZEREL- Compiles with
RELEASEflags and optimizations (
-Os) for a smaller build size.
To specify a build type, use this command in place of step 4 below:
cmake <absolute-path-to-source> -DCMAKE_BUILD_TYPE=<build-type>
Build with a wake word detector
Note: Wake word detector and key word detector (KWD) are used interchangeably.
The AVS Device SDK supports wake word detectors from Sensory and KITT.ai. The following options are required to build with a wake word detector, please replace
SENSORY for Sensory, and
KITTAI for KITT.ai:
-D<wake-word-name>_KEY_WORD_DETECTOR=<ON or OFF>- Specifies if the wake word detector is enabled or disabled during build.
-D<wake-word-name>_KEY_WORD_DETECTOR_LIB_PATH=<absolute-path-to-lib>- The path to the wake word detector library.
-D<wake-word-name>_KEY_WORD_DETECTOR_INCLUDE_DIR=<absolute-path-to-include-dir>- The path to the wake word detector include directory.
Note: To list all available CMake options, use the following command:
If using the Sensory wake word detector, version 5.0.0-beta.10.2 or later is required.
This is an example
cmake command to build with Sensory:
cmake <absolute-path-to-source> -DSENSORY_KEY_WORD_DETECTOR=ON -DSENSORY_KEY_WORD_DETECTOR_LIB_PATH=<absolute-path>/alexa-rpi/lib/libsnsr.a -DSENSORY_KEY_WORD_DETECTOR_INCLUDE_DIR=<absolute-path>/alexa-rpi/include
Note that you may need to license the Sensory library for use prior to running cmake and building it into the SDK. A script to license the Sensory library can be found on the Sensory Github page under
A matrix calculation library, known as BLAS, is required to use KITT.ai. To install this library, run:
- Generic Linux -
apt-get install libatlas-base-dev
- macOS -
brew install homebrew/science/openblas
This is an example
cmake command to build with KITT.ai:
cmake <absolute-path-to-source> -DKITTAI_KEY_WORD_DETECTOR=ON -DKITTAI_KEY_WORD_DETECTOR_LIB_PATH=<absolute-path>/snowboy-1.2.0/lib/libsnowboy-detect.a -DKITTAI_KEY_WORD_DETECTOR_INCLUDE_DIR=<absolute-path>/snowboy-1.2.0/include
Build with an implementation of
MediaPlayer (the reference implementation of the
MediaPlayerInterface) is based upon GStreamer, and is not built by default. To build 'MediaPlayer' use this option:
If GStreamer was installed from source, the prefix path provided when building must be specified to CMake with:
This is a sample
cmake <absolute-path-to-source> -DGSTREAMER_MEDIA_PLAYER=ON -DCMAKE_PREFIX_PATH=<absolute-path-to-GStreamer-build>
Build with PortAudio (required to run the sample app)
PortAudio is required to build and run the sample app. This is covered in the quick start guides for Linux, macOS, and Raspberry Pi.
These options must be declared in your
cmake command to build with PortAudio. Please note, GStreamer is also included, as it is required to run the SampleApp:
This is a sample
cmake <absolute-path-to-source> -DGSTREAMER_MEDIA_PLAYER=ON -DPORTAUDIO=ON -DPORTAUDIO_LIB_PATH=<absolute-path>/portaudio/lib/.libs/libportaudio.a -DPORTAUDIO_INCLUDE_DIR=<absolute-path>/portaudio/include
Build for Android
The following variables can be declared in your
cmake command to build for Android.
Note: All of the
ANDROID_* variables are only relevant if the
ANDROID variable is
ANDROID: Enables the android build (
ANDROID_LOGGER: Publishes logs using the Android logging facility (
ANDROID_MICROPHONE: Uses the Android microphone implementation, based on the Native Development Kit (NDK) (
ANDROID_MEDIA_PLAYER: Uses the Android media player implementation, based on the NDK and FFmpeg (
ANDROID_DEVICE_INSTALL_PREFIX: The SDK installation path on the Android device or emulator.
Build with Bluetooth
To enable Bluetooth, use this CMake option. Note: Bluetooth is currently only available for Linux and Raspberry Pi.
Build with Alexa for Business (A4B)
To enable A4B support in the SDK, you can use the following CMake command:
By default, this option is
OFF. Turning this option
ON will enable A4B, including support for handling
Logging sensitive data
Logging of potentially sensitive data is disabled by default, but can be enabled in
DEBUG builds by including this
Note: If you want to post logs generated with this setting to a public forum, please be sure to review them and redact any data you consider sensitive before doing so.