@@ -8,41 +8,43 @@ isEmpty( PYTHON_VERSION ) {
88 unix:PYTHON_VERSION=2.7
99}
1010
11-
12- macx {
13- # for macx you need to have the Python development kit installed as framework
14- INCLUDEPATH += /System/Library/Frameworks/Python.framework/Headers
15- LIBS += -F/System/Library/Frameworks -framework Python
16- } else:win32 {
17- # for windows install a Python development kit or build Python yourself from the sources
18- # Make sure that you set the environment variable PYTHON_PATH to point to your
19- # python installation (or the python sources/header files when building from source).
20- # Make sure that you set the environment variable PYTHON_LIB to point to
21- # the directory where the python libs are located.
22- #
23- # When using the prebuild Python installer, this will be:
24- # set PYTHON_PATH = c:\Python26
25- # set PYTHON_LIB = c:\Python26\libs
26- #
27- # When using the python sources, this will be something like:
28- # set PYTHON_PATH = c:\yourDir\Python-2.6.1\
29- # set PYTHON_LIB = c:\yourDir\Python-2.6.1\PCbuild8\Win32
30-
31- # check if debug or release
32- CONFIG(debug, debug|release) {
33- DEBUG_EXT = _d
34- } else {
35- DEBUG_EXT =
36- }
37-
38- win32:INCLUDEPATH += $$(PYTHON_PATH)/PC $$(PYTHON_PATH)/include
39- win32:LIBS += $$(PYTHON_LIB)/python$${PYTHON_VERSION}$${DEBUG_EXT}.lib
40- } else:unix {
41- # on linux, python-config is used to autodetect Python.
42- # make sure that you have installed a matching python-dev package.
11+ message(Using Python version $${PYTHON_VERSION})
12+
13+ macx {
14+ # for macx you need to have the Python development kit installed as framework
15+ INCLUDEPATH += /System/Library/Frameworks/Python.framework/Headers
16+ LIBS += -F/System/Library/Frameworks -framework Python
17+ } else:win32 {
18+ # for windows install a Python development kit or build Python yourself from the sources
19+ # Make sure that you set the environment variable PYTHON_PATH to point to your
20+ # python installation (or the python sources/header files when building from source).
21+ # Make sure that you set the environment variable PYTHON_LIB to point to
22+ # the directory where the python libs are located.
23+ #
24+ # When using the prebuild Python installer, this will be:
25+ # set PYTHON_PATH = c:\Python26
26+ # set PYTHON_LIB = c:\Python26\libs
27+ #
28+ # When using the python sources, this will be something like:
29+ # set PYTHON_PATH = c:\yourDir\Python-2.6.1\
30+ # set PYTHON_LIB = c:\yourDir\Python-2.6.1\PCbuild8\Win32
31+
32+ # check if debug or release
33+ CONFIG(debug, debug|release) {
34+ DEBUG_EXT = _d
35+ } else {
36+ DEBUG_EXT =
37+ }
38+
39+ win32:INCLUDEPATH += $$(PYTHON_PATH)/PC $$(PYTHON_PATH)/include
40+ win32:LIBS += $$(PYTHON_LIB)/python$${PYTHON_VERSION}$${DEBUG_EXT}.lib
41+ } else:unix {
42+ # on linux, python-config is used to autodetect Python.
43+ # make sure that you have installed a matching python-dev package.
4344
4445 system(python$${PYTHON_VERSION}-config --embed --libs) {
4546 unix:LIBS += $$system(python$${PYTHON_VERSION}-config --embed --libs)
4647 } else: unix:LIBS += $$system(python$${PYTHON_VERSION}-config --libs)
47- unix:QMAKE_CXXFLAGS += $$system(python$${PYTHON_VERSION}-config --includes)
48- }
48+ unix:QMAKE_CXXFLAGS += $$system(python$${PYTHON_VERSION}-config --includes)
49+ unix:QMAKE_LFLAGS += $$system(python$${PYTHON_VERSION}-config --ldflags)
50+ }
0 commit comments