mirror of
https://github.com/opencv/opencv.git
synced 2024-12-19 03:58:31 +08:00
555c505b70
Allow to build samples via OpenCV binaries from distribution package (find_package with OpenCV_DIR).
35 lines
1.0 KiB
CMake
35 lines
1.0 KiB
CMake
set(the_target "example_gpu_performance")
|
|
|
|
file(GLOB sources "performance/*.cpp")
|
|
file(GLOB headers "performance/*.h")
|
|
|
|
if(HAVE_opencv_nonfree)
|
|
ocv_include_directories("${OpenCV_SOURCE_DIR}/modules/nonfree/include")
|
|
endif()
|
|
|
|
add_executable(${the_target} ${sources} ${headers})
|
|
target_link_libraries(${the_target} ${OPENCV_LINKER_LIBS} ${OPENCV_GPU_SAMPLES_REQUIRED_DEPS})
|
|
|
|
if(HAVE_opencv_nonfree)
|
|
target_link_libraries(${the_target} opencv_nonfree)
|
|
endif()
|
|
|
|
set_target_properties(${the_target} PROPERTIES
|
|
OUTPUT_NAME "performance_gpu"
|
|
PROJECT_LABEL "(EXAMPLE_GPU) performance")
|
|
|
|
if(ENABLE_SOLUTION_FOLDERS)
|
|
set_target_properties(${the_target} PROPERTIES FOLDER "samples//gpu")
|
|
endif()
|
|
|
|
if(WIN32)
|
|
install(TARGETS ${the_target} RUNTIME DESTINATION "${OPENCV_SAMPLES_BIN_INSTALL_PATH}/gpu" COMPONENT main)
|
|
endif()
|
|
|
|
if(INSTALL_C_EXAMPLES AND NOT WIN32)
|
|
file(GLOB GPU_FILES performance/*.cpp performance/*.h)
|
|
install(FILES ${GPU_FILES}
|
|
DESTINATION share/OpenCV/samples/gpu/performance
|
|
PERMISSIONS OWNER_READ GROUP_READ WORLD_READ)
|
|
endif()
|