<div class="gmail_quote">On Fri, Oct 9, 2009 at 4:15 AM, Aleksandr Udovenko <span dir="ltr"><<a href="mailto:udovenkoav@gmail.com">udovenkoav@gmail.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;">
<div><div></div><div class="h5">On Fri, Oct 9, 2009 at 10:04 AM, Philip Lowman <<a href="mailto:philip@yhbt.com">philip@yhbt.com</a>> wrote:<br>
> On Wed, Oct 7, 2009 at 11:45 AM, Aleksandr Udovenko <<a href="mailto:udovenkoav@gmail.com">udovenkoav@gmail.com</a>><br>
> wrote:<br>
>><br>
>> I try cmake 2.6, 2.8 for microsoft visual studio 2005,2008.<br>
>> creating library:<br>
>><br>
>> add_library(my_lib STATIC ${CPP_FILES})<br>
>><br>
>> I try send some linker options by set<br>
>><br>
>> set_target_properties(my_lib PROPERTIES LINK_FLAGS "some_opt")<br>
>><br>
>> or<br>
>><br>
>> set_target_properties(my_lib PROPERTIES LINK_FLAGS_<my target><br>
>> "some_opt")<br>
>><br>
>><br>
>> it's ignored, as i understand from source code of vc7generator - it<br>
>> ignored extended and unknown option for static library but it works<br>
>> for exe and shared.<br>
>><br>
>> How i can send my option to linker for static library?<br>
><br>
> You might be able to use this:<br>
> <a href="http://www.cmake.org/cmake/help/cmake-2-8-docs.html#prop_tgt:STATIC_LIBRARY_FLAGS" target="_blank">http://www.cmake.org/cmake/help/cmake-2-8-docs.html#prop_tgt:STATIC_LIBRARY_FLAGS</a><br>
<br>
</div></div>It is not good for me, i NOT need to set linker options globally, i<br>
need to set depend on target. STATIC_LIBRARY_FLAGS don't have <TARGET><br>
expansion.<br>
</blockquote></div><br>
STATIC_LIBRARY_FLAGS is a target property and not global in scope.<br>
<br>
add_library(foo STATIC foo.cc)<br>
set_target_properties(foo PROPERTIES STATIC_LIBRARY_FLAGS "/myflag")<br>
<br>Could you elaborate on what you mean by "<TARGET> expansion"?<br><br>Please reply to the list. Thanks.<br><br>-- <br>Philip Lowman<br>