2024-03-30 23:55:56 +00:00
|
|
|
cmake_minimum_required(VERSION 3.9)
|
|
|
|
|
|
|
|
project(OpengGL_OpenCV_Example)
|
|
|
|
|
|
|
|
set(CMAKE_CXX_STANDARD 17)
|
|
|
|
set(CMAKE_VERBOSE_MAKEFILE ON)
|
|
|
|
set(CMAKE_MODULE_PATH ${CMAKE_MODULE_PATH} ${CMAKE_CURRENT_SOURCE_DIR}/cmake-modules)
|
|
|
|
|
2024-03-31 02:20:33 +00:00
|
|
|
find_package(OpenGL REQUIRED)
|
|
|
|
find_package(GLUT REQUIRED)
|
2024-03-30 23:55:56 +00:00
|
|
|
find_package(OpenCV HINTS /usr/local/opt/opencv /usr/local/Cellar/opencv REQUIRED)
|
|
|
|
|
|
|
|
set( NAME_SRC
|
|
|
|
main.cpp
|
|
|
|
)
|
|
|
|
|
|
|
|
set(EXECUTABLE_OUTPUT_PATH ${CMAKE_BINARY_DIR}/bin)
|
|
|
|
add_executable( opengl_opencv_example ${NAME_SRC} ${NAME_HEADERS} )
|
|
|
|
|
2024-03-31 02:20:33 +00:00
|
|
|
|
|
|
|
|
|
|
|
if (APPLE)
|
|
|
|
# Equivalent to pass flags -framework OpenGL
|
|
|
|
target_link_libraries(opengl_opencv_example OpenGL::GL GLUT::GLUT ${OpenCV_LIBS})
|
|
|
|
else()
|
|
|
|
target_link_libraries(opengl_opencv_example GL GLU glut ${OpenCV_LIBS} )
|
|
|
|
endif()
|