3 find_package(OpenCV REQUIRED)
6 message(STATUS "opencv found: ${OpenCV_INCLUDE_DIRS}")
8 message(FATAL_ERROR "opencv missing. please install opencv")
11 set(qtmainloop ON CACHE INTERNAL "")
13 add_definitions(-DCV_DATA="${OpenCV_CONFIG_PATH}")
16 message(STATUS "found opencv ocl headers. enabling opencl support. ${ocl}")
17 add_definitions(-DOPENCL)
19 message(STATUS "no opencl support")
22 option(cuda "enable cuda" OFF)
25 message(STATUS "found opencv cuda headers. enabling cuda support. ${cuda}")
26 add_definitions(-DCUDA)
28 message(STATUS "no opencv cuda headers found. no cuda support")
29 remove_definitions(-DCUDA)
32 find_package(Qt5Core REQUIRED)
35 set(QT_INCLUDE_DIRS ${Qt5Core_INCLUDE_DIRS} )
36 set(QT_LIBRARIES ${Qt5Core_LIBRARIES} )
37 set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} ${Qt5Core_EXECUTABLE_COMPILE_FLAGS}")
38 add_definitions(${Qt5Core_DEFINITIONS})
39 add_definitions(-DQT_NO_KEYWORDS)
43 include_directories(${CMAKE_SOURCE_DIR}/lib ${include_dirs} ${OpenCV_INCLUDE_DIRS} ${Boost_INCLUDE_DIRS} ${QT_INCLUDE_DIRS} ${CMAKE_SOURCE_DIR}/plugins/common)
45 set(opencvluxplugin_headers opencvluxplugin.h)
46 set(opencvluxplugin_sources opencvluxplugin.cpp)
48 add_library(opencvluxplugin MODULE ${opencvluxplugin_sources})
49 set_target_properties(opencvluxplugin PROPERTIES PREFIX "")
50 target_link_libraries(opencvluxplugin amb -L${CMAKE_CURRENT_BINARY_DIR}/lib ${link_libraries} ${OpenCV_LIBS} ${Boost_LIBRARIES} ${QT_LIBRARIES} amb-plugins-common -L${CMAKE_CURRENT_BINARY_DIR}/plugins/common)
52 install(TARGETS opencvluxplugin LIBRARY DESTINATION ${PLUGIN_INSTALL_PATH})
54 configure_file(${CMAKE_CURRENT_SOURCE_DIR}/README ${CMAKE_CURRENT_BINARY_DIR}/opencvlux.README @ONLY)
55 set(opencvlux_doc_files ${CMAKE_CURRENT_BINARY_DIR}/opencvlux.README)
56 install (FILES ${opencvlux_doc_files} DESTINATION ${DOC_INSTALL_DIR}/plugins)
58 endif(opencvlux_plugin)