2024-04-16 01:09:42 +00:00
|
|
|
cmake_minimum_required(VERSION 3.9)
|
|
|
|
|
|
|
|
project(filmout_display)
|
|
|
|
|
|
|
|
set(CMAKE_CXX_STANDARD 17)
|
|
|
|
set(CMAKE_VERBOSE_MAKEFILE ON)
|
|
|
|
set(CMAKE_MODULE_PATH ${CMAKE_MODULE_PATH} ${CMAKE_CURRENT_SOURCE_DIR}/cmake-modules)
|
|
|
|
|
2024-04-20 01:48:14 +00:00
|
|
|
set(TESTING_ON FALSE)
|
2024-04-16 16:25:59 +00:00
|
|
|
|
2024-04-16 01:09:42 +00:00
|
|
|
find_package(OpenGL REQUIRED)
|
|
|
|
find_package(GLUT REQUIRED)
|
|
|
|
find_package(OpenCV HINTS /usr/local/opt/opencv /usr/local/Cellar/opencv REQUIRED)
|
|
|
|
|
2024-04-24 19:58:30 +00:00
|
|
|
|
2024-04-20 01:48:14 +00:00
|
|
|
file(GLOB SOURCES "src/*.cpp")
|
2024-04-16 01:09:42 +00:00
|
|
|
|
2024-04-20 01:48:14 +00:00
|
|
|
if(${TESTING_ON})
|
|
|
|
ENABLE_TESTING()
|
|
|
|
ADD_SUBDIRECTORY( test )
|
|
|
|
SET(UNIT_TEST state_test)
|
|
|
|
add_test(NAME ${UNIT_TEST} COMMAND ${UNIT_TEST})
|
|
|
|
add_custom_target(run_unit_test ALL
|
|
|
|
COMMAND ${CMAKE_CTEST_COMMAND} --output-on-failure
|
|
|
|
DEPENDS ${UNIT_TEST})
|
|
|
|
endif()
|
2024-04-16 16:25:59 +00:00
|
|
|
|
2024-04-16 01:09:42 +00:00
|
|
|
set(EXECUTABLE_OUTPUT_PATH ${CMAKE_BINARY_DIR}/bin)
|
2024-04-20 01:48:14 +00:00
|
|
|
add_executable( fd ${SOURCES} )
|
|
|
|
|
|
|
|
target_include_directories(fd PRIVATE include)
|
2024-04-16 01:09:42 +00:00
|
|
|
|
|
|
|
if (APPLE)
|
|
|
|
# Equivalent to pass flags -framework OpenGL
|
2024-10-22 19:17:58 +00:00
|
|
|
target_link_libraries(fd OpenGL::GL GLUT::GLUT ${OpenCV_LIBS} pthread)
|
2024-04-16 01:09:42 +00:00
|
|
|
else()
|
2024-10-22 19:17:58 +00:00
|
|
|
target_link_libraries(fd GL GLU glut ${OpenCV_LIBS} pthread)
|
2024-04-16 01:09:42 +00:00
|
|
|
endif()
|