Skip to content

Commit 21f68f2

Browse files
authored
Merge pull request #1818 from BDoignies/TargetAlias2
Target alias v2
2 parents 55cdb2d + 838ea88 commit 21f68f2

4 files changed

Lines changed: 17 additions & 2 deletions

File tree

ChangeLog.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,9 @@ git remote set-head origin -a
2424
- *Geometry*
2525
- ConvexityHelper::computeLatticePolytope can now outputs exact lattice polytopes for k-dimensional sets of points in dD, whenever k in 0,1,d-1,d (Jacques-Olivier Lachaud, [#1803](https://github.com/DGtal-team/DGtal/pull/1803))
2626

27+
- *Build*
28+
- New DGtal::DGtal target (Bastien Doignies, [#1818](https://github.com/DGtal-team/DGtal/pull/1818))
29+
2730
- *Documentation*
2831
- Refactoring of the volumetric examples in the Shortcuts (David Coeurjolly, [#1807](https://github.com/DGtal-team/DGtal/pull/1807))
2932
- Removing the doxygen image includes for the latex target (David Coeurjolly, [#1811](https://github.com/DGtal-team/DGtal/pull/1811))
@@ -40,6 +43,7 @@ git remote set-head origin -a
4043

4144
- *Build*
4245
- Version is now extracted from the `VERSION` file for CMake and Python builds (Bastien Doignies, [#1810](https://github.com/DGtal-team/DGtal/pull/1810))
46+
- Eigen is now properly fetched when DGTAL_ITK_WITH_EIGEN is set (Bastien Doignies, [#1818](https://github.com/DGtal-team/DGtal/pull/1818))
4347
- Replacing the global compilation flags when `DGTAL_WARNINGS_AS_ERRORS` is set, with per target `target_compile_options` to avoid errors on Boost warnings (David Coeurjolly, [#1793](https://github.com/DGtal-team/DGtal/pull/1793))
4448
- Fixing the `make install` command for boost (issue #1794) (Bastien Doignies, [#1793](https://github.com/DGtal-team/DGtal/pull/1793))
4549
- Add and fix install commands for polyscope dependencies (Bastien Doignies, [#1815](https://github.com/DGtal-team/DGtal/pull§1815))

cmake/CheckDGtalDependencies.cmake

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -56,5 +56,8 @@ endif()
5656
# Fetching Eigen3
5757
# -----------------------------------------------------------------------------
5858
include(eigen)
59-
set(DGtalLibDependencies ${DGtalLibDependencies} Eigen3::Eigen)
60-
target_compile_definitions(DGtal PUBLIC "-DDGTAL_WITH_EIGEN=true")
59+
target_compile_definitions(DGtal PUBLIC "-DDGTAL_WITH_EIGEN=true")
60+
if (TARGET Eigen3::Eigen)
61+
set(DGtalLibDependencies ${DGtalLibDependencies} Eigen3::Eigen)
62+
target_link_libraries(DGtal PUBLIC Eigen3::Eigen)
63+
endif()

cmake/CheckDGtalOptionalDependencies.cmake

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -115,6 +115,13 @@ if (DGTAL_WITH_ITK)
115115
target_link_libraries(DGtal PUBLIC ${ITK_LIBRARIES})
116116
set(DGtalLibDependencies ${DGtalLibDependencies} ${ITK_LIBRARIES})
117117
target_compile_definitions(DGtal PUBLIC -DDGTAL_WITH_ITK)
118+
119+
if (DGTAL_WITH_EIGEN_ITK)
120+
set(Eigen3_DIR ${ITKInternalEigen3_DIR})
121+
find_package(Eigen3 REQUIRED CONFIG)
122+
set(DGtalLibDependencies ${DGtalLibDependencies} Eigen3::Eigen)
123+
target_link_libraries(DGtal PUBLIC Eigen3::Eigen)
124+
endif()
118125

119126
# -------------------------------------------------------------------------
120127
# ITK 5.0 adds "/usr/lib/x86_64-linux-gnu/include" to include path which

src/DGtal/CMakeLists.txt

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@ if (DGTAL_BUILD_SHARED_LIBS)
33
else()
44
add_library(DGtal STATIC helpers/StdDefs.cpp)
55
endif()
6+
add_library(DGtal::DGtal ALIAS DGtal)
67

78
if( CMAKE_SYSTEM_PROCESSOR STREQUAL "x86_64" )
89
# Add -fPIC

0 commit comments

Comments
 (0)