gpt4 book ai didi

c++ - QMAKE_EXTRA_COMPILERS 变量使 INCLUDEPATH 无效

转载 作者:太空宇宙 更新时间:2023-11-04 13:49:19 26 4
gpt4 key购买 nike

我正在使用 odb 并在给定的 .pro 文件中包含添加项 here .

我发现读取“QMAKE_EXTRA_COMPILERS += odb”的行(倒数第二个代码块的底部)似乎撤消了我的 INCLUDEPATH 修改。如果我注释掉该行,我的 INCLUDEPATH 又是正确的,但当然我不再生成必要的 odb 文件。

#-------------------------------------------------
#
# Project created by QtCreator 2014-06-11T15:13:24
#
#-------------------------------------------------

QT += core
QT -= gui

TARGET = DataAccess
TEMPLATE = lib

DEFINES += DATAACCESS_LIBRARY
CONFIG += c++11

SOURCES += dataaccess.cpp

HEADERS +=\
dataaccess_global.h \
dataaccess.h \
operator.hxx

unix:!symbian {
maemo5 {
target.path = /opt/usr/lib
} else {
target.path = /usr/lib
}
INSTALLS += target
}


# Boost
INCLUDEPATH += $(BOOST_RT)
#LIBS += -L$(BOOST_RT)/stage/lib/ -lboost_serialization
#LIBS += -L$(BOOST_RT)/stage/lib/ -lboost_system

# List of header files that should be compiled with the ODB compiler.
#
ODB_FILES += operator.hxx

# ODB compiler flags.
#
ODB_FLAGS = --database sqlite --profile qt/basic --generate-schema --generate-query --generate-session

# Select the database we are going to use.
#
DEFINES += DATABASE_SQLITE

# Suppress unknown pragmas GCC warnings.
#
QMAKE_CXXFLAGS_WARN_ON = $$QMAKE_CXXFLAGS_WARN_ON -Wno-unknown-pragmas

# Link to the ODB runtime libraries.
#
LIBS += -lodb-sqlite
LIBS += -lodb-qt
LIBS += -lodb

# ODB compilation rules. Normally you don't need to change anything here.
#

# Add the Qt headers directory to the ODB include directory list.
#
ODB_FLAGS += -I$$[QT_INSTALL_HEADERS]

# Newer versions of QtCreator do builds in a separate directory. As a
# result, we need to append the source directory to ODB files.
#
for(dir, ODB_FILES) {
ODB_PWD_FILES += $$PWD/$${dir}
}

odb.name = odb ${QMAKE_FILE_IN}
odb.input = ODB_PWD_FILES
odb.output = ${QMAKE_FILE_BASE}-odb.cxx
odb.commands = odb $$ODB_FLAGS ${QMAKE_FILE_IN}
odb.depends = $$ODB_PWD_FILES
odb.variable_out = SOURCES
odb.clean = ${QMAKE_FILE_BASE}-odb.cxx ${QMAKE_FILE_BASE}-odb.hxx ${QMAKE_FILE_BASE}-odb.ixx ${QMAKE_FILE_BASE}.sql
QMAKE_EXTRA_COMPILERS += odb # **<== problem line**

odbh.name = odb ${QMAKE_FILE_IN}
odbh.input = ODB_PWD_FILES
odbh.output = ${QMAKE_FILE_BASE}-odb.hxx
odbh.commands = @true
odbh.CONFIG = no_link
odbh.depends = ${QMAKE_FILE_BASE}-odb.cxx
QMAKE_EXTRA_COMPILERS += odbh

最佳答案

它现在可以添加一个:

ODB_FLAGS += -I$(BOOST_RT)(这是 INCLUDEPATH I 中正在“失效”的库。

在 .pro 文件中

关于c++ - QMAKE_EXTRA_COMPILERS 变量使 INCLUDEPATH 无效,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/24190362/

26 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com