From 6b0bf158be8d16bca097fb65474d3169a861b498 Mon Sep 17 00:00:00 2001 From: Jeremy Newton Date: Thu, 1 Jun 2023 17:46:48 -0400 Subject: [PATCH] Install .hipVersion into datadir for linux Starting with LLVM 16, we can put .hipVersion in datadir for better Linux FHS compliance: https://github.com/llvm/llvm-project/commit/082593ff7aff68060bd66dccfa43493d07d9c255 For Windows, we can keep it status quo. Change-Id: Id15ed0dac346fabec21ee060e7576ce085b1af70 --- hipamd/CMakeLists.txt | 6 +++++- hipamd/packaging/CMakeLists.txt | 6 +++++- 2 files changed, 10 insertions(+), 2 deletions(-) diff --git a/hipamd/CMakeLists.txt b/hipamd/CMakeLists.txt index c14a9ad32..6b5d8d3c5 100755 --- a/hipamd/CMakeLists.txt +++ b/hipamd/CMakeLists.txt @@ -329,7 +329,11 @@ endif() install(FILES ${PROJECT_BINARY_DIR}/.hipInfo DESTINATION ${CMAKE_INSTALL_LIBDIR}) # Install .hipVersion -install(FILES ${PROJECT_BINARY_DIR}/.hipVersion DESTINATION ${CMAKE_INSTALL_BINDIR}) +if(WIN32) + install(FILES ${PROJECT_BINARY_DIR}/.hipVersion DESTINATION ${CMAKE_INSTALL_BINDIR}) +else() + install(FILES ${PROJECT_BINARY_DIR}/.hipVersion DESTINATION ${CMAKE_INSTALL_DATADIR}/hip RENAME version) +endif() # Install src, bin, include & cmake if necessary execute_process(COMMAND test ${CMAKE_INSTALL_PREFIX} -ef ${CMAKE_CURRENT_SOURCE_DIR} diff --git a/hipamd/packaging/CMakeLists.txt b/hipamd/packaging/CMakeLists.txt index b19d59490..3eac9cf14 100644 --- a/hipamd/packaging/CMakeLists.txt +++ b/hipamd/packaging/CMakeLists.txt @@ -97,7 +97,11 @@ install(FILES ${CMAKE_BINARY_DIR}/hipamd/include/hip/amd_detail/hip_prof_str.h DESTINATION ${CMAKE_INSTALL_INCLUDEDIR}/hip/amd_detail COMPONENT dev) install(FILES ${CMAKE_BINARY_DIR}/hipamd/include/hip/hip_version.h DESTINATION ${CMAKE_INSTALL_INCLUDEDIR}/hip COMPONENT dev) -install(FILES ${CMAKE_BINARY_DIR}/hipamd/.hipVersion DESTINATION ${CMAKE_INSTALL_BINDIR} COMPONENT dev) +if(WIN32) + install(FILES ${CMAKE_BINARY_DIR}/hipamd/.hipVersion DESTINATION ${CMAKE_INSTALL_BINDIR} COMPONENT dev) +else() + install(FILES ${CMAKE_BINARY_DIR}/hipamd/.hipVersion DESTINATION ${CMAKE_INSTALL_DATADIR}/hip RENAME version COMPONENT dev) +endif() install(DIRECTORY ${HIP_COMMON_DIR}/cmake/ DESTINATION ${CMAKE_INSTALL_LIBDIR}/cmake/hip COMPONENT dev) #End dev files install -- 2.40.1