How to properly find freetype with FindFreetype.cmake?

Michael Dickens michaelld at macports.org
Fri Nov 22 12:29:26 PST 2013


Hi Mojca - Usually with CMake, if you add -DFREETYPE_LIBRARY=FOO cmake
will accept your setting for FREETYPE_LIBRARY directly -- without doing
searches or other checks.  It also looks from FindFreetype.cmake like
you can set FREETYPE_DIR in the environment as the primary hint to CMake
where to look.  After issuing the cmake command, look at the resulting
CMakeCache.txt file for the specific names to be setting via -D...=... .
 Hope this helps! - MLD

On Fri, Nov 22, 2013, at 03:15 PM, Mojca Miklavec wrote:
> one of the packages uses
>     find_package(Freetype)
> and consequently ends up with
> 
>  FREETYPE_INCLUDE_DIR_freetype2   /usr/X11R6/include/freetype2
>  FREETYPE_INCLUDE_DIR_ft2build    /usr/X11R6/include
>  FREETYPE_LIBRARY                 /usr/X11R6/lib/libfreetype.dylib
> 
> The function find_package(Freetype) reads
>     /opt/local/share/cmake-2.8/Modules/FindFreetype.cmake
> which has the X11R6 paths hardcoded.
> 
> What is the proper way to fix this? Patch CMake libraries? Specifying
> all the variables "manually" in the Portfile?
> 
> (A slightly bigger problem are actually 61 other X11-related libraries
> all ending up in /usr/X11R6, but I first need to figure out how these
> are generated.)


More information about the macports-dev mailing list