summaryrefslogtreecommitdiff
path: root/torch/CMakeLists.txt
diff options
context:
space:
mode:
authorOwen Anderson <owen.anderson@oculus.com>2019-01-30 17:04:02 -0800
committerFacebook Github Bot <facebook-github-bot@users.noreply.github.com>2019-01-30 17:13:43 -0800
commitfc2d8c6889d93a796eefcb4082d1f6c1d590cc9d (patch)
tree2c44d7f9f6052b72cb68e449bb2af9ff867f2455 /torch/CMakeLists.txt
parent16e2e4f29f8c9bd076011992755c3d2962fc5eb5 (diff)
downloadpytorch-fc2d8c6889d93a796eefcb4082d1f6c1d590cc9d.tar.gz
pytorch-fc2d8c6889d93a796eefcb4082d1f6c1d590cc9d.tar.bz2
pytorch-fc2d8c6889d93a796eefcb4082d1f6c1d590cc9d.zip
Eliminate PYCMD in favor of PYTHON_EXECUTABLE in CMake.
Summary: Pull Request resolved: https://github.com/pytorch/pytorch/pull/16522 Differential Revision: D13867376 Pulled By: resistor fbshipit-source-id: 6bce68facea83c5161a31fcdfafe08827999eb2b
Diffstat (limited to 'torch/CMakeLists.txt')
-rw-r--r--torch/CMakeLists.txt12
1 files changed, 2 insertions, 10 deletions
diff --git a/torch/CMakeLists.txt b/torch/CMakeLists.txt
index 7d85d4317a..0f7fd8639d 100644
--- a/torch/CMakeLists.txt
+++ b/torch/CMakeLists.txt
@@ -29,14 +29,6 @@ endif()
set(CMAKE_POSITION_INDEPENDENT_CODE TRUE)
-# Get the correct Python executable
-if (DEFINED ENV{PYTORCH_PYTHON})
- message(STATUS "Using python found in $ENV{PYTORCH_PYTHON}")
- set(PYCMD "$ENV{PYTORCH_PYTHON}")
-else()
- SET(PYCMD "python")
-endif()
-
# Generate files
set(TOOLS_PATH "${TORCH_ROOT}/tools")
@@ -74,7 +66,7 @@ add_custom_command(
"${TORCH_SRC_DIR}/csrc/jit/generated/register_aten_ops_1.cpp"
"${TORCH_SRC_DIR}/csrc/jit/generated/register_aten_ops_2.cpp"
COMMAND
- ${PYCMD} tools/setup_helpers/generate_code.py
+ "${PYTHON_EXECUTABLE}" tools/setup_helpers/generate_code.py
--declarations-path "${CMAKE_BINARY_DIR}/aten/src/ATen/Declarations.yaml"
--nn-path "aten/src/"
DEPENDS
@@ -702,7 +694,7 @@ if (BUILD_PYTHON)
OUTPUT
"${TORCH_SRC_DIR}/__init__.pyi"
COMMAND
- ${PYCMD} -mtools.pyi.gen_pyi
+ "${PYTHON_EXECUTABLE}" -mtools.pyi.gen_pyi
--declarations-path "${CMAKE_BINARY_DIR}/aten/src/ATen/Declarations.yaml"
DEPENDS
"${CMAKE_BINARY_DIR}/aten/src/ATen/Declarations.yaml"