# HG changeset patch # User Jeandet Alexis # Date 2014-06-24 15:03:07 # Node ID e0cdd9b7750183381d2a8cd5aba83035a23b4664 # Parent 2b3d939ebb38b8b8592b9c17c92c4bdddbd8af4c Improved RPM build. diff --git a/.hgignore b/.hgignore --- a/.hgignore +++ b/.hgignore @@ -2,3 +2,4 @@ syntax: glob *.o moc_* *.pro.user +*~ diff --git a/build/rpm/pythonqt.prf b/build/rpm/pythonqt.prf new file mode 100644 --- /dev/null +++ b/build/rpm/pythonqt.prf @@ -0,0 +1,99 @@ +# profile for non-mevis users to link to PythonQt + +#=========================================================================# +# ____ _ _ __ _ # +# | _ \ _ _| |_| |__ ___ _ __ ___ ___ _ __ / _(_) __ _ # +# | |_) | | | | __| '_ \ / _ \| '_ \ / __/ _ \| '_ \| |_| |/ _` | # +# | __/| |_| | |_| | | | (_) | | | | | (_| (_) | | | | _| | (_| | # +# |_| \__, |\__|_| |_|\___/|_| |_| \___\___/|_| |_|_| |_|\__, | # +# |___/ |___/ # +#=========================================================================# +# + +# Change this variable to your python version (2.5, 2.6) +win32:PYTHON_VERSION=27 +unix:PYTHON_VERSION=2.7 +PYTHON_PATH=C:/Python27/ +PYTHON_LIB=C:/Python27/libs/ +macx { + # for macx you need to have the Python development kit installed as framework + INCLUDEPATH += /System/Library/Frameworks/Python.framework/Headers + LIBS += -F/System/Library/Frameworks -framework Python +} else:win32 { + # for windows install a Python development kit or build Python yourself from the sources + # Make sure that you set the environment variable PYTHON_PATH to point to your + # python installation (or the python sources/header files when building from source). + # Make sure that you set the environment variable PYTHON_LIB to point to + # the directory where the python libs are located. + # + # When using the prebuild Python installer, this will be: + # set PYTHON_PATH = c:\Python26 + # set PYTHON_LIB = c:\Python26\libs + # + # When using the python sources, this will be something like: + # set PYTHON_PATH = c:\yourDir\Python-2.6.1\ + # set PYTHON_LIB = c:\yourDir\Python-2.6.1\PCbuild8\Win32 + + + win32:INCLUDEPATH += $$PYTHON_PATH/PC $$PYTHON_PATH/include + win32-msvc*:LIBS += $$PYTHON_LIB/python$${PYTHON_VERSION}$${DEBUG_EXT}.lib + win32-g++:LIBS += $$PYTHON_PATH/libs/libpython$${PYTHON_VERSION}.a + +} else:unix { + # on linux, python-config is used to autodetect Python. + # make sure that you have installed a matching python-dev package. + + unix:LIBS += $$system(python$${PYTHON_VERSION}-config --libs) + unix:QMAKE_CXXFLAGS += $$system(python$${PYTHON_VERSION}-config --includes) +} + +#===========================================================# +# ______ _______ _ _ ___ _ _ ___ _____ # +# | _ \ \ / /_ _| | | |/ _ \| \ | | / _ \_ _| # +# | |_) \ V / | | | |_| | | | | \| | | | | || | # +# | __/ | | | | | _ | |_| | |\ | | |_| || | # +# |_| |_| |_| |_| |_|\___/|_| \_| \__\_\|_| # +# # +#===========================================================# + +contains(CONFIG,BUILDING_PYTHONQT){ + message("BUILDING PYTHONQT") +} +!contains(CONFIG,BUILDING_PYTHONQT){ + INCLUDEPATH += $$[QT_INSTALL_HEADERS]/PythonQt + win32::LIBS += -lPythonQt + unix::LIBS += -lPythonQt +} + +#===============================================================================# +# ______ _______ _ _ ___ _ _ ___ _____ _ _ _ # +# | _ \ \ / /_ _| | | |/ _ \| \ | | / _ \_ _| / \ | | | | # +# | |_) \ V / | | | |_| | | | | \| | | | | || | / _ \ | | | | # +# | __/ | | | | | _ | |_| | |\ | | |_| || | / ___ \| |___| |___ # +# |_| |_| |_| |_| |_|\___/|_| \_| \__\_\|_| /_/ \_\_____|_____| # +# # +#===============================================================================# + +contains(CONFIG,BUILDING_QTALL){ + message("BUILDING_QTALL") + win32::LIBS += -L$${DESTDIR} + unix::LIBS += -L$${DESTDIR} +} +!contains(CONFIG,BUILDING_QTALL){ + !contains(CONFIG,BUILDING_PYTHONQT){ + win32::LIBS += -lPythonQt_QtAll + unix::LIBS += -lPythonQt_QtAll + } + +} + + + +contains(CONFIG,BUILDING_EXAMPLES){ + message("BUILDING_EXAMPLES") + LIBS += -L$${DESTDIR} + LIBS += -lPythonQt_QtAll + LIBS += -lPythonQt + INCLUDEPATH += $${PWD}/../src \ + $${PWD}/../extensions/PythonQt_QtAll +} diff --git a/src/src.pro b/src/src.pro --- a/src/src.pro +++ b/src/src.pro @@ -37,7 +37,11 @@ include ( src.pri ) #Install PythonQt as Qt feature pythoncfg.path = $$[QT_INSTALL_PREFIX]/mkspecs/features -pythoncfg.files = ../build/pythonqt.prf + +pythoncfg.files = ../build/rpm/pythonqt.prf +isEmpty(RPMBUILDING){ + pythoncfg.files = ../build/pythonqt.prf +} target.path = $$[QT_INSTALL_LIBS] isEmpty(target.path) {