Skip to content

Commit

Permalink
Add comment explaining NO_IMPLICIT_LINK_TO_MATLAB_LIBRARIES flag
Browse files Browse the repository at this point in the history
  • Loading branch information
sgilmore10 committed Apr 26, 2024
1 parent b935f1b commit 20e93c3
Showing 1 changed file with 16 additions and 0 deletions.
16 changes: 16 additions & 0 deletions libmexclass/cpp/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -241,6 +241,22 @@ macro(libmexclass_client_add_mex_gateway)

MatlabConfigure()

# By default matlab_add_mex automatically links the output MEX function
# against all MEX-related libraries.
#
# These include:
# - libmx
# - libmex
# - libMatlabDataArray
# - libMatlabEngine
#
# However, libMatlabEngine is only required for standalone C++ programs
# that utilize the MATLAB Engine.
#
# Avoid linking against libMatlabEngine by supplying the
# NO_IMPLICIT_LINK_TO_MATLAB_LIBRARIES flag and manually passing
# the required mex-related libraries as arguments for the LINK_TO parameter.
#
matlab_add_mex(NAME ${LIBMEXCLASS_CLIENT_MEX_GATEWAY_NAME}
SRC ${LIBMEXCLASS_CLIENT_MEX_GATEWAY_SOURCES}
OUTPUT_NAME "gateway"
Expand Down

0 comments on commit 20e93c3

Please sign in to comment.