From b822d4502fa1d023414b1b5f0313e091dd2f3460 Mon Sep 17 00:00:00 2001 From: xuchen-amd Date: Wed, 25 Sep 2024 22:20:45 -0400 Subject: [PATCH 1/2] Reset CMakeLists.txt to correct revision and include updates from this branch. --- CMakeLists.txt | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) diff --git a/CMakeLists.txt b/CMakeLists.txt index dabe1fe50..a29acfa84 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -418,9 +418,25 @@ set(CPACK_DEB_COMPONENT_INSTALL ON) set(CPACK_DEBIAN_FILE_NAME "DEB-DEFAULT") # Dependencies +# Python Dependencies pointing to requirements.txt file +set(REQUIREMNTS_FILE "${CMAKE_CURRENT_SOURCE_DIR}/requirements.txt") set(PACKAGE_REQUIRES "rocprofiler" CACHE STRING "Package dependencies") + +if(EXISTS ${REQUIREMNTS_FILE}) + file(READ ${REQUIREMNTS_FILE} REQUIREMENTS_CONTENT) + # replace newlines with commas + string(REPLACE "\n" "," REQUIREMENTS_LIST ${REQUIREMENTS_CONTENT}) + # remove trailing commas + STRING(REGEX REPLACE ", $|,$" "" REQUIREMENTS_LIST ${REQUIREMENTS_LIST}) + # append to PACKAGE_REQUIRES + set(PACKAGE_REQUIRES + "${PACKAGE_REQUIRES}, + ${REQUIREMENTS_LIST}" + CACHE STRING "Updated PACKAGE_REQUIRES to include requirements.txt" FORCE) +endif() + set(CPACK_RPM_PACKAGE_REQUIRES ${PACKAGE_REQUIRES}) set(CPACK_DEBIAN_PACKAGE_DEPENDS ${PACKAGE_REQUIRES}) From 5075df78e431ed92bbe85483f7a0e29b37bef429 Mon Sep 17 00:00:00 2001 From: xuchen-amd Date: Wed, 25 Sep 2024 22:44:07 -0400 Subject: [PATCH 2/2] Fix cmake formatting. --- CMakeLists.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index a29acfa84..d394c0e4b 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -427,7 +427,7 @@ set(PACKAGE_REQUIRES if(EXISTS ${REQUIREMNTS_FILE}) file(READ ${REQUIREMNTS_FILE} REQUIREMENTS_CONTENT) # replace newlines with commas - string(REPLACE "\n" "," REQUIREMENTS_LIST ${REQUIREMENTS_CONTENT}) + STRING(REPLACE "\n" "," REQUIREMENTS_LIST ${REQUIREMENTS_CONTENT}) # remove trailing commas STRING(REGEX REPLACE ", $|,$" "" REQUIREMENTS_LIST ${REQUIREMENTS_LIST}) # append to PACKAGE_REQUIRES