File: Drop-Eigen3-Eigen-link.patch

package info (click to toggle)
slic3r-prusa 2.9.4%2Bdfsg-1
  • links: PTS, VCS
  • area: main
  • in suites: sid
  • size: 202,944 kB
  • sloc: cpp: 535,667; ansic: 71,269; yacc: 1,311; makefile: 256; lex: 241; sh: 113
file content (59 lines) | stat: -rw-r--r-- 2,355 bytes parent folder | download | duplicates (2)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
From: Chow Loong Jin <hyperair@debian.org>
Date: Sun, 22 Sep 2024 19:24:43 +0800
Subject: Fix Eigen3-related build errors

FindEigen3.cmake doesn't define Eigen3::Eigen, so cmake throws an error when
this is linked against, so drop all Eigen3::Eigen linking requests, since eigen3
is a header-only library anyway.

Additionally, add ${EIGEN3_INCLUDE_DIR} to target_include_directories wherever
needed.
---
 bundled_deps/admesh/CMakeLists.txt | 3 +--
 src/clipper/CMakeLists.txt         | 3 +--
 src/libslic3r/CMakeLists.txt       | 2 +-
 3 files changed, 3 insertions(+), 5 deletions(-)

diff --git a/bundled_deps/admesh/CMakeLists.txt b/bundled_deps/admesh/CMakeLists.txt
index cfe5f85..aac52d4 100644
--- a/bundled_deps/admesh/CMakeLists.txt
+++ b/bundled_deps/admesh/CMakeLists.txt
@@ -11,6 +11,5 @@ add_library(admesh STATIC
     admesh/util.cpp
 )
 
-target_include_directories(admesh PUBLIC .)
+target_include_directories(admesh PUBLIC . ${EIGEN3_INCLUDE_DIR})
 target_link_libraries(admesh PRIVATE boost_headeronly localesutils)
-target_link_libraries(admesh PUBLIC Eigen3::Eigen)
diff --git a/src/clipper/CMakeLists.txt b/src/clipper/CMakeLists.txt
index b8b844c..57931a3 100644
--- a/src/clipper/CMakeLists.txt
+++ b/src/clipper/CMakeLists.txt
@@ -10,5 +10,4 @@ add_library(clipper STATIC
 )
 
 target_link_libraries(clipper PRIVATE TBB::tbb TBB::tbbmalloc int128)
-target_link_libraries(clipper PUBLIC Eigen3::Eigen)
-target_include_directories(clipper PUBLIC .)
+target_include_directories(clipper PUBLIC . ${EIGEN3_INCLUDE_DIR})
diff --git a/src/libslic3r/CMakeLists.txt b/src/libslic3r/CMakeLists.txt
index da4c05c..1c78f46 100644
--- a/src/libslic3r/CMakeLists.txt
+++ b/src/libslic3r/CMakeLists.txt
@@ -609,6 +609,7 @@ encoding_check(libslic3r)
 target_compile_definitions(libslic3r PUBLIC -DUSE_TBB -DTBB_USE_CAPTURED_EXCEPTION=0)
 target_include_directories(libslic3r PUBLIC ${CMAKE_CURRENT_SOURCE_DIR}/.. ${CMAKE_CURRENT_BINARY_DIR})
 target_include_directories(libslic3r PUBLIC ${EXPAT_INCLUDE_DIRS})
+target_include_directories(libslic3r PUBLIC ${EIGEN3_INCLUDE_DIR})
 
 find_package(JPEG REQUIRED)
 find_package(nlohmann_json REQUIRED)
@@ -633,7 +634,6 @@ target_link_libraries(libslic3r PRIVATE
     nlohmann_json::nlohmann_json
 )
 target_link_libraries(libslic3r PUBLIC
-    Eigen3::Eigen
     semver
     admesh
     localesutils