Merge pull request #30 from tripzero/master
[profile/ivi/automotive-message-broker.git] / plugins / opencvlux / CMakeLists.txt
1 if(opencvlux_plugin)
2
3 set(qtmainloop "ON")
4
5 find_package(OpenCV REQUIRED)
6
7 if(OpenCV_LIBS)
8    message(STATUS "opencv found: ${OpenCV_INCLUDE_DIRS}")
9 else(OpenCV_LIBS)
10    message(FATAL_ERROR "opencv missing.  please install opencv")
11 endif(OpenCV_LIBS)
12
13 option(ocl "enable opencl" OFF)
14
15 add_definitions(-DCV_DATA="${OpenCV_CONFIG_PATH}")
16
17 if(ocl)
18   message(STATUS "found opencv ocl headers. enabling opencl support. ${ocl}")
19   add_definitions(-DOPENCL)
20 else(ocl)
21   message(STATUS "no opencl support")
22 endif(ocl)
23
24 option(cuda "enable cuda" OFF)
25
26 if(cuda)
27   message(STATUS "found opencv cuda headers.  enabling cuda support. ${cuda}")
28   add_definitions(-DCUDA)
29 else(cuda)
30   message(STATUS "no opencv cuda headers found.  no cuda support")
31   remove_definitions(-DCUDA)
32 endif(cuda)
33
34 find_package(Qt5Core REQUIRED)
35
36 if(Qt5Core_FOUND)
37   message(STATUS "using Qt5")
38
39   set(QT_INCLUDE_DIRS ${Qt5Core_INCLUDE_DIRS} )
40   set(QT_LIBRARIES ${Qt5Core_LIBRARIES} )
41   set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} ${Qt5Core_EXECUTABLE_COMPILE_FLAGS}")
42   message(STATUS "size of void_p: ${CMAKE_SIZEOF_VOID_P}")
43   add_definitions(${Qt5Core_DEFINITIONS})
44   add_definitions(-DQT_NO_KEYWORDS)
45
46 endif(Qt5Core_FOUND)
47 set(CMAKE_AUTOMOC ON)
48
49 include_directories(${CMAKE_SOURCE_DIR}/lib ${include_dirs} ${OpenCV_INCLUDE_DIRS} ${Boost_INCLUDE_DIRS} ${QT_INCLUDE_DIRS})
50
51 set(opencvluxplugin_headers opencvluxplugin.h)
52 set(opencvluxplugin_sources opencvluxplugin.cpp)
53
54 add_library(opencvluxplugin MODULE ${opencvluxplugin_sources})
55 set_target_properties(opencvluxplugin PROPERTIES PREFIX "")
56 target_link_libraries(opencvluxplugin amb -L${CMAKE_CURRENT_BINARY_DIR}/lib ${link_libraries} ${OpenCV_LIBS} ${Boost_LIBRARIES} ${QT_LIBRARIES})
57
58 install(TARGETS opencvluxplugin LIBRARY DESTINATION ${PLUGIN_INSTALL_PATH})
59
60 endif(opencvlux_plugin)