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 <bouzim@gmail.com>
This commit is contained in:
Michel Zou 2013-08-14 19:28:35 -04:00 committed by Brad King
parent d7c1dfb8f8
commit d7a65a2f2c

View File

@ -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
)