# How to make FindOpenAL prefer OpenAL Soft on macOS

**URL:** https://discourse.cmake.org/t/how-to-make-findopenal-prefer-openal-soft-on-macos/618
**Category:** Usage
**Created:** [February 12, 2020, 10:58am UTC](https://discourse.cmake.org/t/how-to-make-findopenal-prefer-openal-soft-on-macos/618 "2020-02-12T10:58:51Z")
**Posts on this page:** 2
**Page:** 1

<div class="post-metadata">

### Author: ![McSinyx](https://discourse.cmake.org/user_avatar/discourse.cmake.org/mcsinyx/32/364_2.png) [@McSinyx](https://discourse.cmake.org/u/McSinyx)
#### Post date: [February 12, 2020, 10:58am UTC](https://discourse.cmake.org/t/how-to-make-findopenal-prefer-openal-soft-on-macos/618/1 "2020-02-12T10:58:51Z")

</div>

With `openal-soft` installed from Homebrew, setting `OPENALDIR=$(brew --prefix openal-soft)` does not seem to have any effect. This is tested on Travis for Alure (see [builds 133 to 137](https://travis-ci.org/kcat/alure/pull_requests)).

This is originally opened as issue [20334](https://gitlab.kitware.com/cmake/cmake/issues/20334) but was then classified by maintainer as a question.

---

<div class="post-metadata">

### Author: ![brad.king](https://discourse.cmake.org/user_avatar/discourse.cmake.org/brad.king/32/11_2.png) [@brad.king](https://discourse.cmake.org/u/brad.king)
#### Post date: [February 12, 2020, 1:55pm UTC](https://discourse.cmake.org/t/how-to-make-findopenal-prefer-openal-soft-on-macos/618/2 "2020-02-12T13:55:50Z")

</div>

I’ve re-opened the issue because the priority of the `OPENALDIR` environment variable does not seem to be high enough.

In general however find modules don’t have such project-specific environment variables. To control the search paths, see the [find\_package](https://cmake.org/cmake/help/v3.16/command/find_package.html#search-procedure) command documentation on search procedure. One can add the installation prefixes of dependencies to `CMAKE_PREFIX_PATH` either in the environment or as a cache entry (it is a `;`-separated list). Or, with policy [CMP0074](https://cmake.org/cmake/help/v3.16/policy/CMP0074.html) set to `NEW` one can use the [`<PackageName>_ROOT`](https://cmake.org/cmake/help/v3.16/variable/PackageName_ROOT.html) cache entry or environment variable. It would be called `OpenAL_ROOT` in this case.
