File tree Expand file tree Collapse file tree 3 files changed +25
-1
lines changed Expand file tree Collapse file tree 3 files changed +25
-1
lines changed Original file line number Diff line number Diff line change @@ -43,3 +43,11 @@ if(BUILD_DOCS)
43
43
add_custom_target (install_docs DEPENDS opencv_docs
44
44
COMMAND "${CMAKE_COMMAND} " -DCMAKE_INSTALL_COMPONENT=docs -P "${CMAKE_BINARY_DIR} /cmake_install.cmake" )
45
45
endif ()
46
+
47
+ # Samples
48
+ if (BUILD_EXAMPLES)
49
+ add_custom_target (opencv_samples)
50
+ if (ENABLE_SOLUTION_FOLDERS)
51
+ set_target_properties (opencv_samples PROPERTIES FOLDER "extra" )
52
+ endif ()
53
+ endif ()
Original file line number Diff line number Diff line change @@ -1251,6 +1251,13 @@ function(ocv_add_samples)
1251
1251
set_target_properties (${the_target} PROPERTIES
1252
1252
FOLDER "samples/${module_id} " )
1253
1253
endif ()
1254
+ # Add single target to build all samples for the module: 'make opencv_samples_bioinspired'
1255
+ set (parent_target opencv_samples_${module_id} )
1256
+ if (NOT TARGET ${parent_target} )
1257
+ add_custom_target (${parent_target} )
1258
+ add_dependencies (opencv_samples ${parent_target} )
1259
+ endif ()
1260
+ add_dependencies (${parent_target} ${the_target} )
1254
1261
1255
1262
if (WIN32 )
1256
1263
install (TARGETS ${the_target} RUNTIME DESTINATION "samples/${module_id} " COMPONENT samples)
Original file line number Diff line number Diff line change @@ -15,6 +15,15 @@ function(ocv_define_sample out_target source sub)
15
15
if (WIN32 )
16
16
install (TARGETS ${the_target} RUNTIME DESTINATION "samples/${sub} " COMPONENT samples)
17
17
endif ()
18
+ # Add single target to build all samples in the group: 'make opencv_samples_cpp'
19
+ set (parent_target opencv_samples_${sub} )
20
+ if (NOT TARGET ${parent_target} )
21
+ add_custom_target (${parent_target} )
22
+ if (TARGET opencv_samples)
23
+ add_dependencies (opencv_samples ${parent_target} )
24
+ endif ()
25
+ endif ()
26
+ add_dependencies (${parent_target} ${the_target} )
18
27
set (${out_target} ${the_target} PARENT_SCOPE)
19
28
endfunction ()
20
29
@@ -63,7 +72,7 @@ ocv_install_example_src("." CMakeLists.txt)
63
72
if (INSTALL_C_EXAMPLES)
64
73
install (DIRECTORY data
65
74
DESTINATION "${OPENCV_SAMPLES_SRC_INSTALL_PATH} /data"
66
- COMPONENT samples )
75
+ COMPONENT samples_data )
67
76
endif ()
68
77
69
78
else ()
You can’t perform that action at this time.
0 commit comments