From bb40910abe6c311db225f8c818ab3bba47ff74a2 Mon Sep 17 00:00:00 2001 From: Ammar ELWazir Date: Mon, 10 Jun 2024 14:59:38 -0500 Subject: [PATCH] Fixing the force of using cmake python3 interpreter Change-Id: I5d87dfa78052611856652fc887cdfa6764c51028 [ROCm/rocprofiler commit: a50d5ce4ae244ac17fba75dba5a94c15ee38378f] --- projects/rocprofiler/src/api/CMakeLists.txt | 10 ++++++---- .../tests-v2/featuretests/profiler/CMakeLists.txt | 10 ++++++---- .../tests-v2/featuretests/tracer/CMakeLists.txt | 10 ++++++---- 3 files changed, 18 insertions(+), 12 deletions(-) diff --git a/projects/rocprofiler/src/api/CMakeLists.txt b/projects/rocprofiler/src/api/CMakeLists.txt index 04f4708b2f..61782f088d 100644 --- a/projects/rocprofiler/src/api/CMakeLists.txt +++ b/projects/rocprofiler/src/api/CMakeLists.txt @@ -1,10 +1,12 @@ # ############################################################################################################################################ # ROCProfiler General Requirements # ############################################################################################################################################ -find_package( - Python3 - COMPONENTS Interpreter - REQUIRED) +if(NOT Python3_EXECUTABLE) + find_package( + Python3 + COMPONENTS Interpreter + REQUIRED) +endif() execute_process( COMMAND ${Python3_EXECUTABLE} -c "import lxml" diff --git a/projects/rocprofiler/tests-v2/featuretests/profiler/CMakeLists.txt b/projects/rocprofiler/tests-v2/featuretests/profiler/CMakeLists.txt index 168fc9e3e1..0a5eb88339 100644 --- a/projects/rocprofiler/tests-v2/featuretests/profiler/CMakeLists.txt +++ b/projects/rocprofiler/tests-v2/featuretests/profiler/CMakeLists.txt @@ -421,10 +421,12 @@ install( ${CMAKE_INSTALL_DATAROOTDIR}/${PROJECT_NAME}/tests/featuretests/profiler/apps/goldentraces COMPONENT tests) -find_package( - Python3 - COMPONENTS Interpreter - REQUIRED) +if(NOT Python3_EXECUTABLE) + find_package( + Python3 + COMPONENTS Interpreter + REQUIRED) +endif() execute_process( COMMAND ${Python3_EXECUTABLE} -c "import pandas" diff --git a/projects/rocprofiler/tests-v2/featuretests/tracer/CMakeLists.txt b/projects/rocprofiler/tests-v2/featuretests/tracer/CMakeLists.txt index af7d9602e6..53c46cfecf 100644 --- a/projects/rocprofiler/tests-v2/featuretests/tracer/CMakeLists.txt +++ b/projects/rocprofiler/tests-v2/featuretests/tracer/CMakeLists.txt @@ -130,10 +130,12 @@ install( ${CMAKE_INSTALL_DATAROOTDIR}/${PROJECT_NAME}/tests/featuretests/tracer/apps/goldentraces COMPONENT tests) -find_package( - Python3 - COMPONENTS Interpreter - REQUIRED) +if(NOT Python3_EXECUTABLE) + find_package( + Python3 + COMPONENTS Interpreter + REQUIRED) +endif() # cmake based tests include(${CMAKE_CURRENT_LIST_DIR}/hiptrace_validation_tests.cmake)