Simplify .pro file by removing some duplication

This commit is contained in:
Srivats P 2022-11-18 16:43:56 +05:30
parent 23ee0e6f00
commit 469e0b054e
3 changed files with 35 additions and 59 deletions

View File

@ -5,40 +5,26 @@ win32:RC_FILE = ostinato.rc
macx:ICON = icons/logo.icns macx:ICON = icons/logo.icns
QT += widgets network script xml svg QT += widgets network script xml svg
INCLUDEPATH += "../rpc/" "../common/" INCLUDEPATH += "../rpc/" "../common/"
OBJDIR = .
win32 { win32 {
QMAKE_LFLAGS += -static QMAKE_LFLAGS += -static
CONFIG(debug, debug|release) { CONFIG(debug, debug|release) {
LIBS += -L"../common/debug" -lostfilegui -lostfile OBJDIR = debug
LIBS += -L"../common/debug" -lostprotogui -lostproto
LIBS += -L"../rpc/debug" -lpbrpc
POST_TARGETDEPS += \
"../common/debug/libostfilegui.a" \
"../common/debug/libostfile.a" \
"../common/debug/libostprotogui.a" \
"../common/debug/libostproto.a" \
"../rpc/debug/libpbrpc.a"
} else { } else {
LIBS += -L"../common/release" -lostfilegui -lostfile OBJDIR = release
LIBS += -L"../common/release" -lostprotogui -lostproto
LIBS += -L"../rpc/release" -lpbrpc
POST_TARGETDEPS += \
"../common/release/libostfilegui.a" \
"../common/release/libostfile.a" \
"../common/release/libostprotogui.a" \
"../common/release/libostproto.a" \
"../rpc/release/libpbrpc.a"
} }
} else {
LIBS += -L"../common" -lostfile -lostfilegui
LIBS += -L"../common" -lostprotogui -lostproto
LIBS += -L"../rpc" -lpbrpc
POST_TARGETDEPS += \
"../common/libostfilegui.a" \
"../common/libostfile.a" \
"../common/libostprotogui.a" \
"../common/libostproto.a" \
"../rpc/libpbrpc.a"
} }
LIBS += -L"../common/$$OBJDIR" -lostfile -lostfilegui
LIBS += -L"../common/$$OBJDIR" -lostprotogui -lostproto
LIBS += -L"../rpc/$$OBJDIR" -lpbrpc
POST_TARGETDEPS += \
"../common/$$OBJDIR/libostfilegui.a" \
"../common/$$OBJDIR/libostfile.a" \
"../common/$$OBJDIR/libostprotogui.a" \
"../common/$$OBJDIR/libostproto.a" \
"../rpc/$$OBJDIR/libpbrpc.a"
LIBS += -lprotobuf LIBS += -lprotobuf
LIBS += -L"../extra/qhexedit2/$(OBJECTS_DIR)/" -lqhexedit2 LIBS += -L"../extra/qhexedit2/$(OBJECTS_DIR)/" -lqhexedit2
RESOURCES += ostinato.qrc RESOURCES += ostinato.qrc

View File

@ -7,6 +7,8 @@ linux*:system(grep -q IFLA_STATS64 /usr/include/linux/if_link.h): \
DEFINES += HAVE_IFLA_STATS64 DEFINES += HAVE_IFLA_STATS64
INCLUDEPATH += "../common" INCLUDEPATH += "../common"
INCLUDEPATH += "../rpc" INCLUDEPATH += "../rpc"
OBJDIR = .
win32 { win32 {
# Support Windows Vista and above only # Support Windows Vista and above only
DEFINES += WIN32_LEAN_AND_MEAN NTDDI_VERSION=0x06000000 _WIN32_WINNT=0x0600 DEFINES += WIN32_LEAN_AND_MEAN NTDDI_VERSION=0x06000000 _WIN32_WINNT=0x0600
@ -15,24 +17,19 @@ win32 {
QMAKE_LFLAGS += -static QMAKE_LFLAGS += -static
LIBS += -lwpcap -lpacket -liphlpapi LIBS += -lwpcap -lpacket -liphlpapi
CONFIG(debug, debug|release) { CONFIG(debug, debug|release) {
LIBS += -L"../common/debug" -lostproto OBJDIR = debug
LIBS += -L"../rpc/debug" -lpbrpc
POST_TARGETDEPS += \
"../common/debug/libostproto.a" \
"../rpc/debug/libpbrpc.a"
} else { } else {
LIBS += -L"../common/release" -lostproto OBJDIR = release
LIBS += -L"../rpc/release" -lpbrpc
POST_TARGETDEPS += \
"../common/release/libostproto.a" \
"../rpc/release/libpbrpc.a"
} }
} else { } else {
LIBS += -lpcap LIBS += -lpcap
LIBS += -L"../common" -lostproto
LIBS += -L"../rpc" -lpbrpc
POST_TARGETDEPS += "../common/libostproto.a" "../rpc/libpbrpc.a"
} }
LIBS += -L"../common/$$OBJDIR" -lostproto
LIBS += -L"../rpc/$$OBJDIR" -lpbrpc
POST_TARGETDEPS += \
"../common/$$OBJDIR//libostproto.a" \
"../rpc/$$OBJDIR/libpbrpc.a"
linux { linux {
INCLUDEPATH += "/usr/include/libnl3" INCLUDEPATH += "/usr/include/libnl3"
LIBS += -lnl-3 -lnl-route-3 LIBS += -lnl-3 -lnl-route-3

View File

@ -2,32 +2,25 @@ TEMPLATE = app
CONFIG += qt console CONFIG += qt console
QT += xml network script QT += xml network script
INCLUDEPATH += "../rpc/" "../common/" "../client" INCLUDEPATH += "../rpc/" "../common/" "../client"
OBJDIR = .
win32 { win32 {
LIBS += -lwpcap -lpacket LIBS += -lwpcap -lpacket
CONFIG(debug, debug|release) { CONFIG(debug, debug|release) {
LIBS += -L"../common/debug" -lostfile -lostproto OBJDIR = debug
LIBS += -L"../rpc/debug" -lpbrpc
POST_TARGETDEPS += \
"../common/debug/libostfile.a" \
"../common/debug/libostproto.a" \
"../rpc/debug/libpbrpc.a"
} else { } else {
LIBS += -L"../common/release" -lostfile -lostproto OBJDIR = release
LIBS += -L"../rpc/release" -lpbrpc
POST_TARGETDEPS += \
"../common/release/libostfile.a" \
"../common/release/libostproto.a" \
"../rpc/release/libpbrpc.a"
} }
} else { } else {
LIBS += -lpcap LIBS += -lpcap
LIBS += -L"../common" -lostfile -lostproto
LIBS += -L"../rpc" -lpbrpc
POST_TARGETDEPS += \
"../common/libostfile.a" \
"../common/libostproto.a" \
"../rpc/libpbrpc.a"
} }
LIBS += -L"../common/$$OBJDIR" -lostfile -lostproto
LIBS += -L"../rpc/$$OBJDIR" -lpbrpc
POST_TARGETDEPS += \
"../common/$$OBJDIR/libostfile.a" \
"../common/$$OBJDIR/libostproto.a" \
"../rpc/$$OBJDIR/libpbrpc.a"
LIBS += -lprotobuf LIBS += -lprotobuf
LIBS += -L"../extra/qhexedit2/$(OBJECTS_DIR)/" -lqhexedit2 LIBS += -L"../extra/qhexedit2/$(OBJECTS_DIR)/" -lqhexedit2