From 35eeb07f08449a28b5c6f4f14a1f20e8871f528f Mon Sep 17 00:00:00 2001 From: Eric Coissac Date: Mon, 1 Apr 2019 08:52:38 +0200 Subject: [PATCH] Build the C src in build/cobject --- setup.py | 24 +++++++++++++++++++----- 1 file changed, 19 insertions(+), 5 deletions(-) diff --git a/setup.py b/setup.py index eb5159d..cb473b4 100755 --- a/setup.py +++ b/setup.py @@ -27,6 +27,23 @@ def findPackage(root,base=None): modules.extend(findPackage(os.path.join(root,module),base+[module])) return modules +def RunMake(): + try: + os.mkdir("build") + except OSError: + pass + try: + os.mkdir("build/cobject") + except OSError: + pass + + oldwd = os.getcwd() + os.chdir("build/cobject") + install_clibdir_option="-DPYTHONLIB:STRING='%s'" % get_python_lib() + subprocess.call(['cmake', install_clibdir_option, '../../src']) + subprocess.call(['make','install']) # temporary fix but should be in src + os.chdir(oldwd) + PACKAGE = "OBITools3" VERSION = "0.0.0" @@ -48,7 +65,8 @@ REQUIRES = ['Cython>=0.24', os.environ['CFLAGS'] = '-O3 -Wall -I "src" -I "src/libecoPCR" -I "src/libjson"' -#sys.path.append("/Users/coissac/git/obitools3/python") + +RunMake() cython_src = [x for x in glob.iglob('python/obitools3/**/*.pyx', recursive=True @@ -58,10 +76,6 @@ cython_src = [x for x in glob.iglob('python/obitools3/**/*.pyx', #with open(os.path.join(os.path.dirname(__file__), 'README.rst')) as f: # readme = f.read() -install_clibdir_option="-DPYTHONLIB:STRING='%s'" % get_python_lib() - -subprocess.call(['cmake', install_clibdir_option, 'src']) -subprocess.call(['make','install']) # temporary fix but should be in src cython_ext = [Extension('.'.join([os.path.dirname(x).replace("python/",""), os.path.splitext(os.path.basename(x))[0]]).replace('/','.'),