[Beignet] [PATCH] Add the drm include and lib path for find when drm is not the system one.
junyan.he at inbox.com
junyan.he at inbox.com
Tue Nov 26 01:59:54 PST 2013
From: Junyan He <junyan.he at linux.intel.com>
Add the support when the DRM lib is not in the system standard location.
In some cases, we want to debug the libdrm but not want to influence the
whole system.
Signed-off-by: Junyan He <junyan.he at linux.intel.com>
---
CMake/FindDRM.cmake | 7 ++++++-
CMake/FindDRMIntel.cmake | 7 ++++++-
src/CMakeLists.txt | 1 +
3 files changed, 13 insertions(+), 2 deletions(-)
diff --git a/CMake/FindDRM.cmake b/CMake/FindDRM.cmake
index 3de35bf..a5a4ebc 100644
--- a/CMake/FindDRM.cmake
+++ b/CMake/FindDRM.cmake
@@ -7,7 +7,11 @@
# DRM_LIBRARY
#
-FIND_PATH(DRM_INCLUDE_PATH drm.h
+FIND_PATH(DRM_INCLUDE_PATH
+ NAMES
+ drm.h
+ PATHS
+ ${CMAKE_INCLUDE_PATH}/include/libdrm/
~/include/libdrm/
/usr/include/libdrm/
/usr/local/include/libdrm/
@@ -17,6 +21,7 @@ FIND_PATH(DRM_INCLUDE_PATH drm.h
FIND_LIBRARY(DRM_LIBRARY
NAMES DRM drm
PATHS
+ ${CMAKE_LIBRARY_PATH}/lib/
~/lib/
/usr/lib64
/usr/lib
diff --git a/CMake/FindDRMIntel.cmake b/CMake/FindDRMIntel.cmake
index 2d45c64..0aab1c7 100644
--- a/CMake/FindDRMIntel.cmake
+++ b/CMake/FindDRMIntel.cmake
@@ -6,7 +6,11 @@
# DRM_INTEL_INCLUDE_PATH
#
-FIND_PATH(DRM_INTEL_INCLUDE_PATH intel_bufmgr.h
+FIND_PATH(DRM_INTEL_INCLUDE_PATH
+ NAMES
+ intel_bufmgr.h
+ PATHS
+ ${CMAKE_INCLUDE_PATH}/include/libdrm/
~/include/libdrm/
/usr/include/libdrm/
/usr/local/include/libdrm/
@@ -17,6 +21,7 @@ FIND_PATH(DRM_INTEL_INCLUDE_PATH intel_bufmgr.h
FIND_LIBRARY(DRM_INTEL_LIBRARY
NAMES DRM_INTEL drm_intel
PATHS
+ ${CMAKE_LIBRARY_PATH}/lib/
~/lib/
/usr/lib64
/usr/lib
diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt
index 59d330e..b997f94 100644
--- a/src/CMakeLists.txt
+++ b/src/CMakeLists.txt
@@ -1,5 +1,6 @@
include_directories(${CMAKE_CURRENT_SOURCE_DIR}
${DRM_INCLUDE_PATH}
+ ${DRM_INCLUDE_PATH}/../
${CMAKE_CURRENT_SOURCE_DIR}/../backend/src/backend/
${CMAKE_CURRENT_SOURCE_DIR}/../include
${MESA_SOURCE_INCLUDES})
--
1.8.3.2
More information about the Beignet
mailing list