the target. If you don't want to do that (or can't, as in your case),
you can use the LINK_FLAGS target property instead.
Post by Robert DaileyI have attached a small CMake project that reproduces the issue I'm
referring to. Please take a look :)
---------
Robert Dailey
I forgot to say that the main issue is that my /NODEFAULTLIB link
flag isn't showing up in visual studio.
---------
Robert Dailey
Another issue...
At what point is it most important for the values of
CMAKE_SHARED_LINK_FLAGS to exist? I set the value of this
variable before my call to add_library(), however after that at
some point the flags will get reverted because I'm stepping out
of function scope. Does it need to exist up to the end of the
current cmake script? My flow is basically this (pseudo call
Enter CMakeLists.txt
- Call define_project() function (in a separate cmake module)
- - Call ignore_libs() function
- - - Set CMAKE_SHARED_LINK_FLAGS with PARENT_SCOPE
- - Call create_target() function
- - - Call add_library() command
Leave CMakeLists.txt
I've done some testing and I find that before the call to
add_library(), my flags are setup properly in the
CMAKE_SHARED_LINK_FLAGS variable.
---------
Robert Dailey
> On Mon, Dec 12, 2011 at 2:10 PM, David Cole
>
>
> CMAKE_SHARED_LINKER_FLAGS and
CMAKE_MODULE_LINKER_FLAGS (and their
> per-config variants) for SHARED and MODULE library
targets as well.
>
> Use CMAKE_SHARED_LINKER_FLAGS instead.
>
>
> Thanks for the information guys. I'm having a minor
problem with these
> variables though.
>
>
> set( CMAKE_SHARED_LINKER_FLAGS
${CMAKE_SHARED_LINKER_FLAGS}
> /NODEFAULTLIB:\"${lib}\" )
>
> Prior to calling the set above, the shared linker flags
>
> /STACK:10000000 /machine:X86
>
>
> /STACK:10000000 /machine:X86 ;/NODEFAULTLIB:"LIBC"
>
> For some reason a semi-colon is being inserted prior to
the
> /NODEFAULTLIB part. I don't know why this is happening but
visual studio
> is complaining about it. Any reason why this is happening?
Thanks.
>
That's how CMake works.
set(VAR val1 val2 val3)
defines a *list* where the elements are separated by a
semi-colon (;).
set(VAR "val1 val2 val3")
Michael
--
Powered by www.kitware.com <http://www.kitware.com>
Visit other Kitware open-source projects at
http://www.kitware.com/opensource/opensource.html
http://www.cmake.org/Wiki/CMake_FAQ
http://www.cmake.org/mailman/listinfo/cmake