[CMake] Problems setting -ar -ranlib and other binutils

larrysb at aol.com larrysb at aol.com
Tue Oct 21 16:23:41 EDT 2008


I'm using cmake 2.6.1 under Ubuntu Linux to cross compile for a target. I have a toolchain file which sets the full paths to the cross compiler binaries.The c-compiler and c++ compiler always work and setup correctly and appear in the CMakeCache.txt file. However, the other binutils, such as 'ar', 'ranlib', 'objcopy' and so on, just show up as blank entries in the CMakeCache.txt file.



The CMakeFiles/ directories actually work, except for the link.txt files for the lib portions, which generate everything for the 'ar' command correctly, but simply omit the command itself entirely. After several fidgets with ccmake and manually editing everything in the CMakeCache.txt file with vi, and deleting and regenerating the CMakeFiles/ directory, it will eventually generate the correct link.txt command.




I'm stumped at this point and I need to get this cleaned up so the rest of my team can check out and build the code without manually fussing around with cmake-generated products first. 




For instance: 




Excerpt of cmake-toolchain file:




Toolchain-arm-none-linux-gnueabi.cmake






# specify the cross compiler


SET(CMAKE_AR ${MY_CROSS_DIR}/${MY_CROSS_prefix}ar)


SET(CMAKE_CXX_COMPILER ${MY_CROSS_DIR}/${MY_CROSS_prefix}c++)


SET(CMAKE_C_COMPILER   ${MY_CROSS_DIR}/${MY_CROSS_prefix}gcc)


SET(CMAKE_LINKER ${MY_CROSS_DIR}/${MY_CROSS_prefix}ld)


SET(CMAKE_NM ${MY_CROSS_DIR}/${MY_CROSS_prefix}nm)


SET(CMAKE_OBJCOPY ${MY_CROSS_DIR}/${MY_CROSS_prefix}objcopy)


SET(CMAKE_OBJDUMP ${MY_CROSS_DIR}/${MY_CROSS_prefix}objdump)


SET(CMAKE_RANLIB ${MY_CROS
S_DIR}/${MY_CROSS_prefix}ranlib)


SET(CMAKE_STRIP ${MY_CROSS_DIR}/${MY_CROSS_prefix}strip)




Excerpts of the resulting CMakeCache.txt file:






########################


# EXTERNAL cache entries


########################






//Path to a program.


CMAKE_AR:FILEPATH=




(snip)






//CXX compiler.


CMAKE_CXX_COMPILER:FILEPATH=(my full path to the cross directory)/arm-none-linux-gnueabi-c++




(snip)






//C compiler.


CMAKE_C_COMPILER:FILEPATH=(my full path to the cross directory)/arm-none-linux-gnueabi-gcc




(snip)






//Path to a program.


CMAKE_NM:FILEPATH=


//Path to a program.


CMAKE_OBJCOPY:FILEPATH=


//Path to a program.


CMAKE_OBJDUMP:FILEPATH=


//Path to a program.


CMAKE_STRIP:FILEPATH=




(snip)






//The CMake toolchain file


CMAKE_TOOLCHAIN_FILE:FILEPATH=(path to my toolchain file)/Toolchain-arm-none-linux-gnueabi.cmake















-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://www.cmake.org/pipermail/cmake/attachments/20081021/a150cc65/attachment.htm>


More information about the CMake mailing list