CMake can't find IMPORTED library
可以将文章内容翻译成中文,广告屏蔽插件可能会导致该功能失效(如失效,请关闭广告屏蔽插件后再试): 问题: In foo/CMakeLists.txt , based on this and this , I have the following SET (EXTERNAL_LIB_ROOT "../../external_libs/") ADD_LIBRARY (avcodec-debug STATIC IMPORTED) SET_PROPERTY ( TARGET avcodec-debug PROPERTY IMPORTED_LOCATION ${EXTERNAL_LIB_ROOT}/libavcodec-0.8.10.a) In bar/CMakeLists.txt I have this: # old way uses system libraries #TARGET_LINK_LIBRARIES (bar avformat avcodec avutil) # new way uses local debug builds TARGET_LINK_LIBRARIES (bar avformat avcodec-debug avutil) When I run make I get /usr/bin/ld: cannot find -lavcodec-debug If I