MantisBT - CMake
View Issue Details
0016097CMakeCMakepublic2016-05-09 10:312016-06-10 14:31
Nils Gladitz 
Kitware Robot 
normalmajoralways
closedmoved 
CMake 3.5.1 
 
0016097: FindCUDA.cmake implicit target_link_libraries() can not be mixed with new signature
e.g. CUDA_ADD_LIBRARY currently implicitly links to the CUDA libraries with:
  target_link_libraries(${cuda_target} ${CUDA_LIBRARIES})

Afterwards additional libraries can not be linked with the newer PRIVATE|PUBLIC|INTERFACE signature (since signatures can not be mixed).

It would be nice if one of these keywords could be added to the implicit target_link_libraries() calls upon user request.
cmake_minimum_required(VERSION 3.5.1)

find_package(CUDA REQUIRED)

file(WRITE my_cuda_lib.cpp "")
cuda_add_library(my_cuda_lib SHARED my_cuda_lib.cpp)

file(WRITE some_other_lib.cpp "")
add_library(some_other_lib SHARED some_other_lib.cpp)

# The plain signature for target_link_libraries has already been used with
# the target "my_cuda_lib". All uses of target_link_libraries with a target
# must be either all-keyword or all-plain.

target_link_libraries(my_cuda_lib PRIVATE some_other_lib)
No tags attached.
Issue History
2016-05-09 10:31Nils GladitzNew Issue
2016-06-10 14:29Kitware RobotNote Added: 0043000
2016-06-10 14:29Kitware RobotStatusnew => resolved
2016-06-10 14:29Kitware RobotResolutionopen => moved
2016-06-10 14:29Kitware RobotAssigned To => Kitware Robot
2016-06-10 14:31Kitware RobotStatusresolved => closed

Notes
(0043000)
Kitware Robot   
2016-06-10 14:29   
Resolving issue as `moved`.

This issue tracker is no longer used. Further discussion of this issue may take place in the current CMake Issues page linked in the banner at the top of this page.