[CMake] Adding link dependencies to an imported target with target_link_libraries

James Bigler jamesbigler at gmail.com
Mon Dec 8 18:59:13 EST 2008


I seem to recall being able to add dependencies to an imported library with
target_link_libraries with 2.6.2:

add_library(mylib SHARED IMPORTED)

set_target_properties(mylib PROPERTIES
  IMPORTED_LOCATION ${mylib_loc}
  )

target_link_libraries(mylib
  ${DEPENDENT_LIB1}
  )

This seems to generate an error now:

Cannot specify link libraries for target "mylib" which is not built by this

project.

Is this the intended behavior?

I imagine I could do something similar with:

set_target_properties(mylib PROPERTIE
  IMPORTED_LINK_INTERFACE_LIBRARIES ${DEPENDENT_LIB1}
  )

Is this the right way to go about doing this?

Thanks,
James
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://www.cmake.org/pipermail/cmake/attachments/20081208/44a0abec/attachment.htm>


More information about the CMake mailing list