From a4c7894255cd4105f65bf8c8d3cfaf92b363db30 Mon Sep 17 00:00:00 2001 From: Evgeny Mankov Date: Mon, 28 Oct 2019 23:22:27 +0300 Subject: [PATCH] [HIP][cmake] Simplify `UNIX` related code (the beginning) [REASONS] 1. Make OS-dependent code more clear and readable 2. To ease Windows support [ROCm/clr commit: 4c5c6b49104abc79da014ba0fc7dfb5a08807404] --- projects/clr/hipamd/CMakeLists.txt | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/projects/clr/hipamd/CMakeLists.txt b/projects/clr/hipamd/CMakeLists.txt index 57369a9039..dc73d3c88c 100644 --- a/projects/clr/hipamd/CMakeLists.txt +++ b/projects/clr/hipamd/CMakeLists.txt @@ -163,11 +163,14 @@ if(NOT CMAKE_BUILD_TYPE) endif() # Determine HIP install path -if(CMAKE_INSTALL_PREFIX_INITIALIZED_TO_DEFAULT AND CMAKE_INSTALL_PREFIX MATCHES "/usr/local") +if (UNIX) + set(HIP_DEFAULT_INSTALL_PREFIX "/opt/rocm/hip") +endif() +if(CMAKE_INSTALL_PREFIX_INITIALIZED_TO_DEFAULT) if(CMAKE_BUILD_TYPE MATCHES Debug) set(CMAKE_INSTALL_PREFIX ${CMAKE_CURRENT_SOURCE_DIR} CACHE PATH "Installation path for HIP" FORCE) elseif(CMAKE_BUILD_TYPE MATCHES Release) - set(CMAKE_INSTALL_PREFIX "/opt/rocm/hip" CACHE PATH "Installation path for HIP" FORCE) + set(CMAKE_INSTALL_PREFIX ${HIP_DEFAULT_INSTALL_PREFIX} CACHE PATH "Installation path for HIP" FORCE) else() message(FATAL_ERROR "Invalid CMAKE_BUILD_TYPE specified. Valid values are Debug and Release") endif()