[CMake] Nonstandard architectures.

Bill Hoffman bill.hoffman at kitware.com
Fri Sep 28 08:56:33 EDT 2007


Mathias Froehlich wrote:
> Hi,
>
> On Thursday 27 September 2007 16:31, Bill Hoffman wrote:
>   
>>> I think there's a way to tell CMake to either use lib or lib64,
>>> something like LIB_SUFFIX.
>>>       
>> CMake does a test for sizeof void* if it is 8 bytes then lib64 is
>> searched before lib in all FIND_* stuff.
>>     
> That is way too croase and will even bring the wrong results.
>   
It produces good results on linux x64 and itanium platforms.  I have 
tested and used
it on both.  There maybe issues with other platforms.
Right now the code does this:

if(is64bit)
   1. try this: cmSystemTools::ReplaceString(s, "lib/", "lib64/");
   2. try this:  add 64 to the name of the path.

I suppose the lib64 thing could be and the path extension could be 
changed to be
variables that are set in the Platform files.   It also checks to see if 
the above
paths exist before adding them to the search paths.   However, finding a 
library
without testing it with a try_compile will produce incorrect results 
from time
to time.   I am not sure that FIND_LIBRARY should do a try_compile, but
maybe it should....

For win64, the compiler provides an environment for 64 bit building.   
On windows
finding system libraries is not done as much, as there is no /usr/lib.   

-Bill



More information about the CMake mailing list