CMakeLists.txt 1.3 KB

1234567891011121314151617181920212223242526272829303132333435
  1. # ---[ OpenCV
  2. set(OpenCV_FIND_QUIETLY true)
  3. find_package(OpenCV OPTIONAL_COMPONENTS imgcodecs)
  4. set(imgcodecs_libs ${OpenCV_LIBS})
  5. find_package(OpenCV REQUIRED core imgproc highgui)
  6. if(OpenCV_FOUND)
  7. message(STATUS "OpenCV Found, libraries: ${OpenCV_LIBS}")
  8. else()
  9. message(FATAL_ERROR "Can not find OpenCV libs!")
  10. endif()
  11. if(imgcodecs_FOUND)
  12. list(APPEND OpenCV_LIBS ${imgcodecs_libs})
  13. endif()
  14. file(GLOB test_srcs ${CMAKE_CURRENT_SOURCE_DIR}/src/*.cpp)
  15. if(CMAKE_SYSTEM_PROCESSOR STREQUAL x86_64)
  16. list(APPEND test_srcs ${CMAKE_CURRENT_SOURCE_DIR}/src/resize/test_resize_yuv2yuv_invoke.cpp)
  17. endif()
  18. set(EXECUTABLE_OUTPUT_PATH ${CMAKE_CURRENT_SOURCE_DIR}/bin/)
  19. message(STATUS "@@@@@@@@@@@ Target : test_edk")
  20. add_executable(tests_edk ${test_srcs})
  21. add_sanitizers(tests_edk)
  22. target_include_directories(tests_edk PRIVATE
  23. ${NEUWARE_INCLUDE_DIR}
  24. ${OpenCV_INCLUDE_DIRS}
  25. ${CMAKE_CURRENT_SOURCE_DIR}/src
  26. ${PROJECT_SOURCE_DIR}/include)
  27. target_link_libraries(tests_edk PRIVATE pthread dl gtest gtest_main easydk ${OpenCV_LIBS})
  28. target_compile_options(tests_edk PRIVATE "-Wno-deprecated-declarations")
  29. target_compile_definitions(tests_edk PRIVATE ${EDK_DEFINITIONS})
  30. install(TARGETS tests_edk RUNTIME DESTINATION bin)