[CMake] how to add additional linker options

Glenn Coombs glenn.coombs at gmail.com
Thu Aug 11 06:35:33 EDT 2011


Something like this:

if (MSVC)
        set(CMAKE_EXE_LINKER_FLAGS "${CMAKE_EXE_LINKER_FLAGS}
/FORCE:Multiply")
endif()

in your top level CMakeLists.txt should do the trick.  I think the /W0 flag
will suppress any warnings.  This would need to be added to CMAKE_C_FLAGS
and/or CMAKE_CPP_FLAGS in a similar manner.

--
Glenn

On 9 August 2011 17:46, Vinay Raj Hampapur <vinayraj.hampapur at gmail.com>wrote:

> Hello,
>     I need to add to provide additional linker options to the program from
> within my CMakeLists.txt targeted at MSVC platform. In particular, I would
> like to add the /FORCE:Multiply option to the linker. How would I go about
> doing this?
> Also, how would I set the options to suppress any (all) warnings generated?
>
> Thanks,
> Vinay
>
> _______________________________________________
> 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
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://www.cmake.org/pipermail/cmake/attachments/20110811/f0c2c9b1/attachment.htm>


More information about the CMake mailing list