Skip to content

Conversation

@anpol
Copy link
Contributor

@anpol anpol commented Jul 12, 2022

CMake policy CMP0094 controls a lookup strategy used to find a Python executable:

  • CMP0094=OLD selects a Python executable with a higher version.
  • CMP0094=NEW selects a Python executable found earlier in PATH.

NEW behavior is critical in presence of a Python virtual environment established and activated, i.e. added to the PATH variable.

In case GoogleTest is embedded into a larger project, the result of find_package(Python) affects the whole build, not only GoogleTest component itself.

CMake policy CMP0094 controls a lookup strategy used to find a Python
executable:

* CMP0094=OLD selects a Python executable with a higher version.
* CMP0094=NEW selects a Python executable found earlier in PATH.

NEW behavior is critical in presence of a Python virtual environment
established and activated, i.e. added to the PATH variable.

In case GoogleTest is embedded into a larger project, the result of
`find_package(Python)` affects the whole build, not only GoogleTest
component itself.
@copybara-service copybara-service bot merged commit 71feea6 into google:main Jul 18, 2022
@anpol anpol deleted the python-find-strategy branch July 19, 2022 09:10
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant