AVS Device SDK 1.20 CMake Parameters

CMake is a build tool that manages app dependencies and creates native make files suitable for your Alexa Voice Service (AVS) Device SDK project.

This reference describes all the CMake parameters supported on the AVS Device SDK to customize how the SDK builds. Before you use these CMake commands, make sure you have set up your system with the required dependencies to build the SDK.

Android

Use the following CMake parameters to enable and customize a build for Android.

ANDROID

Enables an Android build on an Android device or emulator.

Syntax:

cmake [absolute path to source] -DANDROID=[ON|OFF]                                               

  Parameters:

-DANDROID=
Enable or disable an Android build. Possible Values: ON,OFF. Default value: ON.

ANDROID_LOGGER

Publishes logs using the Android logging facility.

Syntax:

cmake [absolute path to source] -DANDROID_LOGGER=[ON|OFF]                                       

Parameters:

-DANDROID_LOGGER=
Enable or disable Android logs. Possible Values: ON,OFF. Default value: ON.

ANDROID_MICROPHONE

Enable the Android Native Development Kit (NDK) Android microphone.

Syntax:

cmake [absolute path to source] -DANDROID_MICROPHONE=[ON|OFF]                                    

Parameters:

-DANDROID_MICROPHONE=
Enable or disable the Android microphone. Possible Values: ON,OFF. Default value: ON.

ANDROID_DEVICE_INSTALL_PREFIX

The SDK installation path for the Android device or emulator.

Syntax:

cmake [absolute path to source] -DANDROID_DEVICE_INSTALL_PREFIX=[ON|OFF]                                       

Parameters:

-DANDROID_DEVICE_INSTALL_PREFIX=
Possible Values: ON,OFF. Default value: ON.

Audio

Use the following CMake parameters to control audio in the SDK.

GSTREAMER

Enables a reference implementation of GStreamer to control media content, such as Amazon Music.

Syntax:

cmake [absolute path to source] -DGSTREAMER_MEDIA_PLAYER=[ON|OFF]
                                 -DCMAKE_PREFIX_PATH=[absolute path to Gstreamer build]      

Parameters:

-DGSTREAMER_MEDIA_PLAYER=
Enable or disable GStreamer. Possible Values: ON,OFF. Default value: OFF.
-DCMAKE_PREFIX_PATH=
Optional. The absolute path to your GStreamer instance if you installed from source.

PORTAUDIO

Use the following CMake parameters to enable PortAudio so your microphone can capture data.

Syntax:

cmake [absolute path to source] -DPORTAUDIO=[ON|OFF]
                                 -DPORTAUDIO_LIB_PATH=[path to the PortAudio library]  
                                 -DPORTAUDIO_INCLUDE_DIR=[path to the PortAudio directory]                                                

Parameters:

-DPORTAUDIO=
Enable or disable PortAudio. Possible Values: ON,OFF. Default value: ON.
-DPORTAUDIO_LIB_PATH=
The path to your PortAudio library. For example, /home/pi/sdk-folder/third-party/portaudio/lib/.libs/libportaudio.a
-DPORTAUDIO_INCLUDE_DIR=
The path to your PortAudio library include directory. For example, /home/pi/sdk-folder/third-party/portaudio/include

OPUS

Use the following CMake parameters to enable Opus – an interactive audio codec. To enable, you must install the libopus library.

Syntax:

cmake [absolute path to source] -DOPUS=[ON|OFF]                                      

Parameters:

-DOPUS=
Enable or disable PortAudio. Possible Values: ON,OFF. Default value: ON.

ENABLE_SAMPLE_AES

Use the following CMake parameters to enable SAMPLE-AES decryption for HLS playlists. To enable, you must install the FFMPEG dependency.

Syntax:

cmake [absolute path to source] -DENABLE_SAMPLE_AES[ON|OFF]     
                                -DFFMPEG_LIB_PATH=[absolute path to ffmpeg library]
                                -DFFMPEG_INCLUDE_DIR=[absolute path to ffmpeg include directory]            

Parameters:

-DENABLE_SAMPLE_AES=
Enable or disable SAMPLE-AES decryption. Possible Values: ON,OFF. Default value: OFF.
-DFFMPEG_LIB_PATH=
The path to your ffmpeg library.
-DFFMPEG_INCLUDE_DIR=
The path to your ffmpeg library include directory.

Bluetooth

Use the following CMake parameters to enable Bluetooth.

BLUETOOTH_BLUEZ

Bluetooth is optional and only available for Linux and Raspberry Pi. You must install the required dependencies before building with Bluetooth. Bluetooth builds using the BlueZ stack.

