File tree Expand file tree Collapse file tree 3 files changed +9
-4
lines changed Expand file tree Collapse file tree 3 files changed +9
-4
lines changed Original file line number Diff line number Diff line change @@ -463,6 +463,7 @@ OCV_OPTION(BUILD_JAVA "Enable Java support"
463
463
# OpenCV installation options
464
464
# ===================================================
465
465
OCV_OPTION (INSTALL_CREATE_DISTRIB "Change install rules to build the distribution package" OFF )
466
+ OCV_OPTION (INSTALL_BIN_EXAMPLES "Install prebuilt examples" WIN32 IF BUILD_EXAMPLES )
466
467
OCV_OPTION (INSTALL_C_EXAMPLES "Install C examples" OFF )
467
468
OCV_OPTION (INSTALL_PYTHON_EXAMPLES "Install Python examples" OFF )
468
469
OCV_OPTION (INSTALL_ANDROID_EXAMPLES "Install Android examples" OFF IF ANDROID )
Original file line number Diff line number Diff line change @@ -1337,8 +1337,8 @@ function(ocv_add_samples)
1337
1337
endif ()
1338
1338
add_dependencies (${parent_target} ${the_target} )
1339
1339
1340
- if (WIN32 )
1341
- install (TARGETS ${the_target} RUNTIME DESTINATION "samples /${module_id} " COMPONENT samples )
1340
+ if (INSTALL_BIN_EXAMPLES )
1341
+ install (TARGETS ${the_target} RUNTIME DESTINATION "${OPENCV_SAMPLES_BIN_INSTALL_PATH} /${module_id} " COMPONENT samples )
1342
1342
endif ()
1343
1343
endforeach ()
1344
1344
endif ()
Original file line number Diff line number Diff line change @@ -15,8 +15,12 @@ function(ocv_define_sample out_target source sub)
15
15
if (WIN32 AND MSVC AND NOT BUILD_SHARED_LIBS )
16
16
set_target_properties (${the_target} PROPERTIES LINK_FLAGS "/NODEFAULTLIB:atlthunk.lib /NODEFAULTLIB:atlsd.lib /DEBUG" )
17
17
endif ()
18
- if (WIN32 )
19
- install (TARGETS ${the_target} RUNTIME DESTINATION "samples/${sub} " COMPONENT samples )
18
+ # Should be usable in stand-alone build scenario
19
+ if ((NOT DEFINED INSTALL_BIN_EXAMPLES AND WIN32 ) OR INSTALL_BIN_EXAMPLES )
20
+ if (NOT DEFINED OPENCV_SAMPLES_BIN_INSTALL_PATH )
21
+ set (OPENCV_SAMPLES_BIN_INSTALL_PATH "samples" )
22
+ endif ()
23
+ install (TARGETS ${the_target} RUNTIME DESTINATION "${OPENCV_SAMPLES_BIN_INSTALL_PATH} /${sub} " COMPONENT samples )
20
24
endif ()
21
25
# Add single target to build all samples in the group: 'make opencv_samples_cpp'
22
26
set (parent_target opencv_samples_${sub} )
You can’t perform that action at this time.
0 commit comments