Why does CMake display $BUILD_PREFIX & $PREFIX instead of full library paths?


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.

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


-- 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.

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

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!

You are indeed correct! It’s done here in conda-build. Thanks again.