CMake: Prevent pollution of user system - #252
Closed
jbsolomon wants to merge 2 commits into
Closed
Conversation
Comment on lines
+27
to
+29
| 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() |
Contributor
There was a problem hiding this comment.
Few comments:
- there is
VERSION_GREATER_EQUALcomparison operator - I don't think there is a need to print the message as in practice it will always be printed out
Contributor
|
Can you please also add comments explaining:
|
jbsolomon
force-pushed
the
find-python-venv-first
branch
from
August 23, 2025 13:40
302658c to
d429b5a
Compare
Author
|
I actually didn't realize this was the default behavior when I opened this PR. I think this is not needed |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.

This allows the user to run Diligent python steps in a venv, such as conda.
Tested on Ubuntu 25, CMake version 3.31.6.
This feature is only well-supported in CMake as of version 3.17, so it is gated by a version test.
It might make sense to put this in the root-level CMake, but this is the minimum change to make the Samples repo build cleanly on my system.