-
Notifications
You must be signed in to change notification settings - Fork 15
/
CMakeLists.txt
67 lines (53 loc) · 2.06 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
cmake_minimum_required(VERSION 2.8)
project(mesh-deform)
set(CMAKE_CXX_STANDARD 11)
if (WIN32)
add_definitions("-D_SCL_SECURE_NO_WARNINGS -D_CRT_SECURE_NO_WARNINGS -D_ITERATOR_DEBUG_LEVEL=0")
endif()
set(CMAKE_MODULE_PATH ${CMAKE_CURRENT_SOURCE_DIR}/cmake)
set(DEFORM_LINK_TARGETS)
find_package(Eigen3 REQUIRED)
find_package(OpenMesh QUIET)
find_package(OpenSceneGraph QUIET COMPONENTS osgViewer osgFX osgGA)
find_package(Sophus QUIET)
include_directories("inc" ${OPENMESH_INCLUDE_DIR} ${EIGEN3_INCLUDE_DIR} ${SOPHUS_INCLUDE_DIR})
list(APPEND DEFORM_LINK_TARGETS ${OPENMESH_LIBRARIES})
add_library(deform INTERFACE)
target_sources(deform INTERFACE
${CMAKE_CURRENT_SOURCE_DIR}/inc/deform/arap.h
${CMAKE_CURRENT_SOURCE_DIR}/inc/deform/openmesh_adapter.h
${CMAKE_CURRENT_SOURCE_DIR}/inc/deform/trajectory.h
${CMAKE_CURRENT_SOURCE_DIR}/inc/deform/deformation_util.h
)
add_executable(deform_tests
tests/catch.hpp
tests/accessor.h
tests/test_cotan.cpp
tests/test_trajectory.cpp
)
target_link_libraries(deform_tests deform ${DEFORM_LINK_TARGETS})
set(DEFORM_ETC_DIR "${CMAKE_CURRENT_SOURCE_DIR}/etc")
configure_file(examples/example_config.h.in example_config.h)
include_directories(${CMAKE_CURRENT_BINARY_DIR})
include_directories("examples")
if (OPENSCENEGRAPH_FOUND)
set(OSG_COMMON_FILES examples/osg_viewer.h examples/osg_viewer.cpp)
include_directories(${OPENSCENEGRAPH_INCLUDE_DIRS})
add_executable(deform_sphere
examples/deform_sphere.cpp
${OSG_COMMON_FILES}
)
target_link_libraries(deform_sphere deform ${DEFORM_LINK_TARGETS} ${OPENSCENEGRAPH_LIBRARIES})
add_executable(deform_bar
examples/deform_bar.cpp
${OSG_COMMON_FILES}
)
target_link_libraries(deform_bar deform ${DEFORM_LINK_TARGETS} ${OPENSCENEGRAPH_LIBRARIES})
if (SOPHUS_FOUND)
add_executable(deform_trajectory
examples/deform_trajectory.cpp
${OSG_COMMON_FILES}
)
target_link_libraries(deform_trajectory deform ${DEFORM_LINK_TARGETS} ${OPENSCENEGRAPH_LIBRARIES})
endif ()
endif()