removed mcmodel compile option. added VideoLogging property to opencv plugin
[profile/ivi/automotive-message-broker.git] / plugins / opencvlux / CMakeLists.txt
1 if(opencvlux_plugin)
2
3 find_package(OpenCV REQUIRED)
4
5 if(OpenCV_LIBS)
6          message(STATUS "opencv found")
7 else(OpenCV_LIBS)
8          message(FATAL_ERROR "opencv missing.  please install opencv")
9 endif(OpenCV_LIBS)
10
11 option(ocl "enable opencl" OFF)
12
13 if(ocl)
14         message(STATUS "found opencv ocl headers. enabling opencl support. ${ocl}")
15         add_definitions(-DOPENCL)
16 else(ocl)
17         message(STATUS "no opencl support")
18 endif(ocl)
19
20 option(cuda "enable cuda" OFF)
21
22 if(cuda)
23         message(STATUS "found opencv cuda headers.  enabling cuda support. ${cuda}")
24         add_definitions(-DCUDA)
25 else(cuda)
26         message(STATUS "no opencv cuda headers found.  no cuda support")
27         remove_definitions(-DCUDA)
28 endif(cuda)
29
30 find_package(Qt5Core REQUIRED)
31
32 if(Qt5Core_FOUND)
33         message(STATUS "using Qt5")
34
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         message(STATUS "size of void_p: ${CMAKE_SIZEOF_VOID_P}")
39         #if(CMAKE_SIZEOF_VOID_P MATCHES "8")
40         #       set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -mcmodel=large")
41         #endif(CMAKE_SIZEOF_VOID_P MATCHES "8")
42         add_definitions(${Qt5Core_DEFINITIONS})
43
44 endif(Qt5Core_FOUND)
45 set(CMAKE_AUTOMOC ON)
46
47 include_directories(${CMAKE_SOURCE_DIR}/lib ${include_dirs} ${OpenCV_INCLUDE_DIRS} ${Boost_INCLUDE_DIRS} ${QT_INCLUDE_DIRS})
48
49 set(opencvluxplugin_headers opencvluxplugin.h)
50 set(opencvluxplugin_sources opencvluxplugin.cpp)
51
52 add_library(opencvluxplugin MODULE ${opencvluxplugin_sources})
53 set_target_properties(opencvluxplugin PROPERTIES PREFIX "")
54 target_link_libraries(opencvluxplugin amb -L${CMAKE_CURRENT_BINARY_DIR}/lib ${link_libraries} ${OpenCV_LIBS} ${Boost_LIBRARIES} ${QT_LIBRARIES})
55
56 install(TARGETS opencvluxplugin LIBRARY DESTINATION lib${LIB_SUFFIX}/automotive-message-broker)
57
58 endif(opencvlux_plugin)