Syntax:

cmake [absolute path to source] -DBLUETOOTH_BLUEZ=[ON|OFF]
                                 -DBLUETOOTH_BLUEZ_PULSEAUDIO_OVERRIDE_ENDPOINTS=[ON|OFF]                                             

Parameters:

-DBLUETOOTH_BLUEZ=
Enable or disable the BlueZ Bluetooth stack. Possible Values: ON,OFF. Default value: OFF.
-DBLUETOOTH_BLUEZ_PULSEAUDIO_OVERRIDE_ENDPOINTS=
Optional. Automates the loading and unloading of PulseAudio Bluetooth modules. If you enable this option, the SDK modifies the PulseAudio app. Possible Values: ON,OFF. Default value: OFF.

Build

Use the following CMake parameters to control how the SDK builds.

CMAKE_BUILD_TYPE

Choose the appropriate build type that best fits your requirements.

Syntax:

cmake [absolute path to source] -DCMAKE_BUILD_TYPE=[DEBUG|RELEASE|MINSIZEREL]                                      

Parameters:

-DCMAKE_BUILD_TYPE=
Sets the build type. Possible Values: DEBUG,RELEASE,MINSIZEREL. Default value: RELEASE.
  •   DEBUG – Enables debug mode. Displays DEBUG logs by using the -g compiler flag.
  •   RELEASE – Enables release mode. Adds the -O2 optimization flag and removes the -g logging flag.
  •   MINSIZEREL – Compiles with the RELEASE flag and adds optimizations with the -Os flag for a smaller build size.

A4B

Use the following CMake parameters to enable Alexa for Business (A4B).

Syntax:

cmake [absolute path to source] -DA4B=[ON|OFF]                                      

Parameters:

-DA4B=
Enable or disable A4B. Possible Values: ON,OFF. Default value: OFF. Turning on enables A4B, including support for RevokeAuthorization directives.

Captions

Use the following CMake parameters to enable captions through the Speak Directive.

CAPTIONS

To use captions, you must also install the libwebvtt parsing library.

Syntax:

cmake [absolute path to source] -DCAPTIONS=[ON|OFF]                                      
                                 -DLIBWEBVTT_LIB_PATH[absolute path to webvtt library] 
                                 -DLIBWEBVTT_INCLUDE_DIR[absolute path to webvtt include] 

Parameters:

-DCAPTIONS=
Enable or disable Captions. Possible Values: ON,OFF. Default value: OFF. If CAPTIONS=ON, you must also define LIBWEBVTT_LIB_PATH and LIBWEBVTT_INCLUDE_DIR.
-DLIBWEBVTT_LIB_PATH=
The absolute path to the directory containing the C header files of the libwebvtt library. For example, webvtt/build/src/webvtt/libwebvtt.a.
-DLIBWEBVTT_INCLUDE_DIR=
The absolute path to the prebuilt static library for libwebvtt. For example, webvtt/include.

Custom dependencies

Use the following CMake parameters to customize the dependencies that build with the SDK.

CURL_LIBRARY

Build with a customized version of curl. Without configuring this value, the SDK uses the default packaged version.

Syntax:

cmake [absolute path to source]  -DCURL_LIBRARY=[path to curl library] 
                                  -DCURL_INCLUDE_DIR=[path to curl include directory]                                                                 

Parameters:

-DCURL_LIBRARY=
Path to curl library.
-DCURL_INCLUDE_DIR=
Path to curl include directory.

SQLITE_LIBRARY

Build with a customized version of SQlite. Without configuring this value, the SDK uses the default packaged version.

Syntax:

cmake [absolute path to source] -DSQLITE_LIBRARY=[path to SQlite library] 
                                 -DSQLITE_INCLUDE_DIR=[path to SQlite include directory]                                

Parameters:

-DSQLITE_LIBRARY=
Path to SQlite library.
-DSQLITE_INCLUDE_DIR=
Path to SQlite include directory.

CRYPTO_LIBRARY

Build with a customized version of Crypto. Without configuring this value, the SDK uses the default packaged version.

Syntax:

cmake [absolute path to source]  -DCRYPTO_LIBRARY=[path to crypto library] 
                                  -DCRYPTO_INCLUDE_DIR=[path to crypto include directory]

Parameters:

-DCRYPTO_LIBRARY= 
Path to crypto library.
-DCRYPTO_INCLUDE_DIR=
Path to crypto include directory.

USE_CCACHE

Enable ccache to help speed compile time.

Syntax:

cmake [absolute path to source] -DUSE_CCACHE=[ON|OFF] 

