forked from codebydant/DBScan-PCL-Optimized
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathCMakeLists.txt
89 lines (72 loc) · 3.56 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
##############################################################################
# CMAKE CONFIGURATION
##############################################################################
cmake_minimum_required(VERSION 3.5.1 FATAL_ERROR)
# set project name
project(dbscan VERSION 1.0.1)
# set build type = Debug mode
set(CMAKE_BUILD_TYPE Release)
message("\n" "=========================================")
message("Project: ${PROJECT_NAME} ")
message("=========================================")
# set the include directive in the same project folder
set(CMAKE_INCLUDE_CURRENT_DIR ON)
# set corresponding package directories
set(PCL_DIR /opt/pcl-1.8.1/build)
# Include dependencies of pcl 1.8.1 in project directorie
set(CMAKE_MODULE_PATH ${PCL_DIR}/../cmake/Modules)
# set cmake for use std c++11 and output executable folder to bin
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -std=c++11")
set(EXECUTABLE_OUTPUT_PATH ${CMAKE_BINARY_DIR}/bin)
# set turn off the output rule messages of cmake
##set_property(GLOBAL PROPERTY RULE_MESSAGES OFF)
##############################################################################
# PACKAGES
##############################################################################
message("***********************")
message("PCL PACKAGE")
message("***********************")
##find_package(PCL 1.8 PATHS ${PCL_DIR} QUIET COMPONENTS common io visualization CONFIG) ##REQUIRED COMPONENTS common io visualization)
find_package(PCL 1.8 PATHS ${PCL_DIR})
if(PCL_FOUND)
message(STATUS "PCL status:")
message(STATUS " version: ${PCL_VERSION}")
message(STATUS " pcl directorie: ${PCL_DIR}")
else()
message(WARNING " PCL 1.8 not found, attempting 1.7...")
find_package(PCL 1.7 REQUIRED)
if(PCL_FOUND)
message(STATUS "PCL status:")
message(STATUS " version: ${PCL_VERSION}")
message(STATUS " pcl directorie: ${PCL_DIR}")
else()
message(FATAL_ERROR " ERROR: PCL minimum required version 1.7. Not found")
endif()
endif()
##############################################################################
# HEADERS
##############################################################################
include_directories(${PCL_INCLUDE_DIRS})
include(CheckFunctionExists)
# Use the compile definitions defined in PCL
add_definitions(${PCL_DEFINITIONS})
##############################################################################
# LIBRARIES PATH
##############################################################################
link_directories(${PCL_LIBRARY_DIRS})
##############################################################################
# SOURCE CODE
##############################################################################
set(MAIN_SOURCE "main.cpp")
##############################################################################
# EXECUTABLES
##############################################################################
add_executable(${PROJECT_NAME} ${MAIN_SOURCE} "src/dbScan.cpp" "src/OctreeGenerator.cpp" "src/cluster.cpp" "src/dbScan.h" "src/OctreeGenerator.h" "src/cluster.h" "src/HTRBasicDataStructures.h")
##############################################################################
# TARGET LIBRARIES
##############################################################################
##target_link_libraries(${PROJECT_NAME} ${PCL_COMMON_LIBRARIES} ${PCL_IO_LIBRARIES} ${PCL_VISUALIZATION_LIBRARY})
target_link_libraries(${PROJECT_NAME} ${PCL_LIBRARIES})
message("=========================================")
message("Project: ${PROJECT_NAME} COMPILED WITH CMAKE " ${CMAKE_VERSION})
message("=========================================")