[cmake-developers] Lots of unnecessary search PATHS in FindGIF.cmake and FindFreetype.cmake ?

Eric Wing ewmailing at gmail.com
Wed Jul 27 02:44:00 EDT 2011


On 7/26/11, Alexander Neundorf <neundorf at kde.org> wrote:
> Hi,
>
> I just had a look at FindGIF.cmake and FindFreetype.cmake.
> Both have similar code:
>
> FIND_LIBRARY(GIF_LIBRARY
>   NAMES ${POTENTIAL_GIF_LIBS}
>   HINTS
>   $ENV{GIF_DIR}
>   PATH_SUFFIXES lib64 lib
>   PATHS
>   ~/Library/Frameworks
>   /Library/Frameworks
>   /usr/local
>   /usr
>   /sw
>   /opt/local
>   /opt/csw
>   /opt
>   [HKEY_LOCAL_MACHINE\\SYSTEM\\CurrentControlSet\\Control\\Session\
> Manager\\Environment;OSG_ROOT]
>   /usr/freeware
> )
>
>
> FIND_LIBRARY(FREETYPE_LIBRARY
>   NAMES freetype libfreetype freetype219
>   HINTS
>   $ENV{FREETYPE_DIR}
>   PATH_SUFFIXES lib64 lib
>   PATHS
>   /usr/local/X11R6
>   /usr/local/X11
>   /usr/X11
>   /sw
>   /usr/freeware
> )
>
>
> AFAICT, /usr, /usr/local, /opt, /opt/csw are all in the default set of
> search
> paths anyway (see UnixPaths.cmake), and /sw and /opt/local are in
> Darwin.cmake, so they all can be removed ?
>
> This would leave only /usr/freeware, the registry key, and the
> /usr/local/X11
> dirs.
>
> What about /Library/Frameworks ? Isn't that also searched by default on the
> Max ?
>
>
> What about the two PATH_SUFFIXES lib64 and lib ? They shouldn't be
> necessary.
> Or, how is lib64 handled if I just give "/some/dir/lib" as argument to PATHS
> ?
> Is a lib64 version then checked too ? (I think no, but I'm not sure).
>

Most of those probably can be removed safely. Those modules were
written in another era when CMake had very little in the common core
and no Mac OS X Framework support.

That HKEY OSG_ROOT shouldn't be there. I don't know how that got snuck
in. I was advocating for generic things like $ENV{GIF_DIR}. But now
that it is there...I'm not sure about removing it.

/usr/freeware was added because I think I got complaints from IRIX and
Gentoo users?
I forgot which platforms used /usr/local/X11. (Does/did FreeBSD use this one?)

I was never clear on how the lib64 vs lib thing worked. (On Mac, we
use Fat/Universal binaries so the whole problem is invisible.)


-Eric
-- 
Beginning iPhone Games Development
http://playcontrol.net/iphonegamebook/



More information about the cmake-developers mailing list