From de025ca5f6482daa1405b542ec04b5406686fdbc Mon Sep 17 00:00:00 2001 From: Icarus Sparry Date: Mon, 5 Jul 2021 22:43:40 +0000 Subject: [PATCH] Add dependency on rocm-core Signed-off-by: Icarus Sparry Change-Id: Ie2a5b08747129a1313edf2a834f2e0e8638372c2 (cherry picked from commit 3d7465338318e3bc4208cbf9046c317a02a8f239) --- CMakeLists.txt | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index d1020668a3..c342b8cf5a 100755 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -164,7 +164,7 @@ else() endif() set (CPACK_DEBIAN_PACKAGE_PROVIDES "rocm-smi") set (CPACK_DEBIAN_PACKAGE_SUGGESTS "sudo") -set (CPACK_DEBIAN_PACKAGE_DEPENDS "python3") +set (CPACK_DEBIAN_PACKAGE_DEPENDS "python3, rocm-core") ## Process the Debian install/remove scripts to update the CPACK variables configure_file ( ${CMAKE_CURRENT_SOURCE_DIR}/DEBIAN/postinst.in DEBIAN/postinst @ONLY ) @@ -183,7 +183,7 @@ if(CPACK_RPM_PACKAGE_RELEASE) set(CPACK_RPM_PACKAGE_RELEASE_DIST ON) endif() set (CPACK_RPM_PACKAGE_PROVIDES "rocm-smi") -set (CPACK_RPM_PACKAGE_REQUIRES "python3") +set (CPACK_RPM_PACKAGE_REQUIRES "python3, rocm-core") # The line below doesn't currently work; it may be this issue: @@ -202,6 +202,10 @@ set ( CPACK_RPM_POST_UNINSTALL_SCRIPT_FILE "${CMAKE_CURRENT_BINARY_DIR}/RPM/post #Set the names now using CPACK utility set(CPACK_DEBIAN_FILE_NAME "DEB-DEFAULT") set(CPACK_RPM_FILE_NAME "RPM-DEFAULT") - +# Remove dependency on rocm-core if -DROCM_DEP_ROCMCORE=ON not given to cmake +if(NOT ROCM_DEP_ROCMCORE) + string(REGEX REPLACE ",? ?rocm-core" "" CPACK_RPM_PACKAGE_REQUIRES ${CPACK_RPM_PACKAGE_REQUIRES}) + string(REGEX REPLACE ",? ?rocm-core" "" CPACK_DEBIAN_PACKAGE_DEPENDS ${CPACK_DEBIAN_PACKAGE_DEPENDS}) +endif() include (CPack)