CMake Setup
Note
Make sure you followed the installation instructions first before to continue this setup. If you encounter problems, please ask for support in our Discord server.
After the SDK has been successfully installed, it can be used into CMake-based projects. You should make sure that
the AM_SDK_PATH
environment variable is set before to configure your project. If not, you can manually set it as a
CMake variable using the CLI:
Or directly in your CMakeLists.txt
file:
After the AM_SDK_PATH
variable is set, you should add the path to CMake scripts provided by the SDK to the
current CMAKE_MODULE_PATH
variable. For example:
This will make available the FindAmplitudeAudioSDK.cmake
and the DetectAmplitudeVersion.cmake
scripts.
You can now call the find_package
CMake function to make the SDK libraries available to your project:
After this call, 2 libraries will be available:
SparkyStudios::Audio::Amplitude::SDK::Shared
: Amplitude Audio SDK as a shared library. You can link to this library if you intend to use plugins, or you don’t want static linking.SparkyStudios::Audio::Amplitude::SDK::Static
: Amplitude Audio SDK as a static library. Linking to this library will make your project unable to load plugins at runtime, as they need dynamic linking to work properly.
You just have to pick the one which suits the best to your needs and link your project with it:
Now you can use the SDK in your project!