Skip to content

Commit fbd93f8

Browse files
committed
feat: update gitmodule and tweak CMakeLists.txt
1 parent 1fbf6a0 commit fbd93f8

File tree

3 files changed

+18
-5
lines changed

3 files changed

+18
-5
lines changed

.gitmodules

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,3 @@
11
[submodule "vendor/Clipper2"]
22
path = vendor/Clipper2
3-
url = https://github.com/AngusJohnson/Clipper2
3+
url = https://github.com/epit3d/Clipper2

CMakeLists.txt

+16-3
Original file line numberDiff line numberDiff line change
@@ -4,20 +4,33 @@ project(clipper2c LANGUAGES CXX)
44
set(CMAKE_VERBOSE_MAKEFILE ON)
55
set(CMAKE_EXPORT_COMPILE_COMMANDS ON)
66

7-
option(BUILD_SHARED_LIBS OFF)
7+
option(BUILD_SHARED_LIBS ON)
88

99
add_compile_options(-fPIC)
1010

1111
add_subdirectory(vendor/Clipper2/CPP)
1212

1313
file(GLOB_RECURSE SOURCE_FILES src/*.cpp)
14+
file(GLOB_RECURSE INCLUDE_FILES include/*.h)
1415

15-
add_library(clipper2c ${SOURCE_FILES})
16+
add_library(clipper2c SHARED ${INCLUDE_FILES} ${SOURCE_FILES})
1617

1718
target_link_libraries(
1819
clipper2c
1920
PRIVATE Clipper2
2021
)
2122

2223
target_include_directories(clipper2c PUBLIC ${PROJECT_SOURCE_DIR}/include)
23-
target_compile_features(clipper2c PRIVATE cxx_std_17)
24+
25+
26+
set_target_properties(clipper2c PROPERTIES FOLDER Libraries
27+
VERSION ${PROJECT_VERSION}
28+
SOVERSION ${PROJECT_VERSION_MAJOR}
29+
PUBLIC_HEADER "${INCLUDE_FILES}"
30+
)
31+
32+
install(TARGETS clipper2c
33+
PUBLIC_HEADER DESTINATION ${CMAKE_INSTALL_INCLUDEDIR}/clipper2c
34+
)
35+
36+
target_compile_features(clipper2c PUBLIC cxx_std_17)

include/clipper2c.h

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
#include <stddef.h>
22
#include <stdint.h>
3-
#include <types.h>
3+
#include <clipper2c/types.h>
44

55
#ifdef __cplusplus
66
extern "C" {

0 commit comments

Comments
 (0)