mirror of
https://github.com/SoftFever/OrcaSlicer.git
synced 2025-11-28 21:31:03 -07:00
ENH: add clipper2 for preparing
Add clipper2 code into repo Signed-off-by: salt.wei <salt.wei@bambulab.com> Change-Id: Ib98ea3085055db7d125a92879c46b54e39bdc6b1 (cherry picked from commit 7398e71236a300531a172163c71f15440c37bd5e)
This commit is contained in:
parent
f258da6add
commit
e863d1054a
16 changed files with 7863 additions and 2 deletions
50
src/clipper2/CMakeLists.txt
Normal file
50
src/clipper2/CMakeLists.txt
Normal file
|
|
@ -0,0 +1,50 @@
|
|||
cmake_minimum_required(VERSION 3.10)
|
||||
project(Clipper2 VERSION 1.0.6 LANGUAGES C CXX)
|
||||
|
||||
set(CMAKE_POSITION_INDEPENDENT_CODE ON)
|
||||
set(CMAKE_CXX_STANDARD 17)
|
||||
set(CMAKE_CXX_STANDARD_REQUIRED ON)
|
||||
set(CMAKE_CXX_EXTENSIONS OFF)
|
||||
set_property(GLOBAL PROPERTY USE_FOLDERS OFF)
|
||||
|
||||
option(BUILD_SHARED_LIBS "Build shared libs" OFF)
|
||||
|
||||
include(GNUInstallDirs)
|
||||
|
||||
set(CLIPPER2_INC
|
||||
Clipper2Lib/include/clipper2/clipper.h
|
||||
Clipper2Lib/include/clipper2/clipper.core.h
|
||||
Clipper2Lib/include/clipper2/clipper.engine.h
|
||||
Clipper2Lib/include/clipper2/clipper.export.h
|
||||
Clipper2Lib/include/clipper2/clipper.minkowski.h
|
||||
Clipper2Lib/include/clipper2/clipper.offset.h
|
||||
Clipper2Lib/include/clipper2/clipper.rectclip.h
|
||||
)
|
||||
|
||||
set(CLIPPER2_SRC
|
||||
Clipper2Lib/src/clipper.engine.cpp
|
||||
Clipper2Lib/src/clipper.offset.cpp
|
||||
Clipper2Lib/src/clipper.rectclip.cpp
|
||||
)
|
||||
|
||||
# 2d version of Clipper2
|
||||
add_library(Clipper2 ${CLIPPER2_INC} ${CLIPPER2_SRC})
|
||||
|
||||
target_include_directories(Clipper2
|
||||
PUBLIC Clipper2Lib/include
|
||||
)
|
||||
|
||||
if (WIN32)
|
||||
target_compile_options(Clipper2 PRIVATE /W4 /WX)
|
||||
else()
|
||||
target_compile_options(Clipper2 PRIVATE -Wall -Wextra -Wpedantic -Werror)
|
||||
target_link_libraries(Clipper2 PUBLIC -lm)
|
||||
|
||||
endif()
|
||||
|
||||
set_target_properties(Clipper2 PROPERTIES FOLDER Libraries
|
||||
VERSION ${PROJECT_VERSION}
|
||||
SOVERSION ${PROJECT_VERSION_MAJOR}
|
||||
PUBLIC_HEADER "${CLIPPER2_INC}"
|
||||
)
|
||||
|
||||
Loading…
Add table
Add a link
Reference in a new issue