From f806f88e5070629a16de4577e8e599c6451e0291 Mon Sep 17 00:00:00 2001 From: Hamid El Maazouz Date: Fri, 30 May 2025 02:05:40 +0100 Subject: [PATCH 1/2] [CMake] Ignore CMake user preset file --- .gitignore | 3 +++ 1 file changed, 3 insertions(+) diff --git a/.gitignore b/.gitignore index 1625cb5fd695..ba6bc318dbbb 100644 --- a/.gitignore +++ b/.gitignore @@ -20,3 +20,6 @@ lit.site.cfg.py # External software /ext + +# CMake preset file +CMakeUserPresets.json \ No newline at end of file From db85620305faefc5d845c370f2e5511b3de56753 Mon Sep 17 00:00:00 2001 From: Hamid El Maazouz Date: Fri, 30 May 2025 02:05:54 +0100 Subject: [PATCH 2/2] [CMake] Add hint to check the virtual environment first for Python --- CMakeLists.txt | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index 1953c7bd07a1..f738779772eb 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -504,9 +504,12 @@ else() # Lookup python either way as some integration tests use python without the # bindings find_package(Python3) - if(Python3_FOUND) - message(STATUS "Found python at ${Python3_EXECUTABLE}") - endif() +endif() + +set(Python3_FIND_VIRTUALENV FIRST) + +if(Python3_FOUND) + message(STATUS "Found python at ${Python3_EXECUTABLE}") endif() #-------------------------------------------------------------------------------