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

Alexander Neundorf neundorf at kde.org
Tue Jul 26 16:55:00 EDT 2011


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).


Alex



More information about the cmake-developers mailing list