[Beignet] [PATCH] Build: fix the beignet icd name when CMAKE_INSTALL_FULL_LIBDIR is undefined.

Zhigang Gong zhigang.gong at intel.com
Mon Mar 16 17:28:04 PDT 2015


On some distributions, the CMAKE_INSTALL_FULL_LIBDIR or CMAKE_LIBRARY_ARCHITECTURE
may be undefined. To avoid generate intel-beignet-.icd file name, we need to get
rid of the extra "-" for such case.

Reported by Igor Gnatenko.

Signed-off-by: Zhigang Gong <zhigang.gong at intel.com>
---
 CMakeLists.txt | 10 ++++++++--
 1 file changed, 8 insertions(+), 2 deletions(-)

diff --git a/CMakeLists.txt b/CMakeLists.txt
index 9aa838a..ae3b313 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -43,7 +43,9 @@ INCLUDE (GNUInstallDirs OPTIONAL)
 # support old CMake without GNUInstallDirs
 if (NOT CMAKE_INSTALL_FULL_LIBDIR)
   set (CMAKE_INSTALL_FULL_LIBDIR "${CMAKE_INSTALL_PREFIX}/lib")
-  set (CMAKE_LIBRARY_ARCHITECTURE "")
+  set (BEIGNET_LIBRARY_ARCHITECTURE "")
+else (NOT CMAKE_INSTALL_FULL_LIBDIR)
+  set (BEIGNET_LIBRARY_ARCHITECTURE "${CMAKE_LIBRARY_ARCHITECTURE}")
 endif (NOT CMAKE_INSTALL_FULL_LIBDIR)
 
 if (NOT LIB_INSTALL_DIR)
@@ -58,7 +60,11 @@ endif (NOT BEIGNET_INSTALL_DIR)
 if (BEIGNET_INSTALL_DIR STREQUAL "${CMAKE_INSTALL_PREFIX}/lib/beignet/")
   set (ICD_FILE_NAME "intel-beignet.icd")
 else (BEIGNET_INSTALL_DIR STREQUAL "${CMAKE_INSTALL_PREFIX}/lib/beignet/")
-  set (ICD_FILE_NAME "intel-beignet-${CMAKE_LIBRARY_ARCHITECTURE}.icd")
+  if (BEIGNET_LIBRARY_ARCHITECTURE STREQUAL "")
+    set (ICD_FILE_NAME "intel-beignet.icd")
+  else (BEIGNET_LIBRARY_ARCHITECTURE STREQUAL "")
+    set (ICD_FILE_NAME "intel-beignet-${BEIGNET_LIBRARY_ARCHITECTURE}.icd")
+  endif (BEIGNET_LIBRARY_ARCHITECTURE STREQUAL "")
 endif (BEIGNET_INSTALL_DIR STREQUAL "${CMAKE_INSTALL_PREFIX}/lib/beignet/")
 
 # Force Release with debug info
-- 
1.9.1



More information about the Beignet mailing list