Modify CheckCXXLibraryExists to use CMakeFiles directory.