From 65f8c5ca31a8dc217133f559281ced876d580113 Mon Sep 17 00:00:00 2001 From: Erik Smistad Date: Fri, 5 May 2017 22:36:24 +0200 Subject: [PATCH] Fix error of version_info.cc not being generated on windows if building python bindings is disabled in CMake (#9660) --- tensorflow/contrib/cmake/CMakeLists.txt | 6 ++++++ tensorflow/contrib/cmake/tf_python.cmake | 1 - 2 files changed, 6 insertions(+), 1 deletion(-) diff --git a/tensorflow/contrib/cmake/CMakeLists.txt b/tensorflow/contrib/cmake/CMakeLists.txt index af7b4fb3868..83b405fd4e2 100644 --- a/tensorflow/contrib/cmake/CMakeLists.txt +++ b/tensorflow/contrib/cmake/CMakeLists.txt @@ -229,6 +229,12 @@ if (tensorflow_ENABLE_GPU) endif() endif() +# Find python executable +include(FindPythonInterp) +if(NOT ${PYTHONINTERP_FOUND}) + message(FATAL_ERROR "CMake was unable to find a python interpreter.") +endif() + # Let's get to work! include(tf_core_framework.cmake) # NOTE: Disabled until issue #3996 is fixed. diff --git a/tensorflow/contrib/cmake/tf_python.cmake b/tensorflow/contrib/cmake/tf_python.cmake index 9e2eb71b4c2..bfd6a18c788 100755 --- a/tensorflow/contrib/cmake/tf_python.cmake +++ b/tensorflow/contrib/cmake/tf_python.cmake @@ -27,7 +27,6 @@ # 1. Resolve the installed version of Python (for Python.h and python). # TODO(mrry): Parameterize the build script to enable Python 3 building. -include(FindPythonInterp) if(NOT PYTHON_INCLUDE_DIR) set(PYTHON_NOT_FOUND false) exec_program("${PYTHON_EXECUTABLE}"