jrl-umi3218 / jrl-cmakemodules

CMake utility toolbox
https://jrl-cmakemodules.readthedocs.io/en/master/
Other
59 stars 47 forks source link

ADD_PROJECT_DEPENDENCY: add FIND_EXTERNAL #497

Closed nim65s closed 3 years ago

nim65s commented 3 years ago

Hi,

This PR allow:

ADD_PROJECT_DEPENDENCY(cppad REQUIRED FIND_EXTERNAL CppAD)

This will automatically add cmake/find-external/CppAD to the current CMAKE_MODULE_PATH, and install that directory into the CONFIG_INSTALL_DIR and set up the right CMAKE_MODULE_PATH for dependent packages.

This way, if a package A depends on eg. CppAD, and a package B depends on A, B will easily find CppAD exactly as A did.

FIx: https://github.com/loco-3d/ndcurves/pull/50 https://github.com/Gepetto/example-robot-data/pull/53 https://github.com/loco-3d/multicontact-api/pull/20