search for dependencies is CMakeLists

pull/3471/head
kallaballa 2 years ago
parent 30a073b3ce
commit 49c4e348ef
  1. 17
      modules/viz2d/CMakeLists.txt

@ -1,7 +1,10 @@
include("FindGLEW")
set(the_description "Viz2D Visualization Module")
include("FindPkgConfig")
set(the_description "Viz2D Visualization Module")
find_package(nanogui CONFIG)
find_package(glfw3 CONFIG)
pkg_check_modules(nanovg nanovg)
if(NOT glfw3_FOUND)
message(STATUS "Module opencv_viz2d disabled because GLFW3 was not found")
@ -9,6 +12,12 @@ if(NOT glfw3_FOUND)
elseif(NOT GLEW_FOUND)
message(STATUS "Module opencv_viz2d disabled because GLEW was not found")
ocv_module_disable(viz2d)
elseif(NOT nanovg_FOUND)
message(STATUS "Module opencv_viz2d disabled because NanoVG was not found")
ocv_module_disable(viz2d)
elseif(NOT nanogui_FOUND)
message(STATUS "Module opencv_viz2d disabled because NanoGUI was not found")
ocv_module_disable(viz2d)
else() # we need C++20
if(MSVC)
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} /Qstd=c++20")
@ -19,8 +28,12 @@ endif()
include_directories(${GLFW_INCLUDE_DIRS})
include_directories(${GLEW_INCLUDE_DIRS})
include_directories(${nanovg_INCLUDE_DIRS})
include_directories(${nanogui_INCLUDE_DIRS})
link_directories(${GLFW_LIBRARY_DIRS})
link_directories(${GLEW_LIBRARY_DIRS})
link_directories(${nanovg_LIBRARY_DIRS})
link_directories(${nanogui_LIBRARY_DIRS})
ocv_add_module(viz2d opencv_core opencv_imgproc opencv_videoio opencv_video)
ocv_glob_module_sources()
@ -30,4 +43,4 @@ ocv_create_module()
#ocv_add_samples(opencv_aruco)
ocv_warnings_disable(CMAKE_CXX_FLAGS -Wunused-parameter)
ocv_target_link_libraries(${the_module} ${GLFW_LIBRARIES} ${GLEW_LIBRARIES})
ocv_target_link_libraries(${the_module} ${GLFW_LIBRARIES} ${GLEW_LIBRARIES} ${nanovg_LIBRARIES} ${nanogui_LIBRARIES})

Loading…
Cancel
Save