Cmake Parameters

CMake is a build tool that manages your application's dependencies and creates native makefiles suitable for the platform you're building on. It's an easy way to create and build projects using the AVS Device SDK for C++.

Use the following cmake variables to customize how your SDK builds.

Builds

The AVS SDK supports the CMAKE_BUILD_TYPE parameter. You can build the SDK with different Cmake configurations. By default, the SDK builds using the RELEASE flag.

Feature Parameter Use Example
Sets the default build type CMAKE_BUILD_TYPE Use the -D. at the front of your cmake command

DEBUG - Enables logging. Shows debug logs with -g compiler flag.

RELEASE - Adds -O2 flag and removes -g flag.

MINISIZEREL - Compiles with RELEASE flags and optimizations (-Os) for a smaller build size
cmake \ [absolute-path-to-source] -DCMAKE_BUILD_TYPE=DEBUG

Logs

You can control how the SDK manages logs.

Feature Parameter Use Example
Specify a debug log level when you invoke the sample app. Choose a number from 0-9. The higher the number, the more information that's shown DEBUG[x] DEBUG0,DEBUG1,DEBUG2,DEBUG3,DEBUG4,DEBUG5,DEBUG6,DEBUG7,DEBUG8,DEBUG9 cmake \ -./SampleApp/src/SampleApp ./Integration/AlexaClientSDKConfig.json DEBUG9
Log sensitive data logging in Debug builds. Turned OFF by default ACSDK_EMIT_SENSITIVE_LOGS - OFF
- ON

IMPORTANT: Make sure your redact any sensitive data if you are posting these logs publicly
cmake \ -DACSDK_EMIT_SENSITIVE_LOGS=ON

Bluetooth

Bluetooth is only available for Linux and Raspberry Pi. To build with Bluetooth, make sure you install the required dependencies before trying these commands.

Feature Parameter Use Example
Enables Bluetooth, based on BlueZ BLUETOOTH_BLUEZ - OFF
- ON
Off by default
cmake \ -DBLUETOOTH_BLUEZ=ON
Automates loading and unloading of PulseAudio Bluetooth modules. BLUETOOTH_BLUEZ_PULSEAUDIO_OVERRIDE_ENDPOINTS - OFF
- ON
Off by default

IMPORTANT: By enabling this option, the AVS Device SDK for C++ makes modifications to the PulseAudio application
cmake \ -DBLUETOOTH_BLUEZ_PULSEAUDIO_OVERRIDE_ENDPOINTS=ON

Audio

Feature Parameter Use Example
Enables a reference implementation of the GStreamer GSTREAMER_MEDIA_PLAYER - OFF
- ON
Off by default
cmake \ -DGSTREAMER_MEDIA_PLAYER=ON

If GStreamer is installed from source, specify the prefix path cmake \ -DCMAKE_PREFIX_PATH==[absolute-path-to-GStreamer-build]
Enables PortAudio PORTAUDIO_LIB_PATH: Specifies the path to the PortAudio library.

Specifies the path to the PortAudio directory: PORTAUDIO_INCLUDE_DIR
- OFF
- ON
On by default
cmake \ [absolute-path-to-source] -DPORTAUDIO=ON -DPORTAUDIO_LIB_PATH=[absolute-path]/portaudio/lib/.libs/libportaudio.a -DPORTAUDIO_INCLUDE_DIR=[absolute-path]/portaudio/include

Wake word

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.

Feature Parameter Use Example
Enables wake word during build {WAKEWORD}_KEY_WORD_DETECTOR - OFF
- ON
OFF by default
cmake \ -D{WAKEWORD}_KEY_WORD_DETECTOR=ON
Enable Sensory WAKEWORD Replace [SENSORY] with your wake word detector variable
cmake \ [absolute-path-to-source] -DSENSORY_KEY_WORD_DETECTOR=ON
Enables KITT.ai WAKEWORD Replace [KITTAI] with your wake word detector variable cmake \ [absolute-path-to-source] -DKITTAI_KEY_WORD_DETECTOR=ON

Extra Parameters

  • [wake-word-name]_KEY_WORD_DETECTOR_LIB_PATH=[absolute-path-to-lib]
    • The path to the wake word detector library.
  • [wake-word-name]_KEY_WORD_DETECTOR_INCLUDE_DIR=[absolute-path-to-include-dir]
    • The path to the wake word detector include directory.

Example

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

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

Captions

