Setting output directory variables causes try_compile to fail when attempting to copy program
In my project I set CMAKE_ARCHIVE_OUTPUT_DITRECTORY_DEBUG, CMAKE_LIBRARY_OUTPUT_DIRECTORY_DEBUG, and CMAKE_RUNTIME_OUTPUT_DIRECTORY_DEBUG to ${CMAKE_BINARY_DIR}/bin in my toolchain file so that all of my binaries go to the same folder.
I discovered that FindMPI.cmake will fail when those variables are set because try_compile will not be able to find the test program that it compiles when it attempts to copy it.
I can find the test program in CMakeFiles/CMakeTmp/bin
Unsetting those 3 variables resolves the issue.
Edited by Mind ya bidness