Building 3rd party libraries for roborio with Gradle

Hello,

I was thinking on adding the Eigen library to our c++ code base. I was wondering if there was a way to build and link to the project using the gradle build system or a 3rd party library system. I am not too familiar with gradle but I was reading the documentation and it seems like I would need to create a gradle project to build it and then link it separately. Is that the best route?

You can add the Eigen library in a folder called thirdparty/include (in include because Eigen is header-only) in your main project directory. Then you can modify your build.gradle to make Gradle include the headers in the thirdparty/include directory.

Team 3512 has a great example of this. Here is where they add the thirdparty/include directory to the exported headers list in their build.gradle. Here is their thirdparty/include folder with the Eigen library.

1 Like

Thanks for the help! They even used the units library I had planned on using. I will definetly look through their source code

1 Like