Parameters:

-DUSE_CCACHE=
Enable or disable ccache. Possible Values: ON,OFF. Default value: OFF.

ACSDK_USE_RTTI

Toggles Run Time Type Information (RTTI) in the SDK.

Syntax:

cmake [absolute path to source] -DACSDK_USE_RTTI=[ON|OFF] 

Parameters:

-DACSDK_USE_RTTI=
Enable or disable RTTI. Supported on version 1.20 of the SDK and higher. Possible Values: ON,OFF. Default value: OFF, except for Windows 32 (WIN32) builds, where it must be ON.

RAPIDJSON

Overwrite the default memory allocator for RapidJSON in the SDK.

Syntax:

cmake [absolute path to source] -DRAPIDJSON_MEM_OPTIMIZATION=[ON|OFF]                   

Parameters:

-DRAPIDJSON_MEM_OPTIMIZATION=
Enable or disable memory optimization using RapidJSON. Possible Values: ON,OFF. Default value: ON. To overwrite the default memory allocator, use an OFF value – this builds the SDK with same settings as version 1.19 and lower.

Custom media player

Use the following CMake parameters to enable a custom media player in your build.

CUSTOM_MEDIA_PLAYER

Enables a custom media player.

Syntax:

cmake [absolute path to source]  -DCUSTOM_MEDIA_PLAYER[ON|OFF]
                                  -DEXTENSION_PATH=[path to custom media player] 

Parameters:

-DCUSTOM_MEDIA_PLAYER=
Enable or disable a custom media player. Possible Values: ON,OFF. Default value: OFF.
-DEXTENSION_PATH=
Path to custom media player.

Diagnostics

Enable diagnostics tools – file audio injection, protocol trace, and device properties aggregation. Access these through the diagnostic menu, by pressing o after starting and authorizing the sample app.

Audio injection replaces a real microphone and can't be used if another microphone, such as PortAudio, is enabled. Note that these tools are available in DEBUG mode only, and must not be enabled in devices built for release.

DIAGNOSTICS

Enables diagnostics. Setting this flag to ON enables all diagnostic components by default. To control individual components, use the individual diagnostic flags.

Syntax:

cmake [absolute path to source] -DIAGNOSTICS=[ON|OFF] 
                                 -DCMAKE_BUILD_TYPE=DEBUG

Parameters:

-DIAGNOSTICS=
Enables diagnostics. Possible Values: ON,OFF. Default value: OFF.
-DCMAKE_BUILD_TYPE=
You must enable DEBUG mode when you are using diagnostic tools.

AUDIO_INJECTION

Syntax:

cmake [absolute path to source] -DIAGNOSTICS=[ON|OFF] 
                                 -DAUDIO_INJECTION=[ON|OFF]
                                 -DCMAKE_BUILD_TYPE=DEBUG

Parameters:

-DIAGNOSTICS=
Enables diagnostics. Possible Values: ON,OFF. Default value: OFF.
-DAUDIO_INJECTION=
Enables audio injection. Possible Values: ON,OFF. Default value: OFF. To use this tool, you must NOT enable any other microphone components. If you turn on this flag but also enable a microphone component – for example, PortAudio – audio injection won't work.
-DCMAKE_BUILD_TYPE=
You must enable DEBUG mode when you are using any diagnostic tools.

DEVICE_PROPERTIES

Syntax:

cmake [absolute path to source] -DIAGNOSTICS=[ON|OFF] 
                                -DDEVICE_PROPERTIES=[ON|OFF]
                                -DCMAKE_BUILD_TYPE=DEBUG

Parameters:

-DIAGNOSTICS=
Enables diagnostics. Possible Values: ON,OFF. Default value: OFF.
-DDEVICE_PROPERTIES=
Control device properties. Possible Values: ON,OFF. Default value: OFF.
-DCMAKE_BUILD_TYPE=
You must enable DEBUG mode when you are using any diagnostic tools.

PROTOCOL_TRACE

Syntax:

cmake [absolute path to source] -DIAGNOSTICS=[ON|OFF] 
                                -DPROTOCOL_TRACE=[ON|OFF]
                                -DCMAKE_BUILD_TYPE=DEBUG

Parameters:

-DIAGNOSTICS=
Enables diagnostics. Possible Values: ON,OFF. Default value: OFF.
-DDEVICE_PROPERTIES
Control protocol trace. Possible Values: ON,OFF. Default value: OFF.
-DCMAKE_BUILD_TYPE=
You must enable DEBUG mode when you are using any diagnostic tools.

Endpoints

Use the following CMake parameters to enable Smart Home endpoints in your build.

