summaryrefslogtreecommitdiff
path: root/CMake
diff options
context:
space:
mode:
authorZhigang Gong <zhigang.gong@linux.intel.com>2013-02-21 19:33:55 +0800
committerZhigang Gong <zhigang.gong@linux.intel.com>2013-04-10 14:51:30 +0800
commit680cd016b500d858bc1a657a92f76fdccfd38e03 (patch)
tree901a4b46e7dc6d0d5d10746ded96d521531dad45 /CMake
parent02939d201352f5a5cf2b1335c7abcfbfee496d90 (diff)
Find GBM/EGL library at build time.
We will change to use EGL_KHR_gl_texture_2D_image and GBM library to implement OCL and OGL interoperation. We need to check GBM. Signed-off-by: Zhigang Gong <zhigang.gong@linux.intel.com> Tested-by: Homer Hsing <homer.xing@intel.com>
Diffstat (limited to 'CMake')
-rw-r--r--CMake/FindEGL.cmake35
-rw-r--r--CMake/FindGBM.cmake35
2 files changed, 70 insertions, 0 deletions
diff --git a/CMake/FindEGL.cmake b/CMake/FindEGL.cmake
new file mode 100644
index 00000000..703ff64c
--- /dev/null
+++ b/CMake/FindEGL.cmake
@@ -0,0 +1,35 @@
+#
+# Try to find EGL library and include path.
+# Once done this will define
+#
+# EGL_FOUND
+# EGL_INCLUDE_PATH
+# EGL_LIBRARY
+#
+
+FIND_PATH(EGL_INCLUDE_PATH EGL/egl.h
+ ~/include/
+ /usr/include/
+ /usr/local/include/
+ /sw/include/
+ /opt/local/include/
+ DOC "The directory where gen/program.h resides")
+FIND_LIBRARY(EGL_LIBRARY
+ NAMES EGL egl
+ PATHS
+ ~/lib/
+ /usr/lib64
+ /usr/lib
+ /usr/local/lib64
+ /usr/local/lib
+ /sw/lib
+ /opt/local/lib
+ DOC "The EGL library")
+
+IF(EGL_INCLUDE_PATH)
+ SET(EGL_FOUND 1 CACHE STRING "Set to 1 if EGL is found, 0 otherwise")
+ELSE(EGL_INCLUDE_PATH)
+ SET(EGL_FOUND 0 CACHE STRING "Set to 1 if EGL is found, 0 otherwise")
+ENDIF(EGL_INCLUDE_PATH)
+
+MARK_AS_ADVANCED(EGL_FOUND)
diff --git a/CMake/FindGBM.cmake b/CMake/FindGBM.cmake
new file mode 100644
index 00000000..d3b60865
--- /dev/null
+++ b/CMake/FindGBM.cmake
@@ -0,0 +1,35 @@
+#
+# Try to find gbm library and include path.
+# Once done this will define
+#
+# GBM_FOUND
+# GBM_INCLUDE_PATH
+# GBM_LIBRARY
+#
+
+FIND_PATH(GBM_INCLUDE_PATH gbm.h
+ ~/include/
+ /usr/include/
+ /usr/local/include/
+ /sw/include/
+ /opt/local/include/
+ DOC "The directory where gen/program.h resides")
+FIND_LIBRARY(GBM_LIBRARY
+ NAMES GBM gbm
+ PATHS
+ ~/lib/
+ /usr/lib64
+ /usr/lib
+ /usr/local/lib64
+ /usr/local/lib
+ /sw/lib
+ /opt/local/lib
+ DOC "The GBM library")
+
+IF(GBM_INCLUDE_PATH)
+ SET(GBM_FOUND 1 CACHE STRING "Set to 1 if GBM is found, 0 otherwise")
+ELSE(GBM_INCLUDE_PATH)
+ SET(GBM_FOUND 0 CACHE STRING "Set to 1 if GBM is found, 0 otherwise")
+ENDIF(GBM_INCLUDE_PATH)
+
+MARK_AS_ADVANCED(GBM_FOUND)