Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

built-in gtest cmake find python order of operations suprise #605

Open
cyrush opened this issue Nov 4, 2022 · 1 comment
Open

built-in gtest cmake find python order of operations suprise #605

cyrush opened this issue Nov 4, 2022 · 1 comment
Labels

Comments

@cyrush
Copy link
Member

cyrush commented Nov 4, 2022

In most projects, we use PYTHON_EXECUTABLE to point to python.

In VisIt we use PYTHON_DIR and have logic to derive PYTHON_EXECUTABLE from that.

B/c of this difference - I discovered that gtest will in fact go on to find a python if PYTHON_EXECUTABLE is not set.

gtest's logic lead to VisIt finding the wrong python.

To protect against this, I had to make sure that PYTHON_EXECUTABLE was set before calling BLT.

BLT should defend against this.

@cyrush cyrush added the bug label Nov 4, 2022
@cyrush
Copy link
Member Author

cyrush commented Nov 4, 2022

This is what I am using in VisIt:

################################################################
################################################################
# Google Test will look or python
# If PYTHON_EXECUTABLE is not set, it will go on to find
# the wrong python, so this logic protects us when using
# PYTHON_DIR, as VisIt has for some time
################################################################
################################################################
set(CMAKE_DISABLE_FIND_PACKAGE_PythonInterp ON)

message(STATUS "Setting up BLT")
################################################################
# init blt using BLT_SOURCE_DIR
################################################################
include(${BLT_SOURCE_DIR}/SetupBLT.cmake)

# allow us to find python again
set(CMAKE_DISABLE_FIND_PACKAGE_PythonInterp OFF)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

1 participant