CMake issue: binary (needed during build) links againts /opt/local/lib/foo.dylib

Ryan Schmidt ryandesign at macports.org
Thu Sep 29 19:18:18 PDT 2016


> On Sep 29, 2016, at 8:30 PM, Mojca Miklavec <mojca at macports.org> wrote:
> 
> Hi,
> 
> Under
> https://svn.macports.org/repository/macports/users/mojca/ports/tex/miktex
> 
> I have a preliminary port for MikTeX with the following problem:
>    https://sourceforge.net/p/miktex/bugs/2485/
> 
> The developer was fast in fixing many issues, but this one is
> something that probably doesn't affect linux users, so he cannot
> easily test.
> 
> The problem is that a binary that is needed as part of the build
> procedure gets built and links against /opt/local/lib/something.dylib.
> Usually that would be desired, but in this case the library
> something.dylib cannot be found before the package is installed. The
> build system should thus first give the libraries the id of the build
> path and only fix that at the very end of the build procedure, but
> it's not entirely clear to me how to properly achieve that.
> 
> Does anyone with a deeper understanding of CMake build system have any
> idea what to fix?

The solution is to set DYLD_FALLBACK_LIBRARY_PATH to the path where the library can be found at build time. Set that environment variable at the time that you want to run the program that needs the library.

I don't know how to accomplish that in cmake specifically.




More information about the macports-dev mailing list