cmopts_target_link_system_libraries#
Link multiple library targets as system libraries (which suppresses their warnings).
cmopts_target_link_system_libraries(<target>
<PRIVATE|PUBLIC|INTERFACE> <item>...
[<PRIVATE|PUBLIC|INTERFACE> <item>...]...)
The function accepts the same arguments as target_link_libraries.
Note
It is worth to mention that this method is implemented on aminya’s project_options CMake module side and cmopts
package simply aliases target_link_system_libraries
method.
Arguments#
The named <target>
must have been created by a command such as add_executable or add_library and must not be an ALIAS target.
The PUBLIC
, PRIVATE
and INTERFACE
scope keywords can be used to specify both the link dependencies and the link interface in one command.
Libraries and targets following PUBLIC
are linked to, and are made part of the link interface.
Libraries and targets following PRIVATE
are linked to, but are not made part of the link interface.
Libraries following INTERFACE
are appended to the link interface and are not used for linking <target>
.
Output#
The include directories of the library are included as SYSTEM
to suppress their warnings.