tensorpipe icon indicating copy to clipboard operation
tensorpipe copied to clipboard

CMake: config file is not installed along targets file

Open SpaceIm opened this issue 5 years ago • 1 comments

Installing TensorpipeTargets.cmake and TensorpipeTargets-<mode>.cmake is useless if a config file including TensorpipeTargets.cmake is not installed with these files: https://cmake.org/cmake/help/latest/command/find_package.html#full-signature-and-config-mode

You might also want to export tensorpipe target with a namespace to follow best practices (and add an alias target to be consistent between add_subdirectory() and find_package()).

Last but not least, you might want to properly find dependencies (cuda, libuv & libnop) in these files for consumers using this config file.

SpaceIm avatar Mar 15 '21 14:03 SpaceIm

I must admit that none of us is really knowledgeable about CMake, hence we did originally try to follow best practices and good idioms, but ended up not managing (partly due to the fact that many of them rely on newer versions of CMake, and we're stuck with v3.5), thus we mostly ended up copy-pasting from another PyTorch subproject, Gloo and eventually just settled for something that "works" (i.e., builds correctly with PyTorch) and stopped there.

You seem to be more experienced with CMake than we are, and all your suggestions are definitely something we'd be interested in! However, if you really want to see them happen in TensorPipe, the best thing would be to contribute them, as we probably won't get to them for now... Sorry about that.

lw avatar Mar 16 '21 08:03 lw