[CMake] how to set ar/ranlib flags per target
Hickel, Kelly
Kelly_Hickel at bmc.com
Wed Jul 21 15:00:23 EDT 2010
Hello,
I'm using CMake 2.8.1, and have a problem on AIX similar to this one:
http://web.archiveorange.com/archive/v/5y7PkUbT6iizO31eshQa .
I have the additional complication of needing to build both 32 and 64
bit libraries from the same set of CMake files.
I've tried a number of things (list below), does anyone have any ideas?
(Wherever I write CMAKE_C_xyz below, I've also changed CMAKE_CXX_xyz
at the same time, where I write xyz_ARCHIVE_CREATE, I've also changed
xyz_ARCHIVE_APPEND)
1) Adding the flag to LINK_FLAGS because the definition for
CMAKE_C_ARCHIVE_CREATE appears to include that on the command line,
but the generated link.txt input files don't include any options.
2) Changed the definition for CMAKE_C_ARCHIVE_CREATE in a private
toolchain file that I specify on the command line. By writing
messages that show the value of that variable, I can see my change
take, but it appears to get reset to the default before processing of
my CMakeLists.txt file begins.
3) Frequently set CMAKE_C_ARCHIVE_CREATE to "<CMAKE_AR> <AR_FLAGS> r
<TARGET> <LINK_FLAGS> <OBJECTS>", when I did this, I ended up with the
literal string "AR_FLAGS" in the link.txt file, not that useful!
I'm sure I'm missing something, any hints will be appreciated!
Thanks,
Kelly
More information about the CMake
mailing list