On Fri, Oct 9, 2009 at 4:04 PM, Aleksandr Udovenko <udovenk...@gmail.com>wrote:

> On Fri, Oct 9, 2009 at 5:33 PM, Philip Lowman <phi...@yhbt.com> wrote:
> > On Fri, Oct 9, 2009 at 4:15 AM, Aleksandr Udovenko <udovenk...@gmail.com
> >
> > wrote:
> >>
> >> On Fri, Oct 9, 2009 at 10:04 AM, Philip Lowman <phi...@yhbt.com> wrote:
> >> > On Wed, Oct 7, 2009 at 11:45 AM, Aleksandr Udovenko
> >> > <udovenk...@gmail.com>
> >> > wrote:
> >> >>
> >> >> I try cmake 2.6, 2.8 for microsoft visual studio 2005,2008.
> >> >> creating library:
> >> >>
> >> >> add_library(my_lib STATIC ${CPP_FILES})
> >> >>
> >> >> I try send some linker options by set
> >> >>
> >> >> set_target_properties(my_lib  PROPERTIES LINK_FLAGS "some_opt")
> >> >>
> >> >> or
> >> >>
> >> >> set_target_properties(my_lib  PROPERTIES LINK_FLAGS_<my target>
> >> >> "some_opt")
> >> >>
> >> >>
> >> >> it's ignored, as i understand from source code of vc7generator - it
> >> >> ignored extended and unknown option for static library but it works
> >> >> for exe and shared.
> >> >>
> >> >> How i can send my option to linker for static library?
> >> >
> >> > You might be able to use this:
> >> >
> >> >
> http://www.cmake.org/cmake/help/cmake-2-8-docs.html#prop_tgt:STATIC_LIBRARY_FLAGS
> >>
> >> It is not good for me, i NOT need to set linker options globally, i
> >> need to set depend on target. STATIC_LIBRARY_FLAGS don't have <TARGET>
> >> expansion.
> >
> > STATIC_LIBRARY_FLAGS is a target property and not global in scope.
> >
> > add_library(foo STATIC foo.cc)
> > set_target_properties(foo PROPERTIES STATIC_LIBRARY_FLAGS "/myflag")
> >
> > Could you elaborate on what you mean by "<TARGET> expansion"?
> >
> > Please reply to the list. Thanks.
>
> STATIC_LIBRARY_FLAGS has act on all target at once. For example on
> Debug and Release simultaneously.
> But i want same as CMAKE_EXE_LINKER_FLAGS_[CMAKE_BUILD_TYPE], when i
> use it i can set linker flag separately for debug and release.
> I need the same  but for STATIC library.
>

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.

-- 
Philip Lowman
_______________________________________________
Powered by www.kitware.com

Visit other Kitware open-source projects at 
http://www.kitware.com/opensource/opensource.html

Please keep messages on-topic and check the CMake FAQ at: 
http://www.cmake.org/Wiki/CMake_FAQ

Follow this link to subscribe/unsubscribe:
http://www.cmake.org/mailman/listinfo/cmake

Reply via email to