Re: [eigen] Eigen in a namespace? |
[ Thread Index |
Date Index
| More lists.tuxfamily.org/eigen Archives
]
- To: eigen@xxxxxxxxxxxxxxxxxxx
- Subject: Re: [eigen] Eigen in a namespace?
- From: Stephen McDowell <sjm324@xxxxxxxxxxx>
- Date: Fri, 6 Apr 2018 07:23:27 -0700
- Dkim-signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=cornell.edu; s=g.20171207; h=from:content-transfer-encoding:mime-version:subject:date:references :to:in-reply-to:message-id; bh=ida7oA4DuM7Gbr2nIAkqIYoKvUqLs37o2BZaINz8nmY=; b=ASgz9dZfDLzZ1BxO/l75yn+I5yhmAI5oJ6JRhBXLQDVRwwnfigBJZ8EeOOUTxYadj2 hssKNhGvaDyxTwJAcK2OTMyLNVcs+Nx8usLXs+/V+wKYS3TX3l0ipZURoO+NcnZiU0rC s4SOAQokdxLsR36YdzIVaKT0E53y86YI4Req4miVN3T8qzGoy/NAtZQOJKkJ521p+kvR tI0bzJAwWSpY/cFCKwJKdpvXAWADxVIyJzHhUreJFVp8JmpHOv/ywlBCkNCFWPKTYFuV BLzgcaTqbLNahov9bEC7aIU0Dqq9Maaq5WU7MHrN+U+8ZlAV/+vECmNiK6WRMo8dmSPC 3blw==
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:
if (NOT FOO_EIGEN_INCLUDE_DIRS)
target_include_directories(foo PUBLIC hardcoded/path/to/internal/Eigen)
else()
target_include_idrectories(foo PUBLIC ${FOO_EIGEN_INCLUDE_DIRS})
endif()
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!
-Stephen