From d7a65a2f2cdaf36e42fe9c0d2a9ff55fecb79dc4 Mon Sep 17 00:00:00 2001 From: Michel Zou Date: Wed, 14 Aug 2013 19:28:35 -0400 Subject: [PATCH] FortranCInterface: Fix cross-compiling Linux to MinGW (#14358) After building the test binary tell find_program to search for it with the ${CMAKE_EXECUTABLE_SUFFIX} so that the .exe can be found. Since find_program is normally used to locate host tools while cross-compiling it needs this hint to find the target binary. Suggested-by: Denis Barbier --- Modules/FortranCInterface/Detect.cmake | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Modules/FortranCInterface/Detect.cmake b/Modules/FortranCInterface/Detect.cmake index 798c44caa..afeb9c588 100644 --- a/Modules/FortranCInterface/Detect.cmake +++ b/Modules/FortranCInterface/Detect.cmake @@ -49,7 +49,7 @@ unset(FortranCInterface_COMPILED CACHE) # Locate the sample project executable. if(FortranCInterface_COMPILED) find_program(FortranCInterface_EXE - NAMES FortranCInterface + NAMES FortranCInterface${CMAKE_EXECUTABLE_SUFFIX} PATHS ${FortranCInterface_BINARY_DIR} ${FortranCInterface_BINARY_DIR}/Debug NO_DEFAULT_PATH )