Skip to content

Commit

Permalink
- allow creating with undefined lookup
Browse files Browse the repository at this point in the history
  • Loading branch information
fbergmann committed Mar 14, 2023
1 parent 2d63255 commit b51d7ca
Showing 1 changed file with 14 additions and 1 deletion.
15 changes: 14 additions & 1 deletion src/bindings/matlab/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -54,6 +54,12 @@ find_package(Matlab)
option(WITH_MATLAB_UTF8STRING
"Generate Matlab bindings using mxArrayToUTF8String." ON )

# allow using undefined lookup for matlab libraries
if (NOT WIN32)
option(WITH_MATLAB_UNDEFINED_LOOKUP
"Allow undefined lookup for matlab libraries." OFF )
endif()

#
# Determine the matlab installation directory
#
Expand Down Expand Up @@ -115,7 +121,14 @@ foreach(matlab_source_file "TranslateSBML" "OutputSBML")
set_target_properties(matlab_binding_${matlab_source_file} PROPERTIES LINK_FLAGS "/export:mexFunction")
endif()

target_link_libraries(matlab_binding_${matlab_source_file} ${MATLAB_LIBRARIES} ${LIBSBML_LIBRARY}-static)
if (WITH_MATLAB_UNDEFINED_LOOKUP)
if (APPLE)
set_target_properties(matlab_binding_${matlab_source_file} PROPERTIES LINK_FLAGS "-undefined dynamic_lookup")
endif()
target_link_libraries(matlab_binding_${matlab_source_file} ${LIBSBML_LIBRARY}-static)
else()
target_link_libraries(matlab_binding_${matlab_source_file} ${MATLAB_LIBRARIES} ${LIBSBML_LIBRARY}-static)
endif()
install(TARGETS matlab_binding_${matlab_source_file} DESTINATION ${MATLAB_PACKAGE_INSTALL_DIR} )
endforeach()

Expand Down

0 comments on commit b51d7ca

Please sign in to comment.