[Beignet] [PATCH] cmake: use libdir macros
Igor Gnatenko
i.gnatenko.brain at gmail.com
Wed Jan 15 05:44:04 PST 2014
I don't like hardcoded paths. Let's use libdir macroses.
Signed-off-by: Igor Gnatenko <i.gnatenko.brain at gmail.com>
---
CMakeLists.txt | 3 +++
backend/src/CMakeLists.txt | 10 +++++-----
src/CMakeLists.txt | 2 +-
3 files changed, 9 insertions(+), 6 deletions(-)
diff --git a/CMakeLists.txt b/CMakeLists.txt
index b44e7a6..afb3ca5 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -22,6 +22,9 @@ INCLUDE_DIRECTORIES(${CMAKE_CURRENT_BINARY_DIR} ${CMAKE_CURRENT_SOURCE_DIR})
SET(CMAKE_VERBOSE_MAKEFILE "false")
set(CMAKE_MODULE_PATH ${CMAKE_MODULE_PATH} "${CMAKE_SOURCE_DIR}/CMake/")
+if (NOT LIB_INSTALL_DIR)
+ set (LIB_INSTALL_DIR "${CMAKE_INSTALL_PREFIX}/lib")
+endif (NOT LIB_INSTALL_DIR)
SET(EMULATE_IVB false CACHE BOOL "To emulate IVB")
SET(EMULATE_SNB false CACHE BOOL "To emulate SNB")
SET(EMULATE_HSW false CACHE BOOL "To emulate HSW")
diff --git a/backend/src/CMakeLists.txt b/backend/src/CMakeLists.txt
index fa69321..24a5ce6 100644
--- a/backend/src/CMakeLists.txt
+++ b/backend/src/CMakeLists.txt
@@ -184,13 +184,13 @@ link_directories (${LLVM_LIBRARY_DIR})
ADD_EXECUTABLE(gbe_bin_generater gbe_bin_generater.cpp)
TARGET_LINK_LIBRARIES(gbe_bin_generater gbe)
-install (TARGETS gbe LIBRARY DESTINATION lib)
-install (FILES ${pch_object} DESTINATION lib)
-install (FILES ${CMAKE_CURRENT_BINARY_DIR}/${pcm_lib} DESTINATION lib)
+install (TARGETS gbe LIBRARY DESTINATION ${LIB_INSTALL_DIR})
+install (FILES ${pch_object} DESTINATION ${LIB_INSTALL_DIR})
+install (FILES ${CMAKE_CURRENT_BINARY_DIR}/${pcm_lib} DESTINATION ${LIB_INSTALL_DIR})
install (FILES backend/program.h DESTINATION include/gen)
-set (PCH_OBJECT_DIR "${pch_object};${CMAKE_INSTALL_PREFIX}/lib/ocl_stdlib.h.pch")
-set (PCM_LIB_DIR "${CMAKE_CURRENT_BINARY_DIR}/${pcm_lib};${CMAKE_INSTALL_PREFIX}/lib/${pcm_lib}")
+set (PCH_OBJECT_DIR "${pch_object};${LIB_INSTALL_DIR}/ocl_stdlib.h.pch")
+set (PCM_LIB_DIR "${CMAKE_CURRENT_BINARY_DIR}/${pcm_lib};${LIB_INSTALL_DIR}/${pcm_lib}")
configure_file (
"GBEConfig.h.in"
"GBEConfig.h"
diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt
index b997f94..86d4c0a 100644
--- a/src/CMakeLists.txt
+++ b/src/CMakeLists.txt
@@ -79,4 +79,4 @@ target_link_libraries(
${DRM_LIBRARY}
${OPENGL_LIBRARIES}
${OPTIONAL_EGL_LIBRARY})
-install (TARGETS cl LIBRARY DESTINATION lib)
+install (TARGETS cl LIBRARY DESTINATION ${LIB_INSTALL_DIR})
--
1.8.4.2
More information about the Beignet
mailing list