-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathCMakeLists.txt
executable file
·78 lines (56 loc) · 1.98 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
cmake_minimum_required(VERSION 3.5)
#set project name
set(PROJECT "3DScan")
project(${PROJECT})
#speed up pcl compiling
find_program(CCACHE_FOUND ccache REQUIRED)
if(CCACHE_FOUND)
set_property(GLOBAL PROPERTY RULE_LAUNCH_COMPILE ccache)
set_property(GLOBAL PROPERTY RULE_LAUNCH_LINK ccache)
endif(CCACHE_FOUND)
set (CMAKE_CXX_FLAGS "-DPCL_ONLY_CORE_POINT_TYPES=ON -DNO_EXPLICIT_INSTANTIATIONS")
set(CMAKE_AUTOMOC ON)
set(CMAKE_AUTORCC ON)
set(CMAKE_AUTOUIC ON)
#find requirements
find_package(PCL 1.9 REQUIRED )
find_package(OpenCV 4 REQUIRED )
find_package(freenect2 REQUIRED )
find_package(VTK 6.3 REQUIRED )
find_package(Threads REQUIRED)
find_package( realsense2 REQUIRED)
find_package(Qt5Widgets REQUIRED)
find_package(Qt5Gui REQUIRED)
find_package(Qt5Core REQUIRED)
find_package(Qt5 REQUIRED Widgets)
list(REMOVE_ITEM PCL_LIBRARIES "vtkproj4")
#link libs
include_directories("/usr/include/libusb-1.0/")
include_directories(${PCL_INCLUDE_DIRS})
link_directories(${PCL_LIBRARY_DIRS})
add_definitions(${PCL_DEFINITIONS})
#load src directory
file(GLOB_RECURSE SRCS src/*.cpp)
qt5_wrap_ui(UIS_HDRS
src/mainwindow.ui
)
add_executable(${PROJECT} ${SRCS} ${UIS_HDRS})
qt5_use_modules(${PROJECT_NAME} Widgets)
target_link_libraries(${PROJECT} ${PCL_LIBRARIES} ${PCL_FILTERS_LIBRARIES} ${OpenCV_LIBRARIES} ${freenect2_LIBRARY} ${realsense2_LIBRARY} ${CMAKE_THREAD_LIBS_INIT} Qt5::Core Qt5::Widgets Qt5::Gui -lstdc++fs -pthread)
#libfreenect cmake settings
FIND_LIBRARY(freenect2_LIBRARY freenect2
PATHS @CMAKE_INSTALL_PREFIX@/lib
NO_DEFAULT_PATH
)
SET(freenect2_LIBRARIES ${freenect2_LIBRARY} @LIBFREENECT2_THREADING_LIBRARIES@)
FIND_PATH(freenect2_INCLUDE_DIR @PROJECT_NAME@/libfreenect2.hpp
PATHS @CMAKE_INSTALL_PREFIX@/include
NO_DEFAULT_PATH
)
SET(freenect2_INCLUDE_DIRS ${freenect2_INCLUDE_DIR})
#compilator settings
set_target_properties(${PROJECT} PROPERTIES
CXX_STANDARD_REQUIRED 17
CXX_EXTENSIONS ON
)
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -std=gnu++17")