# Why does CMake display $BUILD\_PREFIX & $PREFIX instead of full library paths?

**URL:** https://discourse.cmake.org/t/why-does-cmake-display-build-prefix-prefix-instead-of-full-library-paths/8386
**Category:** Usage
**Created:** [June 22, 2023, 8:24am UTC](https://discourse.cmake.org/t/why-does-cmake-display-build-prefix-prefix-instead-of-full-library-paths/8386 "2023-06-22T08:24:11Z")
**Posts on this page:** 4
**Page:** 1

<div class="post-metadata">

### Author: ![martyngigg](https://discourse.cmake.org/user_avatar/discourse.cmake.org/martyngigg/32/3544_2.png) [@martyngigg](https://discourse.cmake.org/u/martyngigg)
#### Post date: [June 22, 2023, 8:24am UTC](https://discourse.cmake.org/t/why-does-cmake-display-build-prefix-prefix-instead-of-full-library-paths/8386/1 "2023-06-22T08:24:11Z")

</div>

Hi,

I’m using CMake to cross-compile a library with conda-build. Everything seems to build just fine on one machine but I notice that during the configure step where I would usually expect full paths to found compilers and libraries it instead prints `$BUILD_PREFIX/bin/...` or `$PREFIX/lib/...` e.g.

```auto
-- Check for working CXX compiler: $BUILD_PREFIX/bin/arm64-apple-darwin20.0.0-clang++ - skipped`

```

and

```auto
-- Found HDF5: $PREFIX/lib/libhdf5_cpp.dylib;$PREFIX/lib/libhdf5.dylib (found version "1.12.2") found components: CXX HL
-- Found ZLIB: $PREFIX/lib/libz.dylib (found version "1.2.13")

```

where `$BUILD_PREFIX` and `$PREFIX` are defined in the environment by `conda-build`.

On another machine this replacement doesn’t happen and full paths are printed and the build gets errors. I’ve not observed this replacement of part of paths with environment variables before and could not find any documentation or parts of the CMake source that suggest when it occurs. Could anyone shed some light on this.

Many thanks.

---

<div class="post-metadata">

### Author: ![ben.boeckel](https://discourse.cmake.org/letter_avatar_proxy/v4/letter/b/ea5d25/32.png) [@ben.boeckel](https://discourse.cmake.org/u/ben.boeckel)
#### Post date: [June 25, 2023, 7:56pm UTC](https://discourse.cmake.org/t/why-does-cmake-display-build-prefix-prefix-instead-of-full-library-paths/8386/2 "2023-06-25T19:56:43Z")

</div>

Is Conda running CMake itself? I wonder if it doesn’t do this replacement on output it generates to help with log comparisons/compressions…

---

<div class="post-metadata">

### Author: ![martyngigg](https://discourse.cmake.org/user_avatar/discourse.cmake.org/martyngigg/32/3544_2.png) [@martyngigg](https://discourse.cmake.org/u/martyngigg)
#### Post date: [June 26, 2023, 8:59am UTC](https://discourse.cmake.org/t/why-does-cmake-display-build-prefix-prefix-instead-of-full-library-paths/8386/3 "2023-06-26T08:59:58Z")

</div>

It’s not running it directly but rather runs a `build.sh` script that might invoke cmake or other tools. I’d not thought that maybe it does just do a blanket replacement of paths that match but that does sound like a likely cause. That should be easy to test.

I seem to have one environment that does not do this so I was trying to find out what the cause was and investigate. Thanks for the pointer!

---

<div class="post-metadata">

### Author: ![martyngigg](https://discourse.cmake.org/user_avatar/discourse.cmake.org/martyngigg/32/3544_2.png) [@martyngigg](https://discourse.cmake.org/u/martyngigg)
#### Post date: [June 26, 2023, 9:12am UTC](https://discourse.cmake.org/t/why-does-cmake-display-build-prefix-prefix-instead-of-full-library-paths/8386/4 "2023-06-26T09:12:39Z")

</div>

You are indeed correct! It’s done [here](https://github.com/conda/conda-build/blob/3690323a9d65f876af0d1e3236d08776994655ac/conda_build/utils.py#L229) in `conda-build`. Thanks again.
