Hacker News new | past | comments | ask | show | jobs | submit login

In my experience, ExternalProject_Add() isn't a lot of boilerplate. You specify the source, target dir, and other stuff can be optional.



It's been a while since I've done this kind of CMake in anger, but I recall my main gripe with ExternalProject_Add is that it can't leverage that the external project is a CMake project and I still end up hard coding paths.


Not sure if this can help you, but I simply use

  function (AddDependency name)
     add_subdirectory(${PROJECT_SOURCE_DIR}/deps/${name})
     include_directories(${PROJECT_SOURCE_DIR}/deps/${name}/include)
  endfunction (AddDependency)
And then use git submodule to clone all the dependencies I need in the deps folder. Everything then works automagically (assuming that the dependency is built through CMake).




Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: