From aba37e002a86438303979e541d26278dc57e4fb6 Mon Sep 17 00:00:00 2001 From: Walter Van Herck <w.van.herck@fz-juelich.de> Date: Tue, 11 Jun 2013 09:06:25 +0200 Subject: [PATCH] Python lib build for windows --- BornAgain.pro | 2 +- Core/Core.pro | 2 +- shared.pri | 22 ++++++++++++++++------ 3 files changed, 18 insertions(+), 8 deletions(-) diff --git a/BornAgain.pro b/BornAgain.pro index 8ce8d27797d..01f7f7dd548 100644 --- a/BornAgain.pro +++ b/BornAgain.pro @@ -8,7 +8,7 @@ macx|unix { ROOT = $$system(root-config --prefix) } win32 { - ROOT = "C:/root" +# ROOT = "C:/root" } isEmpty(ROOT) { message("No ROOT installation found. libBornAgainFit and App" will not be compiled.) diff --git a/Core/Core.pro b/Core/Core.pro index 6b89a29ea71..b38142af31e 100644 --- a/Core/Core.pro +++ b/Core/Core.pro @@ -6,7 +6,7 @@ TEMPLATE = lib CONFIG += lib # to remove versions from file name QT -= core gui #QMAKE_EXTENSION_SHLIB = so # making standard *.so extension -#CONFIG += BORNAGAIN_PYTHON +CONFIG += BORNAGAIN_PYTHON # ----------------------------------------------------------------------------- # common project settings diff --git a/shared.pri b/shared.pri index 8932c475d28..ffc7d0bdb50 100644 --- a/shared.pri +++ b/shared.pri @@ -240,16 +240,26 @@ CONFIG(BORNAGAIN_ROOT) { #CONFIG += BORNAGAIN_PYTHON CONFIG(BORNAGAIN_PYTHON) { # user wants to compile python module - WhichPython=$$system(which python) + macx|unix { + WhichPython=$$system(which python) + } + win32 { + WhichPython="C:/Python27" + } isEmpty(WhichPython) { # we do not have python error("Can not find any sign of python") } else { # we have python - pythonvers=$$system("python -c 'import sys; sys.stdout.write(sys.version[:3])'") - pythonsysincdir=$$system("python -c 'import sys; sys.stdout.write(sys.prefix + \"/include/python\" + sys.version[:3])'") - #pythonsyslibdir=$$system("python -c 'import sys; sys.stdout.write(sys.prefix + \"/lib/python\" + sys.version[:3])'") - pythonsyslibdir=$$system("python -c 'import sys; sys.stdout.write(sys.prefix + \"/lib\" )'") + pythonvers=$$system("python -c \"import sys; sys.stdout.write(sys.version[:3])\" ") + macx|unix { + pythonsysincdir=$$system("python -c 'import sys; sys.stdout.write(sys.prefix + \"/include/python\" + sys.version[:3])'") + pythonsyslibdir=$$system("python -c 'import sys; sys.stdout.write(sys.prefix + \"/lib\" )'") + } + win32 { + pythonsysincdir=$${WhichPython}/include + pythonsyslibdir=$${WhichPython}/libs + } #message(we have python) #message($$pythonvers) #message($$pythonsysincdir) @@ -260,7 +270,7 @@ CONFIG(BORNAGAIN_PYTHON) { LIBS += -lboost_python -L$$pythonsyslibdir -lpython$$pythonvers # we need to know the location of numpy - pythonnumpy=$$system("python -c 'import sys; import numpy; sys.stdout.write(numpy.get_include())'") + pythonnumpy=$$system("python -c \"import sys; import numpy; sys.stdout.write(numpy.get_include())\" ") !exists($$pythonnumpy/numpy/arrayobject.h): error("Can't find numpy/arrayobject.h in $$pythonnumpy, you have to install python-numpy-devel") INCLUDEPATH += $$pythonnumpy } -- GitLab