Can’t say for sure, but what I would try:
- Check whether flags set via
add_compile_options
are applied to your targets added viaExternalProject_Add
as well; if not → GOOD! - Otherwise, do you have a list of all your “internal” targets? then you could loop over them and use
target_compile_options
to add the warning flags. - If it’s easier to get a list of all external projects, you could “subtract” that from the list of targets available via
BUILDSYSTEM_TARGETS
(you’d probably have to do this recursively for subdirectories, see also this thread), then use this list to do option 2.