summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorZhigang Gong <zhigang.gong@intel.com>2015-03-17 07:30:50 +0800
committerZhigang Gong <zhigang.gong@intel.com>2015-03-17 08:27:10 +0800
commit8c9da35f900900770dab06976d0b31b91d183682 (patch)
treea2f51af454ad9ec42e4566072cb6a27095bbaa94
parenta9b7d484ed2deb08189c95f653b29cdc3347e6e8 (diff)
Build: fix the beignet icd name when CMAKE_INSTALL_FULL_LIBDIR is undefined.
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@intel.com>
-rw-r--r--CMakeLists.txt10
1 files changed, 8 insertions, 2 deletions
diff --git a/CMakeLists.txt b/CMakeLists.txt
index 9aa838a3..ae3b313e 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