summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorYang, Rong R <rong.r.yang@intel.com>2017-04-26 14:04:10 +0800
committerYang Rong <rong.r.yang@intel.com>2017-07-27 16:19:28 +0800
commiteb33de15afbe40a3c8cfc7ff356e449134d98bd5 (patch)
tree0383c9011c3298bc34cffeec6b9552e3e912f060
parent71e568fa595443faac9b5cce4dddfdc8f6cc2157 (diff)
cmake: add option OCL_ICD_INSTALL_PREFIX to set icd file install path.
It is for the user who don't has root permission. V2: change to option name to OCL_ICD_INSTALL_PREFIX. Signed-off-by: Yang Rong <rong.r.yang@intel.com> Reviewed-by: Ruiling Song <ruiling.song@intel.com>
-rw-r--r--CMakeLists.txt27
1 files changed, 15 insertions, 12 deletions
diff --git a/CMakeLists.txt b/CMakeLists.txt
index 7e016881..71e3ef7d 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_INSTALL_PREFIX)
+ set(OCL_ICD_INSTALL_PREFIX "/etc/OpenCL/vendors")
+ ENDIF(NOT OCL_ICD_INSTALL_PREFIX)
+ install (FILES ${CMAKE_CURRENT_BINARY_DIR}/${ICD_FILE_NAME} DESTINATION ${OCL_ICD_INSTALL_PREFIX})
+ 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)