check_ipo_supported taking a long time


I usually configurate and generate batch of projects with mostly all the same options. I observed that my configuration time was very long (several seconds) for each project.

Doing some profiling, I observed that all the time was taken by try_compile in check_ipo_supported.

Is there a way to safely gain some times (My expectation is that I could check for the first project, then tell the others that ipo is supported)?


[EDIT 1] a bit more details:
In practice, I’ve got a python script that is calling cmake <src dir> -B<build dir> <common options> for a set of projects (only <src dir> and <build dir> are changing from a project to the other).
If the first project to call check_ipo_supported reports a success, I’d like the other calls in the same run not to call check_ipo_supported again but I don’t know how to pass an information from a cmake call to another one.
I could make a fake top CMakeLists.txt containing only add_subdirectories(<src dir> <build dir>) and setting a shared CMake variable at the first call. I don’t know if its possible and, besides, I would prefer to avoid this extraneous CMakeLists.txt (besides I’m not sure about possible conflicts if I configure a project by itself or from the fake top project).
[EDIT 2] as a bonus, I would like to skip compiler detection also as it’s always the same after the first detection. But its less important as this step seems to be fast (at least much faster that IPO detection).