How to tell CMake which libpng.dylib to use?

Mojca Miklavec mojca at macports.org
Mon Jan 21 14:24:41 PST 2013


Dear Michael,

On Mon, Jan 21, 2013 at 10:14 PM, Michael Dickens wrote:
> Hi Mojca - In the top build directory there will be a file
> CMakeCache.txt.  Look in this file for whatever you want, and there will
> be a CMake define associated with it in the style of
> "FOO[stuff]=/usr/X11R6/lib/libpng.dylib".  When you issue the cmake
> command, add in "-DFOO=/opt/local/lib/libpng.dylib" (or, whatever your
> correction is), run the CMake command, and then verify from the
> CMakeCache.txt file that it's correct.  Most of the time this will work;
> rarely it won't and you have to find other ways around the issue. - MLD

Thank you very much. The magic turned out to give the correct result:
    -DPNG_LIBRARY=/opt/local/lib/libpng.dylib \
    -DPNG_PNG_INCLUDE_DIR=/opt/local/include

(The only thing I wonder is: isn't there some way to set those
variables "globally" somewhere, so that it doesn't have to be repeated
by every single program/port? ;)

Mojca


More information about the macports-dev mailing list