alsa is compatible with built-in CMake targets: find_package(ALSA REQUIRED) target_link_libraries(main PRIVATE ALSA::ALSA) # since CMake 3.12