2
0

[HIP][cmake] Simplify UNIX related code (the beginning)

[REASONS]
1. Make OS-dependent code more clear and readable
2. To ease Windows support
Este cometimento está contido em:
Evgeny Mankov
2019-10-28 23:22:27 +03:00
ascendente 954d1847b2
cometimento d58b70d8a0
+5 -2
Ver ficheiro
@@ -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()