Repository for OpenCV's extra modules
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 
 
 
 

48 lines
1.6 KiB

include("FindGLEW")
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")
ocv_module_disable(viz2d)
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")
else()
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -std=c++20")
endif()
endif()
include_directories(${glfw3_INCLUDE_DIRS})
include_directories(${GLEW_INCLUDE_DIRS})
include_directories(${nanovg_INCLUDE_DIRS})
include_directories(${nanogui_INCLUDE_DIRS})
link_directories(${glfw3_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()
ocv_module_include_directories()
ocv_create_module()
#ocv_add_samples(opencv_aruco)
ocv_warnings_disable(CMAKE_CXX_FLAGS -Wunused-parameter)
message(STATUS "viz2d: ${nangui_LIBRARIES}")
#For some reasone glfw3_LIBRARIES is empty although it is found by find_package
ocv_target_link_libraries(${the_module} glfw ${GLEW_LIBRARIES} ${nanovg_LIBRARIES} nanogui)