forked from pseudomuto/protoc-gen-doc
-
Notifications
You must be signed in to change notification settings - Fork 0
/
protoc-gen-doc.pro
59 lines (46 loc) · 1.66 KB
/
protoc-gen-doc.pro
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
TEMPLATE = app
VERSION = 0.8
CONFIG += console c++11
CONFIG -= app_bundle
QT -= gui
HEADERS += src/mustache.h
SOURCES += src/mustache.cpp src/main.cpp
RESOURCES += protoc-gen-doc.qrc
isEmpty(PREFIX):PREFIX = /usr/local
target.path = $$PREFIX/bin
INSTALLS += target
lessThan(QT_MAJOR_VERSION, 5):error(This program requires Qt 5.x.)
linux {
# Use pkg-config to find libprotobuf.
CONFIG += link_pkgconfig
PKGCONFIG = protobuf
LIBS += -lprotoc # Has no .pc, so add manually.
}
msvc|mac {
# Get location of protobuf/protoc libraries.
PROTOBUF_PREFIX = $$getenv(PROTOBUF_PREFIX)
isEmpty(PROTOBUF_PREFIX) {
error(You must set the PROTOBUF_PREFIX environment variable!)
}
}
msvc {
# Add protobuf/protoc paths to INCLUDEPATH and LIBS.
INCLUDEPATH += "$${PROTOBUF_PREFIX}\src"
release:LIBS += "$${PROTOBUF_PREFIX}\vsprojects\Release\libprotobuf.lib"
release:LIBS += "$${PROTOBUF_PREFIX}\vsprojects\Release\libprotoc.lib"
debug:LIBS += "$${PROTOBUF_PREFIX}\vsprojects\Debug\libprotobuf.lib"
debug:LIBS += "$${PROTOBUF_PREFIX}\vsprojects\Debug\libprotoc.lib"
# Maintain Windows XP compatibility on Visual Studio 2012 and higher.
QMAKE_LFLAGS += /SUBSYSTEM:CONSOLE,5.01
# Add zip target in release mode.
release:include(protoc-gen-doc-win32-zip.pri)
}
mac {
# Add protobuf/protoc paths to INCLUDEPATH and LIBS.
INCLUDEPATH += "$${PROTOBUF_PREFIX}/include"
LIBS += -L$${PROTOBUF_PREFIX}/lib -lprotobuf -lprotoc
}
# Increase g++ warnings.
*g++*:QMAKE_CXXFLAGS += -Werror -Wall -Wextra
# Silence clang warnings in old Qt code.
*clang*:lessThan(QT_VERSION, 5.0.3):QMAKE_CXXFLAGS += -Wno-deprecated-register