Skip to content

Commit

Permalink
Switch all references to Py2 to 3, fixing OpenChemistry#431
Browse files Browse the repository at this point in the history
Thanks to Drew Parsons for the bug report

Signed-off-by: Geoff Hutchison <geoff.hutchison@gmail.com>
  • Loading branch information
ghutchis committed Apr 27, 2020
1 parent 8da8dbe commit 6fa318b
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 12 deletions.
9 changes: 3 additions & 6 deletions avogadro/qtgui/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -17,15 +17,12 @@ if(USE_SPGLIB)
add_definitions(-DUSE_SPGLIB)
endif()

# Find python2 for input generator scripts:
find_package(PythonInterp 2)
if(PYTHON_EXECUTABLE)
set(PYTHON2_EXECUTABLE "${PYTHON_EXECUTABLE}")
endif()
# Find python for input generator scripts:
find_package(PythonInterp 3)

file(WRITE "${CMAKE_CURRENT_BINARY_DIR}/avogadropython.h.in"
"namespace Avogadro {
static const char *pythonInterpreterPath = \"${PYTHON2_EXECUTABLE}\";
static const char *pythonInterpreterPath = \"${PYTHON_EXECUTABLE}\";
}
")
configure_file("${CMAKE_CURRENT_BINARY_DIR}/avogadropython.h.in"
Expand Down
9 changes: 3 additions & 6 deletions tests/qtgui/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -9,11 +9,8 @@ find_package(Qt5 COMPONENTS Widgets Network Test REQUIRED)
find_package(MoleQueue REQUIRED NO_MODULE)
include_directories(${MoleQueue_INCLUDE_DIRS})

# Find python 2.x interpreter for input generator
find_package(PythonInterp 2)
if(PYTHON_EXECUTABLE)
set(PYTHON2_EXECUTABLE "${PYTHON_EXECUTABLE}")
endif()
# Find python interpreter for input generator
find_package(PythonInterp 3)

# Setup config file with data location
if(AVOGADRO_DATA_ROOT)
Expand All @@ -31,7 +28,7 @@ set(tests
RWMolecule
)

if(PYTHON2_EXECUTABLE AND AVOGADRO_DATA)
if(PYTHON_EXECUTABLE AND AVOGADRO_DATA)
list(APPEND tests
FileBrowseWidget
# FIXME: These two tests are broken
Expand Down

0 comments on commit 6fa318b

Please sign in to comment.