Compiler warning flags for all except ExternalProjects

Can’t say for sure, but what I would try:

  1. Check whether flags set via add_compile_options are applied to your targets added via ExternalProject_Add as well; if not → GOOD!
  2. 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.
  3. 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.