QTCreate subdirs project with qt creator

Posted theArcticOcean

tags:

篇首语:本文由小常识网(cha138.com)小编为大家整理,主要介绍了QTCreate subdirs project with qt creator相关的知识,希望对你有一定的参考价值。

本文例子是在《foundations of Qt Development》p462的 Building Complex Projects with QMake小节的基础上建立起来的,本次实验在Mac上进行的,前面的几张截图是在Win7上得来的,不必在意。

最终想要得到的目录结构:

step1 create root directory

step 2 create app directory

step3 create src directory

step 4 write content for src pro file

TARGET = base
VERSION = 0.1.0
CONFIG = static
DESTDIR = ../lib

INCLUDEPATH += ../include
DEPENDPATH += . ../include
SOURCES += base.cpp
HEADERS += base.h

The difference of DEPENDPATH and INCLUDEPATH: INCLUDEPATH is used to search header files, DEPENDPATH is important for recompile.
Relative discussion link: https://www.qtcentre.org/threads/17346-QMake-s-INCLUDEPATH-and-DEPENDPATH-problems

INCLUDEPATH is used during compilation to find included header files. DEPENDPATH is used to resolve dependencies between header and source files, eg. which source files need to be recompiled when certain header file changes. If you modify a header file in folder foo/ and foo/ is not listed in DEPENDPATH, nothing gets recompiled. If foo/ is listed in DEPENDPATH, source files depending on that header will get recompiled. Paths can be relative to the .pro file or absolute paths.

clang: error: invalid deployment target for -stdlib=libc++ (requires OS X 10.7 or later):

我们可以在pro file中人为设定deploy的version


QMAKE_MACOSX_DEPLOYMENT_TARGET = 10.13
message( "This is a message about deploy target: " )
message( $$QMAKE_MACOSX_DEPLOYMENT_TARGET )

在MacOS升级到10.14后,QT build工程的时候一直有10.14SDK没有被QT测试的警告信息:

我们可以加上:CONFIG += sdk_no_version_check 屏蔽这些烦人的警告。

查看build的东西:

运行程序:

工程上传于:https://github.com/theArcticOcean/qtLib/tree/master/complex

以上是关于QTCreate subdirs project with qt creator的主要内容,如果未能解决你的问题,请参考以下文章

介子:在声明之前使用库

Ubuntu系统中QtCreate调用ffmpeg

QtCreate中使用QAudioInput获取默认麦克风的音频数据

QT5.12 qtcreate 在Ubuntu14.04

如何解决CVS的冲突目录?

text cmake auto包含subdir