-
Notifications
You must be signed in to change notification settings - Fork 6
/
CMakeLists.txt
114 lines (90 loc) · 2.28 KB
/
CMakeLists.txt
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
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
cmake_minimum_required(VERSION 3.14)
project(breploader)
set (CMAKE_CXX_STANDARD 14)
set(CMAKE_POSITION_INDEPENDENT_CODE ON)
find_package(Eigen3 REQUIRED)
find_package(OpenCASCADE REQUIRED)
if (DEFINED ENV{PARASOLID_BASE})
include(FetchContent)
FetchContent_Declare(
ps_frustrum
GIT_REPOSITORY https://github.com/deGravity/parasolid_frustrum.git
GIT_TAG v1.0
)
FetchContent_MakeAvailable(ps_frustrum)
endif()
set(HEADERS
${CMAKE_CURRENT_SOURCE_DIR}/include/body.h
${CMAKE_CURRENT_SOURCE_DIR}/include/edge.h
${CMAKE_CURRENT_SOURCE_DIR}/include/face.h
${CMAKE_CURRENT_SOURCE_DIR}/include/loop.h
${CMAKE_CURRENT_SOURCE_DIR}/include/topology.h
${CMAKE_CURRENT_SOURCE_DIR}/include/types.h
${CMAKE_CURRENT_SOURCE_DIR}/include/vertex.h
)
set(SOURCES
${CMAKE_CURRENT_SOURCE_DIR}/src/body.cpp
)
set(OCCT_SOURCES
${CMAKE_CURRENT_SOURCE_DIR}/src/occ/occtbody.cpp
${CMAKE_CURRENT_SOURCE_DIR}/src/occ/occtedge.cpp
${CMAKE_CURRENT_SOURCE_DIR}/src/occ/occtface.cpp
${CMAKE_CURRENT_SOURCE_DIR}/src/occ/occtloop.cpp
${CMAKE_CURRENT_SOURCE_DIR}/src/occ/occtvertex.cpp
)
if (DEFINED ENV{PARASOLID_BASE})
set(PS_SOURCES
${CMAKE_CURRENT_SOURCE_DIR}/src/ps/psbody.cpp
${CMAKE_CURRENT_SOURCE_DIR}/src/ps/psedge.cpp
${CMAKE_CURRENT_SOURCE_DIR}/src/ps/psface.cpp
${CMAKE_CURRENT_SOURCE_DIR}/src/ps/psloop.cpp
${CMAKE_CURRENT_SOURCE_DIR}/src/ps/psvertex.cpp
)
add_library(breploader
${SOURCES}
${HEADERS}
${OCCT_SOURCES}
${PS_SOURCES}
)
else()
add_library(breploader
${SOURCES}
${HEADERS}
${OCCT_SOURCES}
)
endif()
target_include_directories(breploader PUBLIC
${CMAKE_CURRENT_SOURCE_DIR}/include
)
target_include_directories(breploader PRIVATE
${CMAKE_CURRENT_LIST_DIR}/ext
)
if (DEFINED ENV{PARASOLID_BASE})
target_link_libraries(breploader PUBLIC
parasolid_frustrum
Eigen3::Eigen
TKernel
TKXSBase
TKSTEP
TKBRep
TKG3d
TKMath
TKMesh
TKTopAlgo
TKShHealing)
target_compile_definitions(breploader PUBLIC "-DPARASOLID=1")
else()
target_link_libraries(breploader PUBLIC
Eigen3::Eigen
TKernel
TKXSBase
TKSTEP
TKBRep
TKG3d
TKMath
TKMesh
TKTopAlgo
TKShHealing)
endif()
target_include_directories(breploader PUBLIC ${OpenCASCADE_INCLUDE_DIR})
target_link_directories(breploader PUBLIC ${OpenCASCADE_LIBRARY_DIR})