[cmake-developers] The lib64 case

Brad King brad.king at kitware.com
Mon Mar 26 08:52:59 EDT 2012


On 3/26/2012 8:28 AM, Rolf Eike Beer wrote:
>> The find_library command automatically searches "lib" under each path
>> in CMAKE_SYSTEM_PREFIX_PATH and CMAKE_PREFIX_PATH.  Any path that has
>> "lib" in it will first be transformed to "lib64" when the above property
>> is ON.  Using "PATH_SUFFIXES lib64 lib" is not necessary to get lib64
>> to be searched.
>
> Is this also true for everything passed in with PATHS or HINTS?

Yes.  The lib->lib64 translation is a special case in the find_library
command.  It occurs at the very end, even after PATH_SUFFIXES.

>>> Is same is true for find_path() and include suffix?
>>
>> There is no automatic translation to "include64".  However the command
>> will search "include" under each prefix as above so one does not need
>> to write "PATH_SUFFIXES include" to search<prefix>/include with the
>> find_path command.
>
> The question was just about the automatic appending, not include64 ;) So: does
> it add everything in PATH_SUFFIXES (which automatically includes "include") to
> paths specified by PATHS and HINTS?

No.  Each find command documents an ordered list of steps it follows
to add search paths.  A couple of them in find_path take the prefix
paths and add "include" to each entry.  Other steps add the HINTS
and PATHS values.  The PATH_SUFFIXES are added to all of them.

-Brad



More information about the cmake-developers mailing list