In CMake, you can make TARGET_INCLUDE_DIRECTORIES()
add include directories as system include directories (i.e. use -isystem
) in order to not let warnings pop up which have their root in 3rd party code:
TARGET_INCLUDE_DIRECTORIES(mytarget
SYSTEM
${3rdPartyLib_INCLUDE_DIR})
I prefer to use TARGET_LINK_LIBRARIES
which also makes include directories from 3rd party libraries available.
As far as I know, TARGET_LINK_LIBRARIES
does not support the SYSTEM
modifier to add those directories as a system include directories.
Did I get something wrong?
Is there a way to make:
TARGET_LINK_LIBRARIES(mytarget
${3rdPartyLib_INCLUDE_DIR})
use -isystem
? (or any other way to suppress warnings from 3rdPartyLib
).