<div class="gmail_quote">On Fri, Oct 9, 2009 at 4:04 PM, 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 5:33 PM, Philip Lowman <<a href="mailto:philip@yhbt.com">philip@yhbt.com</a>> wrote:<br>
> On Fri, Oct 9, 2009 at 4:15 AM, Aleksandr Udovenko <<a href="mailto:udovenkoav@gmail.com">udovenkoav@gmail.com</a>><br>
> wrote:<br>
>><br>
>> 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<br>
>> > <<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>
>> ><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>
>> 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>
><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>
</div></div>STATIC_LIBRARY_FLAGS has act on all target at once. For example on<br>
Debug and Release simultaneously.<br>
But i want same as CMAKE_EXE_LINKER_FLAGS_[CMAKE_BUILD_TYPE], when i<br>
use it i can set linker flag separately for debug and release.<br>
I need the same but for STATIC library.<br></blockquote><div><br>This doesn't appear to be implemented. You could file a feature request if there isn't one already. I believe what you are asking for is support for STATIC_LIBRARY_FLAGS_<BuildType>. There are several target properties that are already build-type aware, so implementing this probably wouldn't be extremely difficult.<br>
<br></div></div>-- <br>Philip Lowman<br>