opencl works
[profile/ivi/automotive-message-broker.git] / plugins / opencvlux / CMakeLists.txt
index 8691e59..f7ef01c 100644 (file)
@@ -1,45 +1,47 @@
 if(opencvlux_plugin)
 
+set(qtmainloop "ON")
+
 find_package(OpenCV REQUIRED)
 
 if(OpenCV_LIBS)
-        message(STATUS "opencv found")
+   message(STATUS "opencv found: ${OpenCV_INCLUDE_DIRS}")
 else(OpenCV_LIBS)
-        message(FATAL_ERROR "opencv missing.  please install opencv")
+   message(FATAL_ERROR "opencv missing.  please install opencv")
 endif(OpenCV_LIBS)
 
 option(ocl "enable opencl" OFF)
 
+add_definitions(-DCV_DATA="${OpenCV_CONFIG_PATH}")
+
 if(ocl)
-       message(STATUS "found opencv ocl headers. enabling opencl support. ${ocl}")
-       add_definitions(-DOPENCL)
+  message(STATUS "found opencv ocl headers. enabling opencl support. ${ocl}")
+  add_definitions(-DOPENCL)
 else(ocl)
-       message(STATUS "no opencl support")
+  message(STATUS "no opencl support")
 endif(ocl)
 
 option(cuda "enable cuda" OFF)
 
 if(cuda)
-       message(STATUS "found opencv cuda headers.  enabling cuda support. ${cuda}")
-       add_definitions(-DCUDA)
+  message(STATUS "found opencv cuda headers.  enabling cuda support. ${cuda}")
+  add_definitions(-DCUDA)
 else(cuda)
-       message(STATUS "no opencv cuda headers found.  no cuda support")
-       remove_definitions(-DCUDA)
+  message(STATUS "no opencv cuda headers found.  no cuda support")
+  remove_definitions(-DCUDA)
 endif(cuda)
 
 find_package(Qt5Core REQUIRED)
 
 if(Qt5Core_FOUND)
-       message(STATUS "using Qt5")
+  message(STATUS "using Qt5")
 
-       set(QT_INCLUDE_DIRS ${Qt5Core_INCLUDE_DIRS} )
-       set(QT_LIBRARIES ${Qt5Core_LIBRARIES} )
-       set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} ${Qt5Core_EXECUTABLE_COMPILE_FLAGS}")
-       message(STATUS "size of void_p: ${CMAKE_SIZEOF_VOID_P}")
-       #if(CMAKE_SIZEOF_VOID_P MATCHES "8")
-       #       set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -mcmodel=large")
-       #endif(CMAKE_SIZEOF_VOID_P MATCHES "8")
-       add_definitions(${Qt5Core_DEFINITIONS})
+  set(QT_INCLUDE_DIRS ${Qt5Core_INCLUDE_DIRS} )
+  set(QT_LIBRARIES ${Qt5Core_LIBRARIES} )
+  set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} ${Qt5Core_EXECUTABLE_COMPILE_FLAGS}")
+  message(STATUS "size of void_p: ${CMAKE_SIZEOF_VOID_P}")
+  add_definitions(${Qt5Core_DEFINITIONS})
+  add_definitions(-DQT_NO_KEYWORDS)
 
 endif(Qt5Core_FOUND)
 set(CMAKE_AUTOMOC ON)
@@ -53,6 +55,6 @@ add_library(opencvluxplugin MODULE ${opencvluxplugin_sources})
 set_target_properties(opencvluxplugin PROPERTIES PREFIX "")
 target_link_libraries(opencvluxplugin amb -L${CMAKE_CURRENT_BINARY_DIR}/lib ${link_libraries} ${OpenCV_LIBS} ${Boost_LIBRARIES} ${QT_LIBRARIES})
 
-install(TARGETS opencvluxplugin LIBRARY DESTINATION lib${LIB_SUFFIX}/automotive-message-broker)
+install(TARGETS opencvluxplugin LIBRARY DESTINATION ${PLUGIN_INSTALL_PATH})
 
 endif(opencvlux_plugin)