|
|
|
@ -69,11 +69,27 @@ if(BUILD_EXAMPLES AND OCV_DEPENDENCIES_FOUND) |
|
|
|
|
endif() |
|
|
|
|
ENDMACRO() |
|
|
|
|
|
|
|
|
|
# remove all matching elements from the list |
|
|
|
|
MACRO(list_filterout lst regex) |
|
|
|
|
foreach(item ${${lst}}) |
|
|
|
|
if(item MATCHES "${regex}") |
|
|
|
|
list(REMOVE_ITEM ${lst} "${item}") |
|
|
|
|
endif() |
|
|
|
|
endforeach() |
|
|
|
|
ENDMACRO() |
|
|
|
|
|
|
|
|
|
file(GLOB all_samples RELATIVE ${CMAKE_CURRENT_SOURCE_DIR} *.cpp) |
|
|
|
|
|
|
|
|
|
if(NOT WITH_OPENGL) |
|
|
|
|
if(NOT HAVE_OPENGL) |
|
|
|
|
list(REMOVE_ITEM all_samples "opengl.cpp") |
|
|
|
|
endif(NOT WITH_OPENGL) |
|
|
|
|
endif() |
|
|
|
|
|
|
|
|
|
if(NOT HAVE_CUDA) |
|
|
|
|
list(REMOVE_ITEM all_samples "opticalflow_nvidia_api.cpp") |
|
|
|
|
list(REMOVE_ITEM all_samples "cascadeclassifier_nvidia_api.cpp") |
|
|
|
|
list(REMOVE_ITEM all_samples "driver_api_multi.cpp") |
|
|
|
|
list(REMOVE_ITEM all_samples "driver_api_stereo_multi.cpp") |
|
|
|
|
endif() |
|
|
|
|
|
|
|
|
|
foreach(sample_filename ${all_samples}) |
|
|
|
|
get_filename_component(sample ${sample_filename} NAME_WE) |
|
|
|
@ -86,9 +102,16 @@ endif() |
|
|
|
|
|
|
|
|
|
if (OCV_DEPENDENCIES_FOUND AND INSTALL_C_EXAMPLES AND NOT WIN32) |
|
|
|
|
file(GLOB install_list *.c *.cpp *.jpg *.png *.data makefile.* build_all.sh *.dsp *.cmd ) |
|
|
|
|
if(NOT WITH_OPENGL) |
|
|
|
|
list(REMOVE_ITEM all_samples "opengl.cpp") |
|
|
|
|
endif(NOT WITH_OPENGL) |
|
|
|
|
message(" install_list: ${install_list}") |
|
|
|
|
if(NOT HAVE_OPENGL) |
|
|
|
|
list_filterout(install_list ".*opengl.cpp") |
|
|
|
|
endif() |
|
|
|
|
if(NOT HAVE_CUDA) |
|
|
|
|
list_filterout(install_list ".*opticalflow_nvidia_api.cpp") |
|
|
|
|
list_filterout(install_list ".*cascadeclassifier_nvidia_api.cpp") |
|
|
|
|
list_filterout(install_list ".*driver_api_multi.cpp") |
|
|
|
|
list_filterout(install_list ".*driver_api_stereo_multi.cpp") |
|
|
|
|
endif() |
|
|
|
|
install(FILES ${install_list} |
|
|
|
|
DESTINATION ${OPENCV_SAMPLES_SRC_INSTALL_PATH}/gpu |
|
|
|
|
PERMISSIONS OWNER_READ GROUP_READ WORLD_READ COMPONENT samples) |
|
|
|
|