aboutsummaryrefslogtreecommitdiff
blob: 324b8f68293c53b00a42274dc3dc3203bbd5384e (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
From 52019a3f395e5fa97b26d424152d91f73b400f8e Mon Sep 17 00:00:00 2001
From: Alexey Chernov <4ernov@gmail.com>
Date: Wed, 13 Nov 2019 23:44:12 +0300
Subject: [PATCH 5/5] Change library directory according to CMake build

Change `lib_path` in favour of out-of-tree CMake build
directory, so that all the C++ libraries be found.
---
 setup.py | 5 +++--
 1 file changed, 3 insertions(+), 2 deletions(-)

diff --git a/setup.py b/setup.py
index 60502b6add..cbced52192 100644
--- a/setup.py
+++ b/setup.py
@@ -234,9 +234,10 @@ else:
 
 # Constant known variables used throughout this file
 cwd = os.path.dirname(os.path.abspath(__file__))
-lib_path = os.path.join(cwd, "torch", "lib")
+cmake_build_dir = os.environ.get("CMAKE_BUILD_DIR", os.path.join(cwd, "build"))
+lib_path = os.path.join(cmake_build_dir, "lib")
 third_party_path = os.path.join(cwd, "third_party")
-caffe2_build_dir = os.environ.get("CMAKE_BUILD_DIR", os.path.join(cwd, "build"))
+caffe2_build_dir = cmake_build_dir
 # lib/pythonx.x/site-packages
 rel_site_packages = distutils.sysconfig.get_python_lib(prefix='')
 # full absolute path to the dir above
-- 
2.23.0