fix eigen include when Eigen3::Eigen is defined#10
Merged
jdumas merged 2 commits intolibigl:masterfrom Oct 18, 2019
Merged
Conversation
following libigl.cmake line 98~108
```
# Eigen
if(TARGET Eigen3::Eigen)
# If an imported target already exists, use it
target_link_libraries(igl_common INTERFACE Eigen3::Eigen)
else()
igl_download_eigen()
target_include_directories(igl_common SYSTEM INTERFACE
$<BUILD_INTERFACE:${LIBIGL_EXTERNAL}/eigen>
$<INSTALL_INTERFACE:include>
)
endif()
```
when add libigl as a subproject by calling add_subdirectory(), if Eigen3::Eigen is already defined then libigl.cmake won't download Eigen and would only link to Eigen3::Eigen, in this case CoMiSo's eigen include would fail because `${CMAKE_CURRENT_SOURCE_DIR}/../eigen` doesn't exists
Contributor
Author
|
@jdumas could you please take a look at the PR when you have time? shouldn't break anything and it would be useful for projects that depend on libigl by invoking add_subdirectory |
Collaborator
|
Yes. I'm actually thinking that a "better" fix might be to always define a For example, the # Eigen
if(NOT TARGET Eigen3::Eigen)
igl_download_eigen()
add_library(Eigen3_Eigen SYSTEM INTERFACE
$<BUILD_INTERFACE:${LIBIGL_EXTERNAL}/eigen>
$<INSTALL_INTERFACE:include>
)
add_library(Eigen3::Eigen ALIAS Eigen3_Eigen)
endif()
target_link_libraries(igl_common PUBLIC Eigen3::Eigen)Would you mind creating a PR for that and updating this one accordingly? |
ShuangLiu1992
added a commit
to ShuangLiu1992/libigl
that referenced
this pull request
Sep 27, 2019
libigl/CoMISo#10 fix Eigen include issue for CoMISo when libigl is being added as a subproject via invoking add_subdirectory, while the master project has already defined Eigen3::Eigen
5 tasks
Contributor
Author
|
please take a look at this PR: libigl/libigl#1299 |
jdumas
pushed a commit
to libigl/libigl
that referenced
this pull request
Oct 18, 2019
* Update libigl.cmake libigl/CoMISo#10 fix Eigen include issue for CoMISo when libigl is being added as a subproject via invoking add_subdirectory, while the master project has already defined Eigen3::Eigen * Update libigl.cmake * Update libigl.cmake * Update libigl.cmake
jdumas
approved these changes
Oct 18, 2019
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
following libigl.cmake line 98~108
when add libigl as a subproject by calling add_subdirectory(), if Eigen3::Eigen is already defined then libigl.cmake won't download Eigen and would only link to Eigen3::Eigen, in this case CoMiSo's eigen include would fail because
${CMAKE_CURRENT_SOURCE_DIR}/../eigendoesn't exists