From fdc8a1ea39741dd4d71ddfa0ed1ededc1cd34450 Mon Sep 17 00:00:00 2001 From: Greg Landrum Date: Thu, 14 Mar 2019 16:22:33 +0100 Subject: [PATCH] show an error if attempting to compile with python2 (#2349) --- CMakeLists.txt | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/CMakeLists.txt b/CMakeLists.txt index c72a5414b..b40218502 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -221,6 +221,11 @@ if(RDK_BUILD_PYTHON_WRAPPERS) if (PYTHONINTERP_FOUND AND NOT Python_ADDITIONAL_VERSIONS) set(Python_ADDITIONAL_VERSIONS "${PYTHON_VERSION_MAJOR}.${PYTHON_VERSION_MINOR}") endif (PYTHONINTERP_FOUND AND NOT Python_ADDITIONAL_VERSIONS) + + if(PYTHON_VERSION_MAJOR EQUAL 2) + message(FATAL_ERROR "ERROR: The RDKit no longer supports Python 2.\nIf you have Python 3 installed, you can tell cmake where to find it using the -DPYTHON_EXECUTABLE argument.") + endif() + find_package(PythonLibs) target_include_directories(rdkit_base INTERFACE ${PYTHON_INCLUDE_DIR}) find_package(NumPy REQUIRED)