How to tell CMake which libpng.dylib to use?

Mojca Miklavec mojca at macports.org
Tue Jan 22 00:06:08 PST 2013


On Tue, Jan 22, 2013 at 2:35 AM, Ryan Schmidt wrote:
> On Jan 21, 2013, at 16:24, Mojca Miklavec wrote:
>
>> 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? ;)
>
> The program you're currently investigating calls those settings PNG_LIBRARY and PNG_PNG_INCLUDE_DIR but other projects might call them something different.

No, those are not the project's variables. These all come from cmake. The file
    /opt/local/share/cmake-2.8/Modules/FindPNG.cmake
in particular. There a huge number of files
    /opt/local/share/cmake-2.8/Modules/Find***.cmake
that come with CMake and those are supposed to be used to find certain
libraries. The libraries that aren't covered must come from the
project though.

What I really wonder is if there is some global setting that would
choose the libraries in /opt/local rather that the one in /usr when
there is more than one library installed. Or if there should be one.

Mojca


More information about the macports-dev mailing list