forked from romb-technologies/Bezier
-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathCMakeLists.txt
58 lines (44 loc) · 1.41 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
cmake_minimum_required(VERSION 3.1)
project(Bezier
LANGUAGES CXX
VERSION 0.2.0)
set(CMAKE_CXX_STANDARD 11)
set(CMAKE_CXX_STANDARD_REQUIRED ON)
set(CMAKE_CXX_EXTENSIONS OFF)
add_compile_options(-fPIC)
find_package(Eigen3 REQUIRED)
include_directories(SYSTEM ${EIGEN3_INCLUDE_DIR})
set(Bezier_SRC
src/bezier.cpp
src/polycurve.cpp
)
set(Bezier_INC
include/Bezier/declarations.h
include/Bezier/legendre_gauss.h
include/Bezier/bezier.h
include/Bezier/polycurve.h
)
# Options
if(NOT LEGENDRE_GAUSS_PRECISION)
message(STATUS "Setting Legendre Gauss precision to default value (10).")
set(LEGENDRE_GAUSS_PRECISION 10)
endif()
option(BUILD_SHARED_LIBS "Build shared library (.so) instead of static one (/.a)" OFF)
# build rules
if(BUILD_SHARED_LIBS)
add_library(bezier SHARED ${Bezier_SRC})
else()
add_library(bezier STATIC ${Bezier_SRC})
endif()
target_include_directories(bezier PUBLIC
$<BUILD_INTERFACE:${Bezier_SOURCE_DIR}/include>
$<INSTALL_INTERFACE:include>
)
target_compile_definitions(bezier PRIVATE LEGENDRE_GAUSS_N=${LEGENDRE_GAUSS_PRECISION})
set_target_properties(bezier PROPERTIES VERSION ${PROJECT_VERSION})
set_target_properties(bezier PROPERTIES PUBLIC_HEADER "${Bezier_INC}")
# install rules
install(TARGETS bezier
EXPORT bezier-export DESTINATION "lib"
PUBLIC_HEADER DESTINATION "include/Bezier")
install(EXPORT bezier-export DESTINATION "lib/cmake/Bezier" FILE BezierConfig.cmake)