1set(OPENCV_CREATESAMPLES_DEPS opencv_core opencv_imgproc opencv_objdetect opencv_imgcodecs opencv_highgui opencv_calib3d opencv_features2d opencv_videoio)
2ocv_check_dependencies(${OPENCV_CREATESAMPLES_DEPS})
3
4if(NOT OCV_DEPENDENCIES_FOUND)
5  return()
6endif()
7
8project(createsamples)
9set(the_target opencv_createsamples)
10
11ocv_target_include_directories(${the_target} PRIVATE "${CMAKE_CURRENT_SOURCE_DIR}" "${OpenCV_SOURCE_DIR}/include/opencv")
12ocv_target_include_modules_recurse(${the_target} ${OPENCV_CREATESAMPLES_DEPS})
13
14file(GLOB SRCS *.cpp)
15file(GLOB HDRS *.h*)
16
17set(createsamples_files ${SRCS} ${HDRS})
18
19ocv_add_executable(${the_target} ${createsamples_files})
20ocv_target_link_libraries(${the_target} ${OPENCV_CREATESAMPLES_DEPS})
21
22set_target_properties(${the_target} PROPERTIES
23                      DEBUG_POSTFIX "${OPENCV_DEBUG_POSTFIX}"
24                      ARCHIVE_OUTPUT_DIRECTORY ${LIBRARY_OUTPUT_PATH}
25                      RUNTIME_OUTPUT_DIRECTORY ${EXECUTABLE_OUTPUT_PATH}
26                      INSTALL_NAME_DIR lib
27                      OUTPUT_NAME "opencv_createsamples")
28
29if(ENABLE_SOLUTION_FOLDERS)
30  set_target_properties(${the_target} PROPERTIES FOLDER "applications")
31endif()
32
33if(INSTALL_CREATE_DISTRIB)
34  if(BUILD_SHARED_LIBS)
35    install(TARGETS ${the_target} RUNTIME DESTINATION ${OPENCV_BIN_INSTALL_PATH} CONFIGURATIONS Release COMPONENT dev)
36  endif()
37else()
38  install(TARGETS ${the_target} OPTIONAL RUNTIME DESTINATION ${OPENCV_BIN_INSTALL_PATH} COMPONENT dev)
39endif()
40