-
-
Notifications
You must be signed in to change notification settings - Fork 4.6k
/
Copy pathCMakeLists.txt
40 lines (34 loc) · 1.54 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
set(SUBSYS_NAME examples)
set(SUBSYS_DESC "PCL examples")
set(SUBSYS_DEPS common io features search kdtree octree filters keypoints segmentation sample_consensus outofcore stereo geometry surface)
PCL_SUBSYS_OPTION(build ${SUBSYS_NAME} ${SUBSYS_DESC} OFF)
PCL_SUBSYS_DEPEND(build NAME ${SUBSYS_NAME} DEPS ${SUBSYS_DEPS})
if(NOT build)
return()
endif()
# this variable will filled with all targets added with pcl_add_example
set(PCL_EXAMPLES_ALL_TARGETS)
# This looks for all examples/XXX/CMakeLists.txt
file (GLOB examples_sbudirs */CMakeLists.txt)
# Extract only relevant XXX and append it to PCL_EXAMPLES_SUBDIRS
foreach(subdir ${examples_sbudirs})
# PATH of get_filename_component has problem dealing with windows shared folders "//xxx.xxx.xxx.xxx/folder"
# Check here for the discussion: http://www.pcl-developers.org/Small-hack-to-get-filename-component-td5706691.html
# Modified by Yangyan Li(yangyan.lee@gmail.com)
# get_filename_component (dir ${subdir} PATH)
get_filename_component (absolute ${subdir} ABSOLUTE)
get_filename_component (name ${subdir} NAME)
STRING(REGEX REPLACE ${name} "" dir ${absolute})
list(APPEND PCL_EXAMPLES_SUBDIRS ${dir})
endforeach()
# Add the subdirectories
foreach(subdir ${PCL_EXAMPLES_SUBDIRS})
add_subdirectory(${subdir})
endforeach()
if(CMAKE_GENERATOR_IS_IDE)
set(SUBSYS_TARGET_NAME EXAMPLES_BUILD)
else()
set(SUBSYS_TARGET_NAME ${SUBSYS_NAME})
endif()
add_custom_target(${SUBSYS_TARGET_NAME} DEPENDS ${PCL_EXAMPLES_ALL_TARGETS})
set_target_properties(${SUBSYS_TARGET_NAME} PROPERTIES FOLDER "Examples")