From 3ab2e34e7af2426cc778487d4371c983c6aa0faf Mon Sep 17 00:00:00 2001 From: Bodie Solomon Date: Thu, 14 Aug 2025 11:58:51 -0400 Subject: [PATCH 1/2] CMake: find_package(Python3) from virtual env first --- RenderStateNotation/CMakeLists.txt | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/RenderStateNotation/CMakeLists.txt b/RenderStateNotation/CMakeLists.txt index 28dfd356..3b54b60d 100644 --- a/RenderStateNotation/CMakeLists.txt +++ b/RenderStateNotation/CMakeLists.txt @@ -24,6 +24,12 @@ file(MAKE_DIRECTORY "${RSN_PARSER_GENERATED_HEADERS_DIR}") # is not accidentally used. file(COPY ../.clang-format DESTINATION "${RSN_PARSER_GENERATED_HEADERS_DIR}") +if (${CMAKE_VERSION} VERSION_EQUAL "3.17.0" OR + ${CMAKE_VERSION} VERSION_GREATER "3.17.0") + message(STATUS "Trying to use Python3 from virtual env") + set(Python_FIND_VIRTUALENV FIRST) +endif() + find_package(Python3 REQUIRED) set(LIBCLANG_INSTALL_CMD ${Python3_EXECUTABLE} -m pip install libclang==16.0.6) From d429b5a5e909a1d03a6963a9d0bd824b8114ebe3 Mon Sep 17 00:00:00 2001 From: Bodie Solomon Date: Sat, 16 Aug 2025 11:30:43 -0400 Subject: [PATCH 2/2] Simplify CMake venv python conditional and logging --- RenderStateNotation/CMakeLists.txt | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/RenderStateNotation/CMakeLists.txt b/RenderStateNotation/CMakeLists.txt index 3b54b60d..45b10e72 100644 --- a/RenderStateNotation/CMakeLists.txt +++ b/RenderStateNotation/CMakeLists.txt @@ -24,9 +24,7 @@ file(MAKE_DIRECTORY "${RSN_PARSER_GENERATED_HEADERS_DIR}") # is not accidentally used. file(COPY ../.clang-format DESTINATION "${RSN_PARSER_GENERATED_HEADERS_DIR}") -if (${CMAKE_VERSION} VERSION_EQUAL "3.17.0" OR - ${CMAKE_VERSION} VERSION_GREATER "3.17.0") - message(STATUS "Trying to use Python3 from virtual env") +if (${CMAKE_VERSION} VERSION_GREATER_EQUAL "3.17.0") set(Python_FIND_VIRTUALENV FIRST) endif()