Feature Parameter Use Example
Enables Captions CAPTIONS=ON - OFF
- ON
Off by default
cmake \ -DCAPTIONS=ON -DLIBWEBVTT_INCLUDE_DIR=/absolute/path/to/webvtt/include -DLIBWEBVTT_LIB_PATH=/absolute/path/to/webvtt/build/src/webvtt/libwebvtt.a

If CAPTIONS=ON , you must also define LIBWEBVTT_LIB_PATH and LIBWEBVTT_INCLUDE_DIR
The absolute path to the prebuilt static library for libwebvtt LIBWEBVTT_LIB_PATH Required if CAPTION=ON, otherwise ignore cmake \ -DCAPTIONS=ON -DLIBWEBVTT_LIB_PATH=/absolute/path/to/webvtt/build/src/webvtt/libwebvtt.a
The absolute path to the directory containing the C header files of the libwebvtt library LIBWEBVTT_INCLUDE_DIR Required if CAPTION=ON, otherwise ignore cmake \ -DCAPTIONS=ON -DLIBWEBVTT_INCLUDE_DIR=/[absolute path to webvtt]/include

Metrics

Feature Parameter Use Example
Enable metrics recording METRICS - OFF
- ON
Off by default
cmake \ -DMETRICS=ON

Endpoints

SDK supports the following endpoint controller capabilities: Toggle, Mode and Range. You can also test them in the Sample app.

Feature Parameter Use Example
Enable all endpoints ENABLE_ALL_ENDPOINT_CONTROLLERS - OFF
- ON
Off by default
cmake \ /[path to source]/-DENABLE_ALL_ENDPOINT_CONTROLLERS=ON
Enable toggle endpoints ENDPOINT_CONTROLLER_TOGGLE_CAPABILITY - OFF
- ON
Off by default
cmake \ /[path to source]/-DENDPOINT_CONTROLLER_TOGGLE_CAPABILITY=ON
Enable mode endpoints ENDPOINT_CONTROLLER_MODE_CONTROLLER - OFF
- ON
Off by default
cmake \ /[path to source]/-DENDPOINT_CONTROLLER_MODE_CONTROLLER=ON
Enable range endpoints ENDPOINT_CONTROLLER_RANGE_CONTROLLER - OFF
- ON
Off by default
cmake \ /[path to source]/-DENDPOINT_CONTROLLER_RANGE_CONTROLLER=ON
Enable power endpoints ENDPOINT_CONTROLLERS_POWER_CONTROLLER - OFF
- ON
Off by default
cmake \ /[path to source]/-DENDPOINT_CONTROLLERS_POWER_CONTROLLER=ON

Android

Use the following parameters when you're creating an Android build of the SDK.

Feature Parameter Use Example
Enables the Android build ANDROID - OFF
- ON
Off by default
cmake \ -DANDROID=ON
Publishes logs using the Android logging facility ANDROID_LOGGER - OFF
- ON
ON by default
cmake \ ANDROID_LOGGER
Uses the Android microphone implementation, based on the Native Development Kit (NDK) ANDROID_MICROPHONE - OFF
- ON
ON by default
cmake \ ANDROID_MICROPHONE
Uses the Android microphone implementation, based on the Native Development Kit (NDK) ANDROID_MEDIA_PLAYER - OFF
- ON
ON by default
cmake \ ANDROID_MEDIA_PLAYER
The SDK installation path on the Android device or emulator ANDROID_DEVICE_INSTALL_PREFIX - OFF
- ON
ON by default
cmake \ ANDROID_DEVICE_INSTALL_PREFIX

Additional options

You can build the SDK with the following options. To enable these features, you can include these variables in your CMake build:

Feature Parameter Use Example
Alexa for Business (A4B) DA4B - OFF
- ON
Off by default. Turning on enables A4B, including support for RevokeAuthorization directives.
cmake \ -DA4B=ON
Opus

Opus is an interactive audio codec that is supported by the AVS SDK v1.11 +.
OPUS - OFF
- ON
Off by default. To enable Opus, you must install libopus
cmake \ -DOPUS=ON
SAMPLE-AES decryption

Opus is an interactive audio codec that is supported by the AVS SDK v1.11 +.
ENABLE_SAMPLE_AES - OFF
- ON
Off by default. To enable SAMPLE-AES decryption for HLS playlists, the FFMPEG dependency is required, and the build options FFMPEG_INCLUDE_DIR & FFMPEG_LIB_PATH must be provided.
cmake \ -DENABLE_SAMPLE_AES=ON -DFFMPEG_INCLUDE_DIR=[absolute-path-to-ffmpeg-include-dir] -DFFMPEG_LIB_PATH=[absolute-path-to-ffmpeg-lib]