[Beignet] [PATCH] cmake: add option OCL_ICD_CONFIG_PATH to set icd file install path.
Yang Rong
rong.r.yang at intel.com
Mon Apr 24 09:02:35 UTC 2017
It is for the user who don't has root permission.
Signed-off-by: Yang Rong <rong.r.yang at intel.com>
---
CMakeLists.txt | 27 +++++++++++++++------------
1 file changed, 15 insertions(+), 12 deletions(-)
diff --git a/CMakeLists.txt b/CMakeLists.txt
index 7e01688..ddc528c 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -211,18 +211,21 @@ ENDIF(EGL_FOUND)
OPTION(OCLICD_COMPAT "OCL ICD compatibility mode" ON)
IF(OCLICD_COMPAT)
-Find_Package(OCLIcd)
-IF(OCLIcd_FOUND)
- MESSAGE(STATUS "Looking for OCL ICD header file - found")
- configure_file (
- "intel-beignet.icd.in"
- "${ICD_FILE_NAME}"
- )
- install (FILES ${CMAKE_CURRENT_BINARY_DIR}/${ICD_FILE_NAME} DESTINATION /etc/OpenCL/vendors)
-ELSE(OCLIcd_FOUND)
- MESSAGE(STATUS "Looking for OCL ICD header file - not found")
- MESSAGE(FATAL_ERROR "OCL ICD loader miss. If you really want to disable OCL ICD support, please run cmake with option -DOCLICD_COMPAT=0.")
-ENDIF(OCLIcd_FOUND)
+ Find_Package(OCLIcd)
+ IF(OCLIcd_FOUND)
+ MESSAGE(STATUS "Looking for OCL ICD header file - found")
+ configure_file (
+ "intel-beignet.icd.in"
+ "${ICD_FILE_NAME}"
+ )
+ IF(NOT OCL_ICD_CONFIG_PATH)
+ set(OCL_ICD_CONFIG_PATH "/etc/OpenCL/vendors")
+ ENDIF(NOT OCL_ICD_CONFIG_PATH)
+ install (FILES ${CMAKE_CURRENT_BINARY_DIR}/${ICD_FILE_NAME} DESTINATION ${OCL_ICD_CONFIG_PATH})
+ ELSE(OCLIcd_FOUND)
+ MESSAGE(STATUS "Looking for OCL ICD header file - not found")
+ MESSAGE(FATAL_ERROR "OCL ICD loader miss. If you really want to disable OCL ICD support, please run cmake with option -DOCLICD_COMPAT=0.")
+ ENDIF(OCLIcd_FOUND)
ENDIF(OCLICD_COMPAT)
Find_Package(PythonInterp)
--
2.1.4
More information about the Beignet
mailing list