| 1 |
Fromscip-debian debian cura-engine 1:5.0.0-6 cura-engine/patches/`0006-fix-USE_SYSTEM_LIBRARIES-for-clipper-polyclipping.patch`#From.: Sebastian Kuzminsky <[email protected]scip-debian . . . identity/`[email protected]`.> |
| 2 |
Datescip-debian debian cura-engine 1:5.0.0-6 cura-engine/patches/`0006-fix-USE_SYSTEM_LIBRARIES-for-clipper-polyclipping.patch`#Date.: Thu, 19 May 2022 12:37:51 -0600 |
| 3 |
Subjectscip-debian debian cura-engine 1:5.0.0-6 cura-engine/patches/`0006-fix-USE_SYSTEM_LIBRARIES-for-clipper-polyclipping.patch`#Subject.: fix USE_SYSTEM_LIBRARIES for clipper/polyclipping |
| 4 |
|
| 5 |
--- |
| 6 |
CMakeLists.txt | 22 +++++++++------ |
| 7 |
cmake/FindPolyclipping.cmake | 67 ++++++++++++++++++++++++++++++++++++++++++++ |
| 8 |
2 files changed, 81 insertions(+), 8 deletions(-) |
| 9 |
create mode 100644 cmake/FindPolyclipping.cmake |
| 10 |
|
| 11 |
diff --git a/CMakeLists.txtscip-debian debian cura-engine 1:5.0.0-6 cura-engine/upstream/`CMakeLists.txt`: b/CMakeLists.txtscip-debian debian cura-engine 1:5.0.0-6 cura-engine/upstream/`CMakeLists.txt`: |
| 12 |
index 2ee6c68..60bb46f 100644 |
| 13 |
--- a/CMakeLists.txt |
| 14 |
+++ b/CMakeLists.txt |
| 15 |
@@ -12,6 +12,8 @@ option(USE_SYSTEM_LIBS "Use the system libraries if available" OFF) |
| 16 |
option(ENABLE_MORE_COMPILER_OPTIMIZATION_FLAGS "Enable more optimization flags" ON) |
| 17 |
option(EXTENSIVE_WARNINGS "Compile with all warnings" OFF) |
| 18 |
|
| 19 |
+list(APPEND CMAKE_MODULE_PATH "${CMAKE_CURRENT_SOURCE_DIR}/cmake") |
| 20 |
+ |
| 21 |
if(NOT APPLE) |
| 22 |
option(ENABLE_OPENMP "Use OpenMP for parallel code" ON) |
| 23 |
endif() |
| 24 |
@@ -261,14 +263,18 @@ if(ENABLE_ARCUS) |
| 25 |
endif() |
| 26 |
endif() |
| 27 |
|
| 28 |
|
| 29 |
|
| 30 |
|
| 31 |
|
| 32 |
|
| 33 |
|
| 34 |
|
| 35 |
|
| 36 |
+if(USE_SYSTEM_LIBS) |
| 37 |
+ find_package(Polyclipping REQUIRED) |
| 38 |
+else() |
| 39 |
+ find_package(clipper 6.4.2 QUIET) |
| 40 |
+ if (NOT TARGET clipper::clipper) |
| 41 |
+ add_library(clipper::clipper STATIC libs/clipper/clipper.cpp) |
| 42 |
+ target_include_directories(clipper::clipper |
| 43 |
+ PUBLIC |
| 44 |
+ $<BUILD_INTERFACE:${CMAKE_SOURCE_DIR}/libs/clipper/include> |
| 45 |
+ $<INSTALL_INTERFACE:${CMAKE_INSTALL_INCLUDEDIR}> |
| 46 |
+ ) |
| 47 |
+ endif () |
| 48 |
endif () |
| 49 |
|
| 50 |
find_package(rapidjson 1.1.0 QUIET) |
| 51 |
diff --git a/cmake/FindPolyclipping.cmake b/cmake/FindPolyclipping.cmakescip-debian debian cura-engine 1:5.0.0-6 cura-engine/upstream/`cmake/FindPolyclipping.cmake`: |
| 52 |
new file mode 100644 |
| 53 |
index 0000000..7c88ab6 |
| 54 |
--- /dev/nullscip-debian debian cura-engine 1:5.0.0-6 cura-engine/upstream/`/dev/null`: |
| 55 |
+++ b/cmake/FindPolyclipping.cmake |
| 56 |
@@ -0,0 +1,67 @@ |
| 57 |
+# |
| 58 |
+# - Try to find the polyclipping library |
| 59 |
+# this will define |
| 60 |
+# |
| 61 |
+# Polyclipping_FOUND - polyclipping was found |
| 62 |
+# Polyclipping_INCLUDE_DIRS - the polyclipping include directory |
| 63 |
+# Polyclipping_LIBRARIES - The libraries needed to use polyclipping |
| 64 |
+# Polyclipping_VERSION - The polyclipping library version |
| 65 |
+ |
| 66 |
+#============================================================================= |
| 67 |
+# Copyright (c) 2017 Christophe Giboudeaux <[email protected]> |
| 68 |
+# |
| 69 |
+# |
| 70 |
+# Redistribution and use in source and binary forms, with or without |
| 71 |
+# modification, are permitted provided that the following conditions |
| 72 |
+# are met: |
| 73 |
+# |
| 74 |
+# 1. Redistributions of source code must retain the copyright |
| 75 |
+# notice, this list of conditions and the following disclaimer. |
| 76 |
+# 2. Redistributions in binary form must reproduce the copyright |
| 77 |
+# notice, this list of conditions and the following disclaimer in the |
| 78 |
+# documentation and/or other materials provided with the distribution. |
| 79 |
+# 3. The name of the author may not be used to endorse or promote products |
| 80 |
+# derived from this software without specific prior written permission. |
| 81 |
+# |
| 82 |
+# THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR |
| 83 |
+# IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES |
| 84 |
+# OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. |
| 85 |
+# IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, |
| 86 |
+# INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT |
| 87 |
+# NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, |
| 88 |
+# DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY |
| 89 |
+# THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT |
| 90 |
+# (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF |
| 91 |
+# THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. |
| 92 |
+#============================================================================= |
| 93 |
+ |
| 94 |
+ |
| 95 |
+find_package(PkgConfig QUIET) |
| 96 |
+pkg_check_modules(PC_Polyclipping QUIET polyclipping) |
| 97 |
+ |
| 98 |
+find_path(Polyclipping_INCLUDE_DIRS |
| 99 |
+ NAMES clipper.hpp |
| 100 |
+ HINTS ${PC_Polyclipping_INCLUDE_DIRS} |
| 101 |
+) |
| 102 |
+ |
| 103 |
+find_library(Polyclipping_LIBRARIES |
| 104 |
+ NAMES polyclipping |
| 105 |
+ HINTS ${PC_Polyclipping_LIBRARY_DIRS} |
| 106 |
+) |
| 107 |
+ |
| 108 |
+if(EXISTS ${Polyclipping_INCLUDE_DIRS}/clipper.hpp) |
| 109 |
+ file(READ ${Polyclipping_INCLUDE_DIRS}/clipper.hpp CLIPPER_H_CONTENT) |
| 110 |
+ string(REGEX MATCH "#define CLIPPER_VERSION[ ]+\"[0-9]+.[0-9]+.[0-9]+\"" CLIPPER_H_VERSION_MATCH ${CLIPPER_H_CONTENT}) |
| 111 |
+ string(REGEX REPLACE "^.*CLIPPER_VERSION[ ]+\"([0-9]+.[0-9]+.[0-9]+).*$" "\\1" Polyclipping_VERSION "${CLIPPER_H_VERSION_MATCH}") |
| 112 |
+endif() |
| 113 |
+ |
| 114 |
+include(FindPackageHandleStandardArgs) |
| 115 |
+ |
| 116 |
+find_package_handle_standard_args(Polyclipping |
| 117 |
+ FOUND_VAR Polyclipping_FOUND |
| 118 |
+ REQUIRED_VARS Polyclipping_LIBRARIES Polyclipping_INCLUDE_DIRS |
| 119 |
+ VERSION_VAR Polyclipping_VERSION |
| 120 |
+) |
| 121 |
+ |
| 122 |
+mark_as_advanced(Polyclipping_LIBRARIES Polyclipping_INCLUDE_DIRS Polyclipping_VERSION) |
| 123 |
+ |