From 264b0ea526eff51ca76eed33e3a06f0ca6b3e4f7 Mon Sep 17 00:00:00 2001 From: Amber Lin Date: Wed, 6 May 2020 12:41:16 -0400 Subject: [PATCH] Allow specifying rsmi-lib install path Instead of hard-coding install path to /opt/rocm, allow users to specify where "make install" goes to so users can install lib to their local build path for testing purpose without touching global /opt/rocm files. Signed-off-by: Amber Lin Change-Id: I4144988e325edae4d1d1a2824e031996091036d3 [ROCm/amdsmi commit: 741f9c31ff664e73065bd4c53ddf431067827c59] --- projects/amdsmi/CMakeLists.txt | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/projects/amdsmi/CMakeLists.txt b/projects/amdsmi/CMakeLists.txt index 961515fa18..e8f74cc4f1 100755 --- a/projects/amdsmi/CMakeLists.txt +++ b/projects/amdsmi/CMakeLists.txt @@ -56,8 +56,10 @@ message("SOVERSION: ${SO_VERSION_STRING}") ## rocm_smi_lib-dev set(SOURCE_DIR ${CMAKE_CURRENT_SOURCE_DIR} CACHE STRING "Location of rocm_smi source code.") -set(CMAKE_INSTALL_PREFIX "/opt/rocm" - CACHE STRING "Default installation directory.") +if(NOT DEFINED CMAKE_INSTALL_PREFIX) + set(CMAKE_INSTALL_PREFIX "/opt/rocm" + CACHE STRING "Default installation directory.") +endif () set(CPACK_PACKAGING_INSTALL_PREFIX "/opt/rocm" CACHE STRING "Default packaging prefix.") set(CPACK_GENERATOR "DEB;RPM" CACHE STRING "Default packaging generators.")