Crascit/DownloadProject

Tensorflow Example

Closed this issue · 1 comments

Hi,

Thanks for this nice helper for CMake.

I have a quick question as I wanted to add as a sub-project Tensorflow but the CMakeLists or Makefiles are not located in the root folder.

CMake:
https://github.com/tensorflow/tensorflow/tree/master/tensorflow/contrib/cmake

Makefiles:
https://github.com/tensorflow/tensorflow/tree/master/tensorflow/contrib/makefile

I am interested by both approach as with Makefiles as you can cross-compile for iOS or Android, and CMake manage some dependencies options.

How could I fit both cases with your helpers without beging over complicated ? :-)

Thanks in advance.

Cheers,
Richard

It's not exactly clear what you are trying to achieve and how it relates to DownloadProject. DownloadProject's purpose is to download something at configure time in your main project. This then allows you to add that project immediately via something like add_subdirectory(), which brings certain advantages in some situations (e.g. all CMake targets are immediately visible, all files are available at configure time if you need to read them for some reason). You haven't mentioned any reason why you need the sources for TensorFlow downloaded at configure time, so it is not possible to offer advice on your situation.

If you just want to have TensorFlow built as part of your main build, you may want to consider using the ExternalProject module instead. This is the more usual way to bring in an external project and should be preferred over DownloadProject if it meets your needs, since then everything happens at build time rather than configure time (you normally want the configure stage to be quick).