Re: [eigen] Eigen in a namespace?

[ Thread Index | Date Index | More Archives ]

Hi Robert,

I believe others will have better suggestions, but in my experience you should seek to have only one copy of Eigen if you can.  For this external project you are bringing in, you can patch their build system so you can specify it manually.  For example, if project Foo is doing something like

    target_include_directories(foo PUBLIC hardcoded/path/to/internal/Eigen)

You can add a simple change that lets your parent project specify it instead:

        target_include_directories(foo PUBLIC hardcoded/path/to/internal/Eigen)
        target_include_idrectories(foo PUBLIC ${FOO_EIGEN_INCLUDE_DIRS})

Then in your parent CMakeLists.txt you can

    set(FOO_EIGEN_INCLUDE_DIRS “the/path/you/need” CACHE STRING “ “ FORCE)

I’d be willing to bet this patch would be accepted by project Foo, since it also lets users explicitly specify from the command line `cmake .. -DFOO_EIGEIN_INCLUDE_DIRS=“/their/desired/path”`.

For the same reason, adding the same bypass for your LSST project might be a good idea (?)

Hope that is useful!


Mail converted by MHonArc 2.6.19+