Notes |
|
(0040823)
|
Brad King
|
2016-04-07 11:46
|
|
The purpose of SHELL_PATH is to convert drive letters and slashes. It is not to produce a fully quoted/escaped/etc. path for use on a command line. Typically it is used in a context that has proper escaping done later. Flags given to target_link_libraries is not such a context (for historical reasons).
I'm not familiar with OpenCV's use case but there must be another solution. The -L option is for link directories, and we already have a command for that. CMake encourages use of full paths to libraries so linker search directories are rarely needed.
|
|
|
(0040824)
|
Guillaume Dumont
|
2016-04-07 12:18
|
|
Thanks for answering. I understand that SHELL_PATH was not intended for this use case.
I think OpenCV's use case is to avoid having dependencies to CUDA libraries as an absolute path in the exported targets file so that the package remains relocatable. I assuming that since they extract the libraries name for the paths returned by FindCuda.cmake and add their directory to the link_directories command.
I guess the recommended way would be to export the library names with the full path to libraries. But this is sub-optimal since the package could be relocated anymore?
Or, convert CUDA libraries to imported targets and distribute an appropriately modified FindCuda module with the package? |
|
|
(0040825)
|
Brad King
|
2016-04-07 14:25
|
|
Re 0016053:0040824: Yes, having imported target names as the exported dependencies is a good approach. Of course it is up to their package configuration file to ensure that the imported targets are again made available in the client configuration. |
|
|
(0041199)
|
Kitware Robot
|
2016-06-10 14:21
|
|
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. |
|