ENABLE_ALL

Syntax:

cmake [absolute path to source] -DENABLE_ALL_ENDPOINT_CONTROLLERS=[ON|OFF]                              

Parameters:

-DENABLE_ALL_ENDPOINT_CONTROLLERS=
Enable or disable all endpoints. Possible Values: ON,OFF. Default value: OFF. You must always toggle this command to ON, even if you only want to turn on a single endpoint.

TOGGLE_CAPABILITY

Syntax:

cmake [absolute path to source] -DENABLE_ALL_ENDPOINT_CONTROLLERS=[ON|OFF]
                                -DENDPOINT_CONTROLLERS_TOGGLE_CAPABILITY=[ON|OFF]                      

Parameters:

-DENABLE_ALL_ENDPOINT_CONTROLLERS=
Enable or disable endpoints. Possible Values: ON,OFF. Default value: OFF.
-DENDPOINT_CONTROLLERS_TOGGLE_CAPABILITY=
Enable or disable capability controller endpoints. Possible Values: ON,OFF. Default value: OFF.

MODE_CONTROLLER

Syntax:

cmake [absolute path to source] -DENABLE_ALL_ENDPOINT_CONTROLLERS=[ON|OFF]
                                -DENDPOINT_CONTROLLERS_MODE_CONTROLLER=ON=[ON|OFF]                          

Parameters:

-DENABLE_ALL_ENDPOINT_CONTROLLERS=
Enable or disable endpoints. Possible Values: ON,OFF. Default value: OFF.
-DENDPOINT_CONTROLLERS_MODE_CONTROLLER=ON=
Enable or disable mode controller endpoints. Possible Values: ON,OFF. Default value: OFF.

RANGE_CONTROLLER

Syntax:

cmake [absolute path to source] -DENABLE_ALL_ENDPOINT_CONTROLLERS=[ON|OFF]
                                -DENDPOINT_CONTROLLERS_RANGE_CONTROLLER=[ON|OFF]                          

Parameters:

-DENABLE_ALL_ENDPOINT_CONTROLLERS=
Enable or disable endpoints. Possible Values: ON,OFF. Default value: OFF.
-DENDPOINT_CONTROLLERS_RANGE_CONTROLLER=
Enable or disable range controller endpoints. Possible Values: ON,OFF. Default value: OFF.

POWER_CONTROLLER

Syntax:

cmake [absolute path to source] -DENABLE_ALL_ENDPOINT_CONTROLLERS=[ON|OFF]
                                -DENDPOINT_CONTROLLERS_POWER_CONTROLLER=[ON|OFF]                    

Parameters:

-DENABLE_ALL_ENDPOINT_CONTROLLERS=
Enable or disable all endpoints. Possible Values: ON,OFF. Default value: OFF.
-DENDPOINT_CONTROLLERS_POWER_CONTROLLER=
Enable or disable power controller endpoints. Possible Values: ON,OFF. Default value: OFF.

Logs

Use the following CMake parameters to control how the SDK manages logs.

To specify a debug log level, append the DEBUG command when you invoke the sample app. You can set a DEBUG value from 1 to 9.

For example

./SampleApp/src/SampleApp ./Integration/AlexaClientSDKConfig.json DEBUG9

EMIT_SENSITIVE_LOGS

Syntax:

cmake [absolute path to source] -DACSDK_EMIT_SENSITIVE_LOGS=[ON|OFF]                    

Parameters:

-DACSDK_EMIT_SENSITIVE_LOGS=
Enable of disable logging of sensitive data. For example, usernames, client IDs, or refresh tokens. Possible Values: ON,OFF. Default value: OFF. Only available with DEBUG build enabled.

Wake word

Use the following CMake parameters to customize the wake word used by the SDK. The SDK supports the Sensory wake word engine.

KEY_WORD_DETECTOR

Syntax:

cmake [absolute path to source] -DSENSORY_KEY_WORD_DETECTOR=ON
                                -DSENSORY_KEY_WORD_DETECTOR_LIB_PATH=[absolute path to library]
                                -DSENSORY_KEY_WORD_DETECTOR_INCLUDE_DIR=[absolute path to include directory]

Parameters:

-DSENSORY_KEY_WORD_DETECTOR=
Enable or disable the Sensory wake word engine. Possible Values: ON,OFF. Default value: OFF.
-DSENSORY_KEY_WORD_DETECTOR_LIB_PATH=
Path to the sensory wake word detector library.
-DSENSORY_KEY_WORD_DETECTOR_INCLUDE_DIR=
Path to the sensory wake word detector include directory