From cd89193699b92e89be69951f37c362cf319dea72 Mon Sep 17 00:00:00 2001 From: Charlie Vanaret Date: Mon, 2 Dec 2024 21:08:52 +0100 Subject: [PATCH] Finally figured out how to link the Fortran compiler when static libraries are linked --- CMakeLists.txt | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index 78bb4408..716c45c2 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -207,7 +207,10 @@ endif() add_library(uno STATIC ${UNO_SOURCE_FILES}) set_property(TARGET uno PROPERTY POSITION_INDEPENDENT_CODE ON) target_include_directories(uno PUBLIC ${DIRECTORIES}) -target_link_libraries(uno PUBLIC ${LIBRARIES}) +target_link_libraries(uno PUBLIC ${LIBRARIES} + # link Fortran compiler even when static libraries are linked + ${CMAKE_Fortran_IMPLICIT_LINK_LIBRARIES} +) ###################### # optional AMPL main #