Qmake 创建 .pc 文件
有谁知道 qmake 是否可以创建 .pc 文件?我发现有人说可以在这里: http ://www.qtcentre.org/threads/24422-How-can-we-create-.pc-file-automatically。但我已经尝试过,并得到了与线程底部遇到问题的人相同的结果。我想知道是否有人知道这件事。
TEMPLATE = lib
TARGET = proc_Model
QT += declarative dbus
CONFIG += qt plugin dbus create_pc
DESTDIR = /usr/lib/
OBJECTS_DIR = .obj
MOC_DIR = .moc
TARGET = $$qtLibraryTarget($$TARGET)
INCLUDEPATH += ../common
# Input
SOURCES += ../common/proc_struct.cpp \
listitem.cpp \
listmodel.cpp \
process.cpp \
proc_if.cpp
HEADERS += ../common/proc_struct.h \
listitem.h \
listmodel.h \
process.h \
proc_if.h
headers.path= /usr/include/proc_Model
headers.files = ../common/proc_struct.h \
listitem.h \
listmodel.h \
process.h \
proc_if.h
target.path = /usr/lib
QMAKE_PKGCONFIG_NAME = proc_Model
QMAKE_PKGCONFIG_DESCRIPTION = Model that emits process info
QMAKE_PKGCONFIG_LIBDIR = $$target.path
QMAKE_PKGCONFIG_INCDIR = $$target.path
QMAKE_PKGCONFIG_DESTDIR = pkgconfig
INSTALLS+=headers target
当我进行安装时,我得到以下输出:
install -m 755 -p "/usr/lib/libproc_Model.so" "/usr/lib/libproc_Model.so"
install: `/usr/lib/libproc_Model.so' and `/usr/lib/libproc_Model.so' are the same file
make: [install_target] Error 1 (ignored)
strip --strip-unneeded "/usr/lib/libproc_Model.so"
install -m 644 -p "/usr/lib/pkgconfig/proc_Model.pc" "/usr/lib/pkgconfig/proc_Model.pc"
install: cannot stat `/usr/lib/pkgconfig/proc_Model.pc': No such file or directory
make: [install_target] Error 1 (ignored)
Does anyone know if qmake can create a .pc file? I found someone that said it could here: http://www.qtcentre.org/threads/24422-How-can-we-create-.pc-file-automatically. But I have tried it and got the same results as the person having the issue at the bottom of the thread. I was wondering if someone knew anything about this.
TEMPLATE = lib
TARGET = proc_Model
QT += declarative dbus
CONFIG += qt plugin dbus create_pc
DESTDIR = /usr/lib/
OBJECTS_DIR = .obj
MOC_DIR = .moc
TARGET = $qtLibraryTarget($TARGET)
INCLUDEPATH += ../common
# Input
SOURCES += ../common/proc_struct.cpp \
listitem.cpp \
listmodel.cpp \
process.cpp \
proc_if.cpp
HEADERS += ../common/proc_struct.h \
listitem.h \
listmodel.h \
process.h \
proc_if.h
headers.path= /usr/include/proc_Model
headers.files = ../common/proc_struct.h \
listitem.h \
listmodel.h \
process.h \
proc_if.h
target.path = /usr/lib
QMAKE_PKGCONFIG_NAME = proc_Model
QMAKE_PKGCONFIG_DESCRIPTION = Model that emits process info
QMAKE_PKGCONFIG_LIBDIR = $target.path
QMAKE_PKGCONFIG_INCDIR = $target.path
QMAKE_PKGCONFIG_DESTDIR = pkgconfig
INSTALLS+=headers target
When I make install, I get the following output:
install -m 755 -p "/usr/lib/libproc_Model.so" "/usr/lib/libproc_Model.so"
install: `/usr/lib/libproc_Model.so' and `/usr/lib/libproc_Model.so' are the same file
make: [install_target] Error 1 (ignored)
strip --strip-unneeded "/usr/lib/libproc_Model.so"
install -m 644 -p "/usr/lib/pkgconfig/proc_Model.pc" "/usr/lib/pkgconfig/proc_Model.pc"
install: cannot stat `/usr/lib/pkgconfig/proc_Model.pc': No such file or directory
make: [install_target] Error 1 (ignored)
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
根据 qmake 源代码,您必须添加:
create_pc 仅使用命令“qmake -prl”将 .pc 文件目标的规则添加到 makefile 中,并且该命令仅在以下情况下创建 .pc 文件: create_prl 选项存在。
no_install_prl 防止将 create_prl 生成的不需要的 .prl 文件安装在 ${target.path} 中。
According to qmake source code, you have to add:
create_pc only adds the rule for the .pc file target to the makefile with the command "qmake -prl" and that command only creates the .pc file if the create_prl option is present.
no_install_prl prevents the unneeded .prl file, generated by create_prl, to be installed in ${target.path}.
我在这里做了一个完整的例子:
https: //github.com/pvanhoof/dir-examples/blob/master/qmake-example/src/libs/qmake-example/qmake-example.pro
I made a complete example here:
https://github.com/pvanhoof/dir-examples/blob/master/qmake-example/src/libs/qmake-example/qmake-example.pro