提交 2dff2f36 编写于 作者: M Maksim Shabunin

Install: added prebuilt samples installation

上级 6b674709
......@@ -463,6 +463,7 @@ OCV_OPTION(BUILD_JAVA "Enable Java support"
# OpenCV installation options
# ===================================================
OCV_OPTION(INSTALL_CREATE_DISTRIB "Change install rules to build the distribution package" OFF )
OCV_OPTION(INSTALL_BIN_EXAMPLES "Install prebuilt examples" WIN32 IF BUILD_EXAMPLES)
OCV_OPTION(INSTALL_C_EXAMPLES "Install C examples" OFF )
OCV_OPTION(INSTALL_PYTHON_EXAMPLES "Install Python examples" OFF )
OCV_OPTION(INSTALL_ANDROID_EXAMPLES "Install Android examples" OFF IF ANDROID )
......
......@@ -1337,8 +1337,8 @@ function(ocv_add_samples)
endif()
add_dependencies(${parent_target} ${the_target})
if(WIN32)
install(TARGETS ${the_target} RUNTIME DESTINATION "samples/${module_id}" COMPONENT samples)
if(INSTALL_BIN_EXAMPLES)
install(TARGETS ${the_target} RUNTIME DESTINATION "${OPENCV_SAMPLES_BIN_INSTALL_PATH}/${module_id}" COMPONENT samples)
endif()
endforeach()
endif()
......
......@@ -15,8 +15,12 @@ function(ocv_define_sample out_target source sub)
if(WIN32 AND MSVC AND NOT BUILD_SHARED_LIBS)
set_target_properties(${the_target} PROPERTIES LINK_FLAGS "/NODEFAULTLIB:atlthunk.lib /NODEFAULTLIB:atlsd.lib /DEBUG")
endif()
if(WIN32)
install(TARGETS ${the_target} RUNTIME DESTINATION "samples/${sub}" COMPONENT samples)
# Should be usable in stand-alone build scenario
if((NOT DEFINED INSTALL_BIN_EXAMPLES AND WIN32) OR INSTALL_BIN_EXAMPLES)
if(NOT DEFINED OPENCV_SAMPLES_BIN_INSTALL_PATH)
set(OPENCV_SAMPLES_BIN_INSTALL_PATH "samples")
endif()
install(TARGETS ${the_target} RUNTIME DESTINATION "${OPENCV_SAMPLES_BIN_INSTALL_PATH}/${sub}" COMPONENT samples)
endif()
# Add single target to build all samples in the group: 'make opencv_samples_cpp'
set(parent_target opencv_samples_${sub})
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册