[CMake] set ranlib/ar in toolchain file

Yngve Inntjore Levinsen yngve.levinsen at gmail.com
Thu Jul 5 09:20:09 EDT 2012


Hi Eric,

On Thursday 5. July 2012 10.22.17, Eric Noulard wrote:
> Which ranlib/ar was discovered by CMake?
/usr/bin/ar and /usr/bin/ranlib. I need it to discover the ones with the mingw 
prefix.

> You did not give us the exact command line you use with the output
> given by the cmake run.
The command I use for cmake is simply cmake -DCMAKE_TOOLCHAIN_FILE=<file> 
<sourcepath>. For better understanding what I do wrong, I attach both the now 
working toolchain file I have, and the non-working one.

With the non-working one I get the following grep result afterwards:

$ grep RANLIB **/*
CMakeCache.txt:CMAKE_RANLIB:FILEPATH=/usr/bin/ranlib
CMakeCache.txt://ADVANCED property for variable: CMAKE_RANLIB
CMakeCache.txt:CMAKE_RANLIB-ADVANCED:INTERNAL=1
CMakeFiles/CMakeCCompiler.cmake:SET(CMAKE_RANLIB "/usr/bin/ranlib")
CMakeFiles/CMakeCXXCompiler.cmake:SET(CMAKE_RANLIB "/usr/bin/ranlib")
CMakeFiles/CMakeFortranCompiler.cmake:SET(CMAKE_RANLIB "/usr/bin/ranlib")

With the now working one I get the following result:

$ grep RANLIB **/*                                                                   
CMakeCache.txt:CMAKE_RANLIB:FILEPATH=/usr/bin/i486-mingw32-ranlib
CMakeCache.txt://ADVANCED property for variable: CMAKE_RANLIB
CMakeCache.txt:CMAKE_RANLIB-ADVANCED:INTERNAL=1
CMakeFiles/CMakeCCompiler.cmake:SET(CMAKE_RANLIB "/usr/bin/i486-mingw32-
ranlib")
CMakeFiles/CMakeCXXCompiler.cmake:SET(CMAKE_RANLIB "/usr/bin/i486-mingw32-
ranlib")
CMakeFiles/CMakeFortranCompiler.cmake:SET(CMAKE_RANLIB "/usr/bin/i486-mingw32-
ranlib")

> I can ensure you that on my box the provided toolchain works and
> discover a coherent set of mingw compiler and tools (include ar/ranlib)
> there must be something specific in your case.
OK, perhaps I use different cmake version? I have 2.8.8 installed.

$ uname -a
Linux PCBE13951 3.4.3-1-CHAKRA #1 SMP PREEMPT Mon Jun 18 17:39:58 UTC 2012 
x86_64 GNU/Linux

Best Regards,
Yngve
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://www.cmake.org/pipermail/cmake/attachments/20120705/dd4d9d89/attachment.htm>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: Windows-MinGW32-notworking.cmake
Type: text/x-cmake
Size: 1285 bytes
Desc: not available
URL: <http://www.cmake.org/pipermail/cmake/attachments/20120705/dd4d9d89/attachment.bin>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: Windows-MinGW32.cmake
Type: text/x-cmake
Size: 1069 bytes
Desc: not available
URL: <http://www.cmake.org/pipermail/cmake/attachments/20120705/dd4d9d89/attachment-0001.bin>


More information about the CMake mailing list