-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathCMakeLists.txt
110 lines (74 loc) · 2.47 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
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
cmake_minimum_required(VERSION 3.18)
project(learn_pcl)
set(CMAKE_CXX_STANDARD 11)
set(CMAKE_CXX_EXTENSIONS OFF)
set(CMAKE_CXX_STANDARD_REQUIRED ON)
#
# set(CMAKE_BUILD_TYPE Debug)
# structure setting
set(CMAKE_LIBRARY_OUTPUT_DIRECTORY "${CMAKE_CURRENT_LIST_DIR}/lib")
set(CMAKE_RUNTIME_OUTPUT_DIRECTORY "${CMAKE_CURRENT_LIST_DIR}/bin")
set(CMAKE_ARCHIVE_OUTPUT_DIRECTORY "${CMAKE_CURRENT_LIST_DIR}/lib")
# pcl setting
find_package(PCL 1.11.1 REQUIRED)
if(PCL_FOUND)
message("pcl found")
include_directories(${PCL_INCLUDE_DIRS})
add_definitions(${PCL_DEFINITIONS})
link_directories(${PCL_LIBRARY_DIRS})
else()
message(FATAL_ERROR "pcl not found")
endif(PCL_FOUND)
# opencv setting
set(OpenCV_DIR "D:/03-env/OpenCV/opencv-4.9.0-release/opencv/build")
find_package(OpenCV REQUIRED)
if(OpenCV_FOUND)
message("opencv found")
include_directories(${OpenCV_INCLUDE_DIRS})
link_directories(${OpenCV_LIBRARY_DIRS})
link_directories(${CMAKE_LIBRARY_OUTPUT_DIRECTORY}) # opecv_world490d.lib
else()
message(FATAL_ERROR "opencv not found")
endif()
# boost setting
set(Boost_ROOT "D:/03-env/boost_1_84_0")
find_package(Boost 1.70 REQUIRED)
if(Boost_FOUND)
message("Boost found")
message("${Boost_INCLUDE_DIRS} | ${Boost_LIBRARIES} | ${Boost_LIBRARY_DIRS}")
include_directories(${Boost_INCLUDE_DIRS})
link_directories(${Boost_LIBRARY_DIRS})
else()
message(FATAL_ERROR "Boost not found")
endif()
# openMP
find_package(OpenMP REQUIRED)
if (OpenMP_FOUND)
message(STATUS "Found OpenMP")
# set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} ${OpenMP_C_FLAGS}")
# set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} ${OpenMP_CXX_FLAGS}")
# set(CMAKE_EXE_LINKER_FLAGS "${CMAKE_EXE_LINKER_FLAGS} ${OpenMP_EXE_LINKER_FLAGS}")
endif()
# link function
function(link_pcl_libraries target)
target_link_libraries(${target} PRIVATE ${PCL_LIBRARIES})
endfunction()
function(link_opencv_libraries target)
target_link_libraries(${target} PRIVATE ${OpenCV_LIBRARIES})
endfunction()
function(link_boost_libraries target)
target_link_libraries(${target} PRIVATE ${Boost_LIBRARIES})
endfunction()
function(link_pcl_opencv_libraries target)
target_link_libraries(${target} PRIVATE ${PCL_LIBRARIES})
target_link_libraries(${target} PRIVATE ${OpenCV_LIBRARIES})
endfunction()
# subdir
# add_subdirectory(basic)
# add_subdirectory(features)
# add_subdirectory(detect)
# add_subdirectory(visualize)
# add_subdirectory(filter)
add_subdirectory(fit)
# add_subdirectory(segmentation)
# add_subdirectory(tests)