[CMake] IMPORTED_LINK_DEPENDENT_LIBRARIES not working anymore?

James Bigler jamesbigler at gmail.com
Wed Mar 13 18:35:28 EDT 2013


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/f59817fd/attachment.htm>


More information about the CMake mailing list