[CMake] IMPORTED_LINK_DEPENDENT_LIBRARIES not working anymore?

James Bigler jamesbigler at gmail.com
Wed Mar 13 19:08:19 EDT 2013


I determined that this failed starting in 2.8.7 (2.8.6 has the cudart
library on the link line, and 2.8.7 didn't).  I didn't see anything
particular about changes to the IMPORT libraries to suggest why this might
have happened.  I'll try and rig up a reproducer.

I did notice that there wasn't a test for
IMPORTED_LINK_DEPENDENT_LIBRARIES aside
from trying to create a circular dependency between a single library.


On Wed, Mar 13, 2013 at 4:35 PM, James Bigler <jamesbigler at gmail.com> wrote:

> I used the following code in 2.8.4, but in 2.8.9 and 2.8.10 it doesn't add
> the CUDA_CUDART_LIBRARY library to the eventual link line.  I see my target
> linking against the parallelprim library but not the cudart library.  Did
> something change in the interface between 2.8.4 and now?
>
> I'll continue to try and narrow down the version of CMake where this
> stopped working.
>
>     # Create an imported static target
>     add_library(parallelprim STATIC IMPORTED)
>     # This library pertains to all configurations
>     set_property(TARGET parallelprim APPEND PROPERTY
> IMPORTED_CONFIGURATIONS NOCONFIG)
>     # Set the location
>     set_target_properties(parallelprim PROPERTIES
>       IMPORTED_LOCATION_NOCONFIG "${PARALLELPRIM_LIBRARY}")
>     # Set list of dependent libraries (parallelprim needs cudart)
>     set_target_properties(parallelprim PROPERTIES
>       IMPORTED_LINK_DEPENDENT_LIBRARIES ${CUDA_CUDART_LIBRARY})
>
> I also tried this and it didn't work:
>
>     # Create an imported static target
>     add_library(parallelprim STATIC IMPORTED)
>     # Set the location
>     set_target_properties(parallelprim PROPERTIES
>       IMPORTED_LOCATION "${PARALLELPRIM_LIBRARY}")
>     # Set list of dependent libraries (parallelprim needs cudart)
>     set_target_properties(parallelprim PROPERTIES
>       IMPORTED_LINK_DEPENDENT_LIBRARIES ${CUDA_CUDART_LIBRARY})
>
> Thanks,
> James
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://www.cmake.org/pipermail/cmake/attachments/20130313/ad0b6bda/attachment.htm>


More information about the CMake mailing list