我的cmake脚本如下:
FIND_PACKAGE(Matlab REQUIRED)
GET_FILENAME_COMPONENT(Matlab_BIN_DIRS ${Matlab_LIBRARIES} PATH)
SET(Matlab_LIBS "${Matlab_BIN_DIRS}/libmat.so ${Matlab_BIN_DIRS}/libmx.so")
INCLUDE_DIRECTORIES(${Matlab_INCLUDE_DIRS})
TARGET_LINK_LIBRARIES(myAPP ${Matlab_LIBRARIES} ${Matlab_LIBS})
在我构建项目时会打印以下错误信息。
:-1: error: No rule to make target '/usr/local/MATLAB/R2015b/bin/glnxa64/libmat.so /usr/local/MATLAB/R2015b/bin/glnxa64/libmx.so', needed by 'cimgio'. Stop.
但是在将最后一行修改为
之后它就起作用了
TARGET_LINK_LIBRARIES(myAPP ${Matlab_LIBRARIES} libmat.so libmx.so)
为什么完整路径在这里不起作用?