mirror of
https://github.com/reactos/CMake.git
synced 2025-02-19 11:00:58 +00:00
Merge topic 'FortranCInterface-cross-compile'
8e2683cf6d FortranCInterface: Fix broken search for test exe when cross-compiling Acked-by: Kitware Robot <kwrobot@kitware.com> Merge-request: !4404
This commit is contained in:
commit
fb377ab5ef
@ -101,3 +101,7 @@ set_property(TARGET symbols PROPERTY POSITION_INDEPENDENT_CODE 1)
|
||||
# Require symbols through Fortran.
|
||||
add_executable(FortranCInterface main.F call_sub.f ${call_mod})
|
||||
target_link_libraries(FortranCInterface PUBLIC symbols)
|
||||
|
||||
file(GENERATE OUTPUT exe-$<CONFIG>.cmake CONTENT [[
|
||||
set(FortranCInterface_EXE "$<TARGET_FILE:FortranCInterface>")
|
||||
]])
|
||||
|
@ -43,17 +43,11 @@ set(FortranCInterface_COMPILED ${FortranCInterface_COMPILED})
|
||||
unset(FortranCInterface_COMPILED CACHE)
|
||||
|
||||
# Locate the sample project executable.
|
||||
set(FortranCInterface_EXE)
|
||||
if(FortranCInterface_COMPILED)
|
||||
find_program(FortranCInterface_EXE
|
||||
NAMES FortranCInterface${CMAKE_EXECUTABLE_SUFFIX}
|
||||
PATHS ${FortranCInterface_BINARY_DIR} ${FortranCInterface_BINARY_DIR}/Release
|
||||
NO_DEFAULT_PATH
|
||||
)
|
||||
set(FortranCInterface_EXE ${FortranCInterface_EXE})
|
||||
unset(FortranCInterface_EXE CACHE)
|
||||
include(${FortranCInterface_BINARY_DIR}/exe-Release.cmake OPTIONAL)
|
||||
else()
|
||||
set(_result "Failed to compile")
|
||||
set(FortranCInterface_EXE)
|
||||
file(APPEND ${CMAKE_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/CMakeError.log
|
||||
"Fortran/C interface test project failed with the following output:\n"
|
||||
"${FortranCInterface_OUTPUT}\n")
|
||||
|
Loading…
x
Reference in New Issue
Block a user