Permalink
Browse files

Merge pull request #11288 from lrusak/imx

[cmake] add imx support
  • Loading branch information...
2 parents b969808 + dd2e5f5 commit 2c4c414cdb2d2945b116597cee7ec35c54e95796 @fetzerch fetzerch committed on GitHub Jan 2, 2017
View
@@ -54,6 +54,7 @@ if(UNIX)
if(CORE_SYSTEM_NAME STREQUAL linux OR CORE_SYSTEM_NAME STREQUAL freebsd)
option(ENABLE_X11 "Enable X11 support?" ON)
option(ENABLE_AML "Enable AML?" OFF)
+ option(ENABLE_IMX "Enable IMX?" OFF)
endif()
endif()
# System options
@@ -220,6 +221,7 @@ endif()
if(CORE_SYSTEM_NAME STREQUAL android OR CORE_SYSTEM_NAME STREQUAL linux)
core_optional_dep(AML)
+ core_optional_dep(IMX)
elseif(CORE_SYSTEM_NAME STREQUAL rbpi)
core_require_dep(MMAL)
endif()
@@ -0,0 +1,38 @@
+#.rst:
+# FindIMX
+# -------
+# Finds the IMX codec
+#
+# This will will define the following variables::
+#
+# IMX_FOUND - system has IMX
+# IMX_INCLUDE_DIRS - the IMX include directory
+# IMX_DEFINITIONS - the IMX definitions
+# IMX_LIBRARIES - the IMX libraries
+
+if(PKG_CONFIG_FOUND)
+ pkg_check_modules(IMX fslvpuwrap QUIET)
+endif()
+
+find_path(IMX_INCLUDE_DIR NAMES vpu_wrapper.h
+ PATH_SUFFIXES imx-mm/vpu
+ PATHS ${PC_IMX_INCLUDEDIR})
+
+find_library(FSLVPUWRAP_LIBRARY NAMES fslvpuwrap
+ PATHS ${PC_IMX_LIBDIR})
+find_library(VPU_LIBRARY NAMES vpu
+ PATHS ${PC_IMX_LIBDIR})
+find_library(G2D_LIBRARY NAMES g2d
+ PATHS ${PC_IMX_LIBDIR})
+
+include(FindPackageHandleStandardArgs)
+find_package_handle_standard_args(IMX
+ REQUIRED_VARS IMX_INCLUDE_DIR FSLVPUWRAP_LIBRARY VPU_LIBRARY G2D_LIBRARY)
+
+if(IMX_FOUND)
+ set(IMX_INCLUDE_DIRS ${IMX_INCLUDE_DIR})
+ set(IMX_LIBRARIES ${FSLVPUWRAP_LIBRARY} ${VPU_LIBRARY} ${G2D_LIBRARY})
+ set(IMX_DEFINITIONS -DHAS_IMXVPU=1 -DLINUX -DEGL_API_FB)
+endif()
+
+mark_as_advanced(IMX_INCLUDE_DIR FSLVPUWRAP_LIBRARY VPU_LIBRARY G2D_LIBRARY)
@@ -40,4 +40,8 @@ if(OMXLIB_FOUND)
OMXCore.h)
endif()
+if(IMX_FOUND)
+ add_subdirectory(imx)
+endif()
+
core_add_library(linuxsupport)
@@ -35,6 +35,11 @@ if(CORE_SYSTEM_NAME STREQUAL android)
list(APPEND HEADERS VideoSyncAndroid.h)
endif()
+if(IMX_FOUND)
+ list(APPEND SOURCES VideoSyncIMX.cpp)
+ list(APPEND HEADERS VideoSyncIMX.h)
+endif()
+
if(SOURCES AND HEADERS)
core_add_library(video_sync)
endif()
@@ -1,5 +1,5 @@
if (NOT MIR_FOUND)
- if(OPENGLES_FOUND OR AML_FOUND OR MMAL_FOUND)
+ if(OPENGLES_FOUND OR AML_FOUND OR IMX_FOUND OR MMAL_FOUND)
set(SOURCES EGLWrapper.cpp)
set(HEADERS EGLNativeType.h
@@ -28,6 +28,11 @@ if(MMAL_FOUND)
list(APPEND HEADERS EGLNativeTypeRaspberryPI.h)
endif()
+if(IMX_FOUND)
+ list(APPEND SOURCES EGLNativeTypeIMX.cpp)
+ list(APPEND HEADERS EGLNativeTypeIMX.h)
+endif()
+
if(SOURCES)
core_add_library(windowing_egl)
endif()

0 comments on commit 2c4c414

Please sign in to comment.