When running targets that depend on a python, such as:
0cmake --build . --target test-security-check
1cmake --build . --target check-symbols
2cmake --build . --target check-security
… it can be tricky to configure cmake to use a python venv. This change checks for the $VIRTUAL_ENV
env var and uses python from there using the following logic:
- First check if $VIRTUAL_ENV is set. If it is, use the python binary from this venv.
- Fall back to system python otherwise.