-
Notifications
You must be signed in to change notification settings - Fork 5
/
CMakeLists.txt
executable file
·95 lines (79 loc) · 3.62 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
94
95
# #############################################################################
# CMAKE CONFIGURATION
# #############################################################################
cmake_minimum_required(VERSION 3.15 FATAL_ERROR)
include("${CMAKE_CURRENT_LIST_DIR}/cmake/color.cmake")
include("${CMAKE_CURRENT_LIST_DIR}/cmake/functions.cmake")
# set(CMAKE_INSTALL_PREFIX "${CMAKE_BINARY_DIR}/install" CACHE STRING "Final installation location.")
set(CMAKE_BUILD_TYPE_INIT "Release")
set(CMAKE_CXX_STANDARD 17)
set(CMAKE_CXX_STANDARD_REQUIRED ON)
set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -fprofile-arcs -ftest-coverage")
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -fprofile-arcs -ftest-coverage")
project(pcl-visualizer VERSION 1.0.1
DESCRIPTION "Point cloud visualizser with PCL"
)
message("\n" "${BoldCyan}=========================================")
message("${BoldCyan}Project: ${PROJECT_NAME} ")
message("${BoldCyan}=========================================")
# #############################################################################
# PACKAGES DEPENDENCIES
# #############################################################################
message("${BoldYellow}***********************")
message("${BoldYellow}PCL PACKAGE")
message("${BoldYellow}***********************")
find_package(PCL 1.8 REQUIRED QUIET COMPONENTS visualization)
if(PCL_FOUND)
message(STATUS "${BoldGreen}PCL status:")
message(STATUS " version: ${PCL_VERSION}")
message(STATUS " directory: ${PCL_DIR}")
else()
message(FATAL_ERROR "${BoldRed} ERROR: PCL minimum required version 1.8. Not found")
endif()
fetch_project(
NAME cloudparse
URL https://github.com/danielTobon43/cloudparse/archive/v0.2.1.tar.gz
)
# #############################################################################
# SOURCE CODE
# #############################################################################
set(MAIN_SOURCE "src/main.cpp")
# #############################################################################
# EXECUTABLES
# #############################################################################
add_executable(${PROJECT_NAME} ${MAIN_SOURCE})
# #############################################################################
# TARGET LIBRARIES
# #############################################################################
target_include_directories(${PROJECT_NAME} PRIVATE ${PCL_INCLUDE_DIRS})
target_link_libraries(${PROJECT_NAME} ${PCL_LIBRARIES} cloudparse)
target_compile_options(${PROJECT_NAME} PRIVATE -Wno-cpp -Wall -Wextra)
message("${BoldCyan}=========================================")
message("${BoldCyan}Project: ${PROJECT_NAME} COMPILED WITH CMAKE " ${CMAKE_VERSION})
message("${BoldCyan}=========================================")
# #############################################################################
# INSTALL DIRECTORY
# #############################################################################
install(TARGETS ${PROJECT_NAME}
RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR}
PUBLIC_HEADER DESTINATION ${CMAKE_INSTALL_INCLUDEDIR}
)
option(BUILD_TESTING "Builds only the test executable." OFF)
option(CODE_COVERAGE "Collect coverage from test library" OFF)
# if(BUILD_TESTING)
# message("${BoldWhite} Testing enabled ${ColourReset}")
# enable_testing()
# add_subdirectory(external)
# add_subdirectory(tests)
# if(CODE_COVERAGE)
# message("${BoldWhite} Coverage enabled ${ColourReset}")
# include("${CMAKE_CURRENT_LIST_DIR}/cmake/CodeCoverage.cmake")
# append_coverage_compiler_flags()
# setup_target_for_coverage_lcov(NAME coverage EXECUTABLE ctest -j ${n_cores}
# BASE_DIRECTORY ../coverage
# DEPENDENCIES
# testlib
# testconcreteparses
# )
# endif()
# endif()