2

I'm trying to apply ExternalProject_Add to automate the installation of dependencies of a mid sized C project. Things were going well until I had to install a library which uses ExternalProject_Add to install one of its dependencies, which also happen to be used by my own project. It would be nice if I could avoid having to rebuild this library, but instead use the already installed version.
Is there a good way to accomplish this? Can I tell ExternalProject to download stuff only if some condition, e.g., library already installed, is not met?

usr1234567
  • 21,601
  • 16
  • 108
  • 128
edu_
  • 850
  • 2
  • 8
  • 16
  • 1
    `Can I tell ExternalProject to download stuff only if some condition (e.g. library already installed) is not met?` Just check condition with `if` command and form parameters for `ExternalProject_Add` accordingly. – Tsyvarev Jun 27 '16 at 21:18
  • Thanks for your comment! I ended up setting a super build with CMake... Something similar to what is described in https://github.com/Sarcasm/cmake-superbuild. This way, I build my own project using external project, and am able to configure the dependencies between all targets. Also, I propagate the locations of already installed dependencies through ExternalProject's CMAKE_ARGS, in order to avoid rebuilding stuff. I can edit my question with more details about the final solution if anyone is interested.. – edu_ Jun 28 '16 at 04:38
  • `I can edit my question with more details about the final solution if anyone is interested.` - On Stack Overflow a question post shouldn't contain the solution. Instead, create answer and describe solution there. *Self-answering* is perfectly OK here. – Tsyvarev Jun 28 '16 at 06:52
  • Wow! That looks like the solution to all my problems! Thank you! – edu_ Jun 28 '16 at 15:01

0 Answers0