opencv/samples/opengl/CMakeLists.txt
Rostislav Vasilikhin fa745553bf
Merge pull request #24459 from savuor:tri_rasterize
Triangle rasterization function #24459

#24065 reopened since the previous one was automatically closed after rebase
Connected PR with ground truth data: [#1113@extra](https://github.com/opencv/opencv_extra/pull/1113)

### Pull Request Readiness Checklist

See details at https://github.com/opencv/opencv/wiki/How_to_contribute#making-a-good-pull-request

- [x] I agree to contribute to the project under Apache 2 License.
- [x] To the best of my knowledge, the proposed patch is not based on a code under GPL or another license that is incompatible with OpenCV
- [x] The PR is proposed to the proper branch
- [x] There is a reference to the original bug report and related work
- [x] There is accuracy test, performance test and test data in opencv_extra repository, if applicable
      Patch to opencv_extra has the same branch name.
- [x] The feature is well documented and sample code can be built with the project CMake
2024-02-19 12:23:05 +03:00

36 lines
1.0 KiB
CMake

if(APPLE)
return()
endif()
if(UNIX)
find_package(X11 QUIET)
endif()
SET(OPENCV_OPENGL_SAMPLES_REQUIRED_DEPS
opencv_core
opencv_imgproc
opencv_imgcodecs
opencv_3d
opencv_videoio
opencv_highgui)
ocv_check_dependencies(${OPENCV_OPENGL_SAMPLES_REQUIRED_DEPS})
if(BUILD_EXAMPLES AND OCV_DEPENDENCIES_FOUND)
project(opengl_samples)
ocv_include_modules_recurse(${OPENCV_OPENGL_SAMPLES_REQUIRED_DEPS})
file(GLOB all_samples RELATIVE ${CMAKE_CURRENT_SOURCE_DIR} *.cpp)
if(NOT X11_FOUND)
ocv_list_filterout(all_samples "opengl_interop")
endif()
foreach(sample_filename ${all_samples})
ocv_define_sample(tgt ${sample_filename} opengl)
ocv_target_link_libraries(${tgt} PRIVATE "${OPENGL_LIBRARIES}" "${OPENCV_OPENGL_SAMPLES_REQUIRED_DEPS}")
if(sample_filename STREQUAL "opengl_interop.cpp")
ocv_target_link_libraries(${tgt} PRIVATE ${X11_LIBRARIES})
ocv_target_include_directories(${tgt} ${X11_INCLUDE_DIR})
endif()
endforeach()
endif()
ocv_install_example_src(opengl *.cpp *.hpp CMakeLists.txt)