以下是整理过的,加过注释的工程文件(ZwTest2023.pro),后续会整理其它文件的注释。
#-------------------------------------------------
#
# Project created by QtCreator 2021-02-26T01:23:22
#
#-------------------------------------------------
#-------------------------------------------------
# QT:指定所要使用的Qt模块
# TARGET:指定编译后生成的目标文件名称
# TEMPLATE:指定编译后生成app 还是 lib
# DEFINES:预定义预处理器符号
# SOURCES:当前工程中的C++源文件
# HEADERS:当前工程中的C++头文件
# FORMS:当前工程中的ui文件
# VERSION:目标库版本号
# DESTDIR:指定最终文件生成的目录
# UI_DIR:UIC将ui转化为头文件所存放的目录
# RCC_DIR:RCC将qrc文件转化为头文件所存放的目录
# MOC_DIR:MOC命令将含Q_OBJECT的头文件转换为标准的头文件存放的目录
# RC_FILE:程序中所用到的图片等资源文件
# LIBS:指定工程要链接的库路径
# INCLUDEPATH:指定工程要加载的头文件路径
# CONFIG:工程配置和编译的参数
# LIBPATH:指定工程要链接的库路径
# INSTALLS:指定make install后程序的目录
#-------------------------------------------------
#添加QT依赖的库
QT += widgets
#工程名称
TARGET = ZwTest2023
#工程类型
TEMPLATE = lib
ZW_SDK_PATH=/opt/apps/zrxsdk2023
ZW_CAD_PATH=/opt/apps/zwcad2023
ZW_CPU_TYPE=x86_64
#ZW_CPU_TYPE=arm64
#ZW_CPU_TYPE=mips64el
#添加c11配置支持
QMAKE_CXXFLAGS += -std=c++11
QMAKE_CXXFLAGS += -fpermissive
#配置release
CONFIG(release,debug|release):{
DESTDIR=../Out/Release/$${ZW_CPU_TYPE}/Bin
AFTER_LINK_CMD_LINK = mv -f $${DESTDIR}/lib$${TARGET}.so $${DESTDIR}/lib$${TARGET}.zrx
QMAKE_POST_LINK += $$quote($$AFTER_LINK_CMD_LINK)
}
#配置debug
CONFIG(debug,debug|release):{
DESTDIR=../Out/Debug/$${ZW_CPU_TYPE}/Bin
AFTER_LINK_CMD_LINK = mv -f $${DESTDIR}/lib$${TARGET}.so $${DESTDIR}/lib$${TARGET}.zrx
QMAKE_POST_LINK += $$quote($$AFTER_LINK_CMD_LINK)
}
#配置生产文件为动态库 如何是静态库 CONFIG += plugin static
CONFIG += plugin
#添加c11配置支持
CONFIG += c++11
#用来定义编译选项,预编译宏
DEFINES += ZwTest2023_LIBRARY
DEFINES += UNICODE
DEFINES += _UNICODE
DEFINES += ZW_NO_MFC
DEFINES += ZW_NEWGUI
DEFINES += ZW_MULTI_PLATFORMS
DEFINES += MP_TMP_NO_RESOURCES
DEFINES += ZW_NO_WINGDI
DEFINES += ZW_TTF_USE_FREETYPE
DEFINES += ZW_NO_ATLCOM
DEFINES += MP_TMP_NOT_SUPPORTED
DEFINES += NDEBUG
DEFINES += ZRX=2023
DEFINES += WITH_GUI
#需要的实现文件
SOURCES += ZwTest2023/qttemplate.cpp \
ZwTest2023/dialog.cpp \
ZwTest2023/CADUtils.cpp \
ZwTest2023/cmds.cpp \
ZwTest2023/myline.cpp \
ZwTest2023/rxEntryPoint.cpp
#需要的头文件
HEADERS += ZwTest2023/qttemplate.h\
ZwTest2023/qttemplate_global.h \
ZwTest2023/dialog.h \
ZwTest2023/CADUtils.h \
ZwTest2023/cmds.h \
ZwTest2023/myline.h \
ZwTest2023/stdafx.h
#unix系统配置
unix {
target.path = /usr/lib
INSTALLS += target
}
#指定引入的lib文件 LIBS
#大写的L表示“路径”,小写的l表示“库文件名字”
#unix:!macx: 仅仅是unix的,不是mac os,也不是 win32
unix:!macx: LIBS += -L$${ZW_SDK_PATH}/lib/$${ZW_CPU_TYPE}/ -Wl,--whole-archive -lZwZrx -Wl,--no-whole-archive
unix:!macx: PRE_TARGETDEPS += $${ZW_SDK_PATH}/lib/$${ZW_CPU_TYPE}/libZwZrx.a
unix:!macx: LIBS += -L$${ZW_CAD_PATH}/ -lZwRx
unix:!macx: LIBS += -L$${ZW_CAD_PATH}/ -lZwDatabase
unix:!macx: LIBS += -L$${ZW_CAD_PATH}/ -lZWCADE2
unix:!macx: LIBS += -L$${ZW_CAD_PATH}/ -lZwOsBase
unix:!macx: LIBS += -L$${ZW_CAD_PATH}/ -lZwPlatformBase
unix:!macx: LIBS += -L$${ZW_CAD_PATH}/ -lZwUiAdapter
unix:!macx: LIBS += -L$${ZW_CAD_PATH}/ -lZwCustomUI
unix:!macx: LIBS += -L$${ZW_CAD_PATH}/ -lZwMFCWrapper
unix:!macx: LIBS += -L$${ZW_CAD_PATH}/ -lZwGeometry
#指定工程的头文件支持路径
INCLUDEPATH += $${ZW_SDK_PATH}/inc
INCLUDEPATH += $${ZW_SDK_PATH}/inc/PAL/api
INCLUDEPATH += $${ZW_SDK_PATH}/arxport
INCLUDEPATH += $${ZW_SDK_PATH}/arxport/PAL/api
INCLUDEPATH += $${ZW_SDK_PATH}/nowin
INCLUDEPATH += $${ZW_SDK_PATH}/nowin/wine/include
INCLUDEPATH += $${ZW_SDK_PATH}/nowin/ZwMFCWrapper/include
INCLUDEPATH += $${ZW_SDK_PATH}/nowin/CustomUI/include
INCLUDEPATH += $${ZW_SDK_PATH}/nowin/ZwOsBase/include
INCLUDEPATH += $${ZW_SDK_PATH}/nowin/ZwPlatformBase/include
#指定工程的依赖路径
DEPENDPATH += $${ZW_SDK_PATH}/inc
DEPENDPATH += $${ZW_SDK_PATH}/inc/PAL/api
DEPENDPATH += $${ZW_SDK_PATH}/arxport
DEPENDPATH += $${ZW_SDK_PATH}/arxport/PAL/api
DEPENDPATH += $${ZW_SDK_PATH}/nowin
DEPENDPATH += $${ZW_SDK_PATH}/nowin/wine/include
DEPENDPATH += $${ZW_SDK_PATH}/nowin/ZwMFCWrapper/include
DEPENDPATH += $${ZW_SDK_PATH}/nowin/CustomUI/include
DEPENDPATH += $${ZW_SDK_PATH}/nowin/ZwOsBase/include
DEPENDPATH += $${ZW_SDK_PATH}/nowin/ZwPlatformBase/include
#指定工程中的ui文件
FORMS += \
ZwTest2023/dialog.ui