cmake: fix OPENGL_LIBRARIES handling

pull/21213/head
Alexander Alekhin 3 years ago
parent 35ff9af6ce
commit 65392d5e6b
  1. 1
      cmake/OpenCVFindLibsGUI.cmake
  2. 1
      modules/core/CMakeLists.txt
  3. 1
      samples/cpp/CMakeLists.txt
  4. 2
      samples/opengl/CMakeLists.txt

@ -101,7 +101,6 @@ if(WITH_OPENGL)
find_package (OpenGL QUIET)
if(OPENGL_FOUND)
set(HAVE_OPENGL TRUE)
list(APPEND OPENCV_LINKER_LIBS ${OPENGL_LIBRARIES})
if(QT_QTOPENGL_FOUND)
set(HAVE_QT_OPENGL TRUE)
else()

@ -107,6 +107,7 @@ ocv_create_module(${extra_libs})
ocv_target_link_libraries(${the_module} PRIVATE
"${ZLIB_LIBRARIES}" "${OPENCL_LIBRARIES}" "${VA_LIBRARIES}"
"${OPENGL_LIBRARIES}"
"${LAPACK_LIBRARIES}" "${CPUFEATURES_LIBRARIES}" "${HALIDE_LIBRARIES}"
"${ITT_LIBRARIES}"
"${OPENCV_HAL_LINKER_LIBS}"

@ -56,6 +56,7 @@ foreach(sample_filename ${cpp_samples})
endif()
if(HAVE_OPENGL AND sample_filename MATCHES "detect_mser")
target_compile_definitions(${tgt} PRIVATE HAVE_OPENGL)
ocv_target_link_libraries(${tgt} PRIVATE "${OPENGL_LIBRARIES}")
endif()
if(sample_filename MATCHES "simd_")
# disabled intentionally - demonstration purposes only

@ -23,7 +23,7 @@ if(BUILD_EXAMPLES AND OCV_DEPENDENCIES_FOUND)
endif()
foreach(sample_filename ${all_samples})
ocv_define_sample(tgt ${sample_filename} opengl)
ocv_target_link_libraries(${tgt} PRIVATE ${OPENCV_LINKER_LIBS} ${OPENCV_OPENGL_SAMPLES_REQUIRED_DEPS})
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})

Loading…
Cancel
Save