Windows librarian options issue

I am building a static library in windows:

add_library(somelib STATIC asource.cpp)

I would like to use the /NODEFAULTLIB option with the librarian command of windows so I call:



target_link_options(somelib PUBLIC /NODEFAULTLIB)

In both case cmake ignores and does not add the above option to the lib.exe command.
Do I have to add a custom command to do that?

Any idea?

Static libraries have their own specific link options. Use the target property STATIC_LINK_OPTIONS for that purpose.

Nice, thank you Mark.