Commit bda5e2ac authored by Nikolaj Fogh's avatar Nikolaj Fogh Committed by Brad King
Browse files

FindMatlab: Only include engine and dataarray libraries if they are found

parent adc6a4c5
......@@ -1067,7 +1067,12 @@ function(matlab_add_mex)
target_include_directories(${${prefix}_NAME} PRIVATE ${Matlab_INCLUDE_DIRS})
if(Matlab_HAS_CPP_API)
target_link_libraries(${${prefix}_NAME} ${Matlab_ENGINE_LIBRARY} ${Matlab_DATAARRAY_LIBRARY})
if(Matlab_ENGINE_LIBRARY)
target_link_libraries(${${prefix}_NAME} ${Matlab_ENGINE_LIBRARY})
endif()
if(Matlab_DATAARRAY_LIBRARY)
target_link_libraries(${${prefix}_NAME} ${Matlab_DATAARRAY_LIBRARY})
endif()
endif()
target_link_libraries(${${prefix}_NAME} ${Matlab_MEX_LIBRARY} ${Matlab_MX_LIBRARY} ${${prefix}_LINK_TO})
......@@ -1726,7 +1731,6 @@ if(Matlab_HAS_CPP_API)
DOC "MatlabEngine Library"
NO_DEFAULT_PATH
)
list(APPEND _matlab_required_variables Matlab_ENGINE_LIBRARY)
if(Matlab_ENGINE_LIBRARY)
set(Matlab_ENGINE_LIBRARY_FOUND TRUE)
endif()
......@@ -1740,7 +1744,6 @@ if(Matlab_HAS_CPP_API)
DOC "MatlabDataArray Library"
NO_DEFAULT_PATH
)
list(APPEND _matlab_required_variables Matlab_DATAARRAY_LIBRARY)
if(Matlab_DATAARRAY_LIBRARY)
set(Matlab_DATAARRAY_LIBRARY_FOUND TRUE)
endif()
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment