Search code examples
qt-creatorqmakeboost-python

Qtcreator specify lib name


I am trying to create a python extension in c++ using boost.Python.

I use qtcreator as an IDE. my .pro file is:

TEMPLATE = lib
CONFIG += plugin
CONFIG -= app_bundle
CONFIG -= qt

SOURCES += \
    bmodule.cpp \
    entry.cpp

QMAKE_CXXFLAGS += -std=c++11

INCLUDEPATH += /usr/include/boost /usr/include/python2.7
DEFINES += BOOST_PYTHON_DYNAMIC_LIB
LIBS += -L/usr/local/lib -L/usr/lib/python2.7 -lpython2.7 -lboost_python

TARGET = bmodule

HEADERS += \
    entry.h

It works but it creates a so file named libbmodule. I want it to produce one called bmodule.so .

what option I have to add to the pro file?

Currently I am doing:

QMAKE_PRE_LINK = rm -f bmodule.so
QMAKE_POST_LINK = cp libbmodule.so bmodule.so && rm libbmodule.so
QMAKE_DISTCLEAN += bmodule.so

but I do not like it


Solution

  • CONFIG += no_plugin_name_prefix
    

    Add this to your .pro file somewhere.