There is a known issue with SDL2_mixer 2.6.3 and 2.8.1 when building via FetchContent in certain environments. The error manifests as:
target pattern contains no '%'. Stop.
This is a CMake/Makefile generation issue in SDL2_mixer's build system, not an issue with stevensSound itself. It is specific to the Unix Makefiles generator.
Switching generators avoids the issue entirely, since it's specific to Makefile generation:
cmake .. -G Ninja
ninjaInstall SDL2 and SDL2_mixer on your system:
Ubuntu/Debian:
sudo apt-get install libsdl2-dev libsdl2-mixer-devmacOS:
brew install sdl2 sdl2_mixerWindows: Download from https://www.libsdl.org/
Then disable FetchContent in CMakeLists.txt and use find_package instead.
- Clone and build SDL2 and SDL2_mixer manually
- Install them to a prefix directory
- Point CMake to that installation:
cmake .. -DCMAKE_PREFIX_PATH=/path/to/sdl/installstevensSound.cpp is a regular translation unit — you can compile it directly instead of using the provided CMakeLists.txt:
g++ -std=c++20 -c stevensSound.cpp -I. -I/path/to/stevensVectorLib -I/path/to/stevensMathLib $(pkg-config --cflags sdl2 SDL2_mixer)
g++ -std=c++20 my_app.cpp stevensSound.o -lSDL2 -lSDL2_mixer -lpthread- ✅ Error handling system
- ✅ Playlist management
- ✅ Sound variants (anti-fatigue random selection)
- ✅ Thread-safe resource management
- ✅ Test suite
- ✅ Benchmark suite
- ✅ Examples
Pitch modulation and RAII wrapper classes were prototyped in earlier revisions but removed — they depended on a since-dropped SoundTouch dependency / were never wired into the public header. See git history if you want to revisit either.
The Makefile-generation issue above is purely with SDL2_mixer's own build scripts, not stevensSound itself.
For production use, we recommend:
- Build via the root CMakeLists.txt with the Ninja generator (see Option 0 above), or
- Install SDL2/SDL2_mixer via your system's package manager and use
find_packageinstead of FetchContent
Both avoid the Makefile-generation issue entirely.
- Consider switching to vcpkg or Conan for dependency management
- Investigate using prebuilt SDL2 binaries
- Add support for multiple dependency management systems