-
Notifications
You must be signed in to change notification settings - Fork 119
/
CMakeLists.txt
executable file
·78 lines (64 loc) · 2.09 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
cmake_minimum_required(VERSION 2.8 FATAL_ERROR)
project(point_cloud_annotation_tool)
# Hide the console window in visual studio projects - Release
if(MSVC)
set(CMAKE_EXE_LINKER_FLAGS_RELEASE "${CMAKE_EXE_LINKER_FLAGS} /SUBSYSTEM:WINDOWS /ENTRY:mainCRTStartup")
endif()
# Use ccache to speed up compile process
find_program(CCACHE_FOUND ccache)
if(CCACHE_FOUND)
set_property(GLOBAL PROPERTY RULE_LAUNCH_COMPILE ccache)
set_property(GLOBAL PROPERTY RULE_LAUNCH_LINK ccache)
endif(CCACHE_FOUND)
if(POLICY CMP0071)
cmake_policy(SET CMP0071 NEW)
endif()
if(POLICY CMP0020)
cmake_policy(SET CMP0020 NEW)
endif()
FIND_PACKAGE(VTK)
INCLUDE(${VTK_USE_FILE}) # include UseVTK.cmake
message(STATUS "VTK_LIBRARIES: ${VTK_LIBRARIES}")
find_package(PCL REQUIRED COMPONENTS)
include_directories(${PCL_INCLUDE_DIRS})
link_directories(${PCL_LIBRARY_DIRS})
add_definitions(${PCL_DEFINITIONS})
message(STATUS "PCL_LIBRARIES: ${PCL_LIBRARIES}")
include_directories(${CMAKE_SOURCE_DIR})
set(CMAKE_INCLUDE_CURRENT_DIR ON)
set(CMAKE_AUTOMOC ON) # For meta object compiler
set(CMAKE_AUTORCC ON) # Resource files
#set(CMAKE_AUTOUIC ON) # UI files
find_package(Qt5 COMPONENTS Widgets REQUIRED)
QT5_WRAP_UI(ui_mainwindow.h mainwindow.ui)
set(project_source
# common.h
main.cpp
# visualizer.h
visualizer.cpp
# Annotaion.h
Annotaion.cpp
# vtkBoxWidgetCallback.h
vtkBoxWidgetCallback.cpp
# vtkBoxWidgetRestricted.h
vtkBoxWidgetRestricted.cpp
# vtkAnnotationBoxSource.h
vtkAnnotationBoxSource.cpp
# pcl/visualization/pcl_visualizer_extented.h
pcl/visualization/pcl_visualizer_extented.cpp
# pcl/visualization/MyCloudLUT.h
pcl/visualization/MyCloudLUT.cpp
# pcl/visualization/PointCloudColorHandlerLUT.h
# view/flowlayout.h
view/flowlayout.cpp
)
add_executable(${PROJECT_NAME} ${project_source} ui_mainwindow.h)
target_link_libraries(${PROJECT_NAME} ${PCL_LIBRARIES} Qt5::Widgets)
option(BUILD_TEST "build test exampes" ON)
if (BUILD_TEST)
add_subdirectory(test)
endif()
option(BUILD_TOOLS "build tools" ON)
if (BUILD_TOOLS)
add_subdirectory(tool)
endif()