Better support for compiling with system libraries (#1447)

This commit is contained in:
pajlada 2019-12-29 12:47:15 +01:00 committed by GitHub
parent 443aba3f9c
commit 2cb2f679c2
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
5 changed files with 70 additions and 4 deletions

View file

@ -1,3 +1,16 @@
# Exposed build flags:
# from lib/fmt.pri
# - FMT_PREFIX ($$PWD by default)
# - FMT_SYSTEM (1 = true) (Linux only, uses pkg-config)
# from lib/websocketpp.pri
# - WEBSOCKETPP_PREFIX ($$PWD by default)
# - WEBSOCKETPP_SYSTEM (1 = true) (unix only)
# from lib/rapidjson.pri
# - RAPIDJSON_PREFIX ($$PWD by default)
# - RAPIDJSON_SYSTEM (1 = true) (Linux only, uses pkg-config)
# from lib/boost.pri
# - BOOST_DIRECTORY (C:\local\boost\ by default) (Windows only)
QT += widgets core gui network multimedia svg concurrent
CONFIG += communi
COMMUNI += core model util
@ -31,6 +44,9 @@ win32-msvc* {
linux {
LIBS += -lrt
QMAKE_LFLAGS += -lrt
# Enable linking libraries using PKGCONFIG += libraryname
CONFIG += link_pkgconfig
}
macx {

View file

@ -1,3 +1,7 @@
# boost
# Exposed build flags:
# - BOOST_DIRECTORY (C:\local\boost\ by default) (Windows only)
pajlada {
BOOST_DIRECTORY = C:\dev\projects\boost_1_66_0\
}

View file

@ -1,4 +1,18 @@
# fmt
SOURCES += $$PWD/fmt/fmt/format.cpp
# Chatterino2 is tested with FMT 4.0
# Exposed build flags:
# - FMT_PREFIX ($$PWD by default)
# - FMT_SYSTEM (1 = true) (Linux only, uses pkg-config)
INCLUDEPATH += $$PWD/fmt/
!defined(FMT_PREFIX) {
FMT_PREFIX = $$PWD
}
linux:equals(FMT_SYSTEM, "1") {
message("Building with system FMT")
PKGCONFIG += fmt
} else {
SOURCES += $$FMT_PREFIX/fmt/fmt/format.cpp
INCLUDEPATH += $$PWD/fmt/
}

View file

@ -1,2 +1,15 @@
# rapidjson
INCLUDEPATH += $$PWD/rapidjson/include/
# Chatterino2 is tested with RapidJSON v1.1.0
# - RAPIDJSON_PREFIX ($$PWD by default)
# - RAPIDJSON_SYSTEM (1 = true) (Linux only, uses pkg-config)
!defined(RAPIDJSON_PREFIX) {
RAPIDJSON_PREFIX = $$PWD
}
linux:equals(RAPIDJSON_SYSTEM, "1") {
message("Building with system RapidJSON")
PKGCONFIG += RapidJSON
} else {
INCLUDEPATH += $$RAPIDJSON_PREFIX/rapidjson/include/
}

View file

@ -1 +1,20 @@
INCLUDEPATH += $$PWD/../lib/websocketpp
# websocketpp
# Chatterino2 is tested with websocketpp 0.8.1
# Exposed build flags:
# - WEBSOCKETPP_PREFIX ($$PWD by default)
# - WEBSOCKETPP_SYSTEM (1 = true) (unix only)
!defined(WEBSOCKETPP_PREFIX) {
WEBSOCKETPP_PREFIX = $$PWD
}
unix {
equals(WEBSOCKETPP_SYSTEM, "1") {
message("Building with system websocketpp")
} else {
message("Building with websocketpp submodule (Prefix: $$WEBSOCKETPP_PREFIX)")
INCLUDEPATH += $$WEBSOCKETPP_PREFIX/websocketpp/
}
} else {
INCLUDEPATH += $$WEBSOCKETPP_PREFIX/websocketpp
}