How to tell CMake which libpng.dylib to use?

Mojca Miklavec mojca at macports.org
Mon Jan 21 13:03:34 PST 2013


Hello,

I'm playing with CMake-based ports (Root in particular). While these
ports work, I noticed the following:
    -- Found JPEG: /opt/local/lib/libjpeg.dylib
    -- Found PNG: /usr/X11R6/lib/libpng.dylib (found version "1.5.4")

Some documentation about searching the libraries is here:
    http://www.cmake.org/Wiki/CMake:How_To_Find_Libraries
All the code that a port uses to find the PNG library is the following:
    find_Package(PNG)
so there is no path or anything else to plug in.

I'm unable to figure out how to tell CMake that it should use a
specific libpng.dylib. The resulting binaries and libraries
consequently link to
    /usr/X11/lib/libpng15.15.dylib
    /usr/X11/lib/libfreetype.6.dylib
    /usr/lib/libz.1.dylib
etc.

I would be grateful for any hints about how to fix this.

Thanks,
    Mojca

PS: as a "side-product" of my attempts I noticed that openexr links to
/usr/lib/libz.1.dylib and mf (part of texlive-basic) links to
libraries like /usr/X11/lib/libXext.6.dylib instead of those in /opt.


More information about the macports-dev mailing list