[Cmake] how to instruct the gnu linker (ld) to search an archive for multiple times

Bill Hoffman bill . hoffman at kitware . com
Mon, 16 Jun 2003 14:18:23 -0400


You should be able to add it to the CMAKE_CXX_EXE_LINKER_FLAGS.
However, it would not be that portable, as it is possible to use
gcc with with system linkers, also, I guess you would have to repeate
<archives>.   

You may be able to list the libraries more than once to get the same effect.

TARGET_LINK_LIBRARIES(foo bar foo bar foo bar)
That would scan foo and bar three times.
It would also work for other linkers than gnu ld.


-Bill


At 11:25 AM 6/16/2003, ¤lÁž wrote:
>By default, the gnu linker (ld) will only search the archives listed 
>by -l options only once. However, i need the archives to be searched 
>for multiple times (ld option --start-group <archives...> --end-
>group). how can i make the cmake to pass this hint to the linker?
>-- 
>Tzu-Chien Chiu
>XGI Technology, Inc.
>
>
>_______________________________________________
>Cmake mailing list
>Cmake at public . kitware . com
>http://public . kitware . com/mailman/listinfo/cmake