FindMPI is very slow due to testing the compiler every time
I have a project in which there are multiple subdirectories. They are added to the root project using add_subdirectory
. In each subdirectory, find_package(MPI REQUIRED)
is called once. That means for my project, testing the compiler is done many times. How can I disable this check, or at least tell CMake to do this only once?