[CMake] How do you handle recursive dependencies in CMake

Raymond Wan rwan.work at gmail.com
Thu Jun 30 07:05:47 EDT 2016


Hi Sven,


On Thu, Jun 30, 2016 at 6:40 PM, Sven Baars <s.baars at rug.nl> wrote:
> So let's take Trilinos as an example, which is quite a big library,
> which depends on a lot of libraries as well. In every project that
> builds upon it (but does not even use functionality of any libraries),
> we would have to set: SCALAPACK_ROOT, LAPACK_ROOT, BLAS_ROOT,
> BOOST_ROOT, GTEST_ROOT, BLACS_ROOT, UMFPACK_ROOT, MKL_ROOT, etc... and
> then inside the CMakeFiles.txt do a find_package(Trilinos),
> find_package(Scalapack), find_package(LAPACK), etc... just to compile
> int main() {} with one call to a Trilinos function inside of it. I'd say
> that it should be enough to just do a find_package(Trilinos).


Perhaps I'm alone here, but I actually don't see this as being a "big" problem.

For the environment variables, you can place them all in a bash script
and source it during log in.

For all of the Find_Package calls, they only matter whenever you have
to re-run cmake.  I don't know what Trilinos is, but for something
that big, I presume it takes more time to compile it (during active
development) than to run cmake to look through all those paths...

Ray


More information about the CMake mailing list