-
Notifications
You must be signed in to change notification settings - Fork 0
/
CMakeLists.txt
93 lines (76 loc) · 3.67 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
cmake_minimum_required(VERSION 2.8.12)
project(MeshSaliency)
# Set exe path.
set(EXECUTABLE_OUTPUT_PATH ${PROJECT_BINARY_DIR}/bin)
# Set library path.`
set(CMAKE_LIBRARY_OUTPUT_DIRECTORY "${CMAKE_BINARY_DIR}")
# Set C++ flags.
#set(CMAKE_CXX_FLAGS
#"${CMAKE_CXX_FLAGS} -std=c++11 -g -fsanitize=address\
#-fno-omit-frame-pointer -Wno-macro-redefined")
set(CMAKE_CXX_FLAGS
"${CMAKE_CXX_FLAGS} -std=c++11 -O3 -Wno-macro-redefined")
# Set the module path (mainly for FindXXX.cmake files)
set(CMAKE_MODULE_PATH ${CMAKE_MODULE_PATH}
${CMAKE_CURRENT_SOURCE_DIR}/cmake/Modules)
include_directories("${CMAKE_CURRENT_SOURCE_DIR}/include")
# Find libigl.
find_package(LIBIGL REQUIRED)
# Set options for libigl.
option(LIBIGL_WITH_VIEWER "Use OpenGL viewer" ON)
option(LIBIGL_WITH_OPENGL "Use OpenGL" ON)
option(LIBIGL_WITH_OPENGL_GLFW "Use GLFW" ON)
option(LIBIGL_WITH_PNG "Use PNG" ON)
option(LIBIGL_WITH_EMBREE "Use Embree" ON)
#setup Point Cloud Library (pcl)
find_package(PCL 1.3 REQUIRED)
include_directories(${PCL_INCLUDE_DIRS})
add_definitions(${PCL_DEFINITIONS})
# Compile the options we need.
add_subdirectory("${LIBIGL_INCLUDE_DIR}/../shared/cmake" "libigl")
#message(STATUS "LIBIGL_INCLUDE_DIRS=${LIBIGL_INCLUDE_DIRS}")
include_directories(${LIBIGL_INCLUDE_DIRS})
# Add definitions.
add_definitions(${LIBIGL_DEFINITIONS})
#message(STATUS "LIBIGL_DEFINITIONS=${LIBIGL_DEFINITIONS}")
# Find Eigen3.
find_package(Eigen3 REQUIRED)
include_directories(${EIGEN3_INCLUDE_DIRS})
#message(STATUS "EIGEN3_INCLUDE_DIRS=${EIGEN3_INCLUDE_DIRS}")
#message(STATUS "LIBIGL_PNG_EXTRA_LIBRARIES=${LIBIGL_PNG_EXTRA_LIBRARIES}")
# Compile and link render_views executable.
add_executable(render_views render_views.cc view_setting.cc)
target_link_libraries(render_views ${LIBIGL_LIBRARIES}
${LIBIGL_VIEWER_EXTRA_LIBRARIES}
${LIBIGL_OPENGL_EXTRA_LIBRARIES}
${LIBIGL_OPENGL_GLFW_EXTRA_LIBRARIES}
${LIBIGL_PNG_EXTRA_LIBRARIES})
# Compile and link backproject_saliency executable.
add_executable(backproject_saliency backproject_saliency.cc)
target_compile_definitions(backproject_saliency PRIVATE ${LIBIGL_DEFINITIONS})
target_link_libraries(backproject_saliency ${LIBIGL_LIBRARIES}
${LIBIGL_VIEWER_EXTRA_LIBRARIES}
${LIBIGL_OPENGL_EXTRA_LIBRARIES}
${LIBIGL_OPENGL_GLFW_EXTRA_LIBRARIES}
${LIBIGL_PNG_EXTRA_LIBRARIES}
${LIBIGL_EMBREE_EXTRA_LIBRARIES})
# Compile and link spectral_saliency executable.
add_executable(spectral_saliency
spectral_saliency.cc
geometry_processing.cc
view_setting.cc)
target_link_libraries(spectral_saliency ${LIBIGL_LIBRARIES}
${LIBIGL_VIEWER_EXTRA_LIBRARIES}
${LIBIGL_OPENGL_EXTRA_LIBRARIES}
${LIBIGL_OPENGL_GLFW_EXTRA_LIBRARIES}
${LIBIGL_PNG_EXTRA_LIBRARIES}
${PCL_LIBRARIES})
# Compile and link test_geometry_processing executable.
add_executable(test_geometry_processing test_geometry_processing.cc
geometry_processing.cc)
target_link_libraries(test_geometry_processing ${LIBIGL_LIBRARIES}
${LIBIGL_VIEWER_EXTRA_LIBRARIES}
${LIBIGL_OPENGL_EXTRA_LIBRARIES}
${LIBIGL_OPENGL_GLFW_EXTRA_LIBRARIES}
${LIBIGL_PNG_EXTRA_LIBRARIES}
${PCL_LIBRARIES})