-
Notifications
You must be signed in to change notification settings - Fork 6
/
Copy pathConfigs.pri
160 lines (135 loc) · 5.48 KB
/
Configs.pri
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
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
################################################################################
# Targoman: A robust Statistical Machine Translation framework
#
# Copyright 2014-2015 by ITRC <http://itrc.ac.ir>
#
# This file is part of Targoman.
#
# Targoman is free software: you can redistribute it and/or modify
# it under the terms of the GNU Lesser General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# (at your option) any later version.
#
# Targoman is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU Lesser General Public License for more details.
#
# You should have received a copy of the GNU Lesser General Public License
# along with Targoman. If not, see <http://www.gnu.org/licenses/>.
################################################################################
VERSION = 0.0.0
Dependencies +=
################################################################################
# DO NOT CHANGE ANYTHING BELOW
################################################################################
!unix{
error("********* Compile on OS other than Linux is not ready yet")
}
LookUps=. .. ../.. ../../.. ../../../.. ../../../../.. ../../../../../..
for(CurrPath, LookUps) {
isEmpty($$NoChange){
exists($$CurrPath/Configs.pri) {
BaseOutput = $$CurrPath
}
else{
NoChange=True
}
}
}
BasePath=$$BasePath/$$BaseOutput
message("******************* $$ProjectName CONFIG ************************ ")
message("* Building $$ProjectName Ver. $$VERSION")
message("* Base Path has been set to: $$BasePath/")
message("* Install Path has been set to: $$PREFIX/")
message("******************************************************************** ")
#############################################################################
LibFolderPattern = ./lib/lib
LibIncludeFolderPattern = ./lib/include
BinFolderPattern = ./bin
BaseLibraryFolder = $$BasePath/out/$$LibFolderPattern
BaseLibraryIncludeFolder = $$BasePath/out/$$LibIncludeFolderPattern
BaseBinFolder = $$BasePath/out/$$BinFolderPattern
#############################################################################
CONFIG(debug, debug|release): DEFINES += TARGOMAN_SHOW_DEBUG=1
DEFINES += TARGOMAN_DEBUG_PROCESS_LINE=1
DEFINES += TARGOMAN_DEBUG_PROCESS_LINE_SHOW_FILE
DEFINES += TARGOMAN_DEFAULT_DEBUG_LEVEL=7
DEFINES += TARGOMAN_LOG_SYNC=1
DEFINES += TARGOMAN_SHOW_LOG=1
DEFINES += TARGOMAN_DEFAULT_ERROR_LEVEL=10
DEFINES += TARGOMAN_ERROR_SHOW_FILE=1
DEFINES += TARGOMAN_DEFAULT_WARNING_LEVEL=10
DEFINES += TARGOMAN_WARNING_SHOW_FILE=1
DEFINES += TARGOMAN_DEFAULT_INFO_LEVEL=10
DEFINES += TARGOMAN_INFO_SHOW_FILE=1
DEFINES += PROJ_VERSION=$$VERSION
#############################################################################
QT += core
#############################################################################
INCLUDEPATH += $$BaseLibraryIncludeFolder \
$$BasePluginInterfaceFolder \
$$(PREFIX)/include \
$$(EXTERNAL_DEPS)/
#############################################################################
DependencySearchPaths += $$BaseOutput/out/$$LibFolderPattern \
$$BaseLibraryFolder
FullDependencySearchPaths= $$DependencySearchPaths
unix {
DependencySearchPaths += $$(PREFIX)/lib \
$$(PREFIX)/lib/lib
FullDependencySearchPaths= /usr/lib \
/usr/lib64 \
/usr/local/lib \
/usr/local/lib64
}
QMAKE_LIBDIR += $$DependencySearchPaths
for(project, Dependencies) {
for(path, FullDependencySearchPaths):isEmpty( Found ) {
message(Searching for $$project in $$path)
exists($$path/lib$$project*) {
Found = "TRUE"
message(-------------> $$project Found!!!)
}
message("+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-")
}
isEmpty( Found ) {
message("*****************************************************************")
message("!!!!!! $$ProjectName Depends on $$project but not found ")
message("*****************************************************************")
error("")
}
Found = ""
}
for(Library, Dependencies):LIBS += -l$$Library
#############################################################################
isEmpty(PREFIX) {
PREFIX = $$(HOME)/local
}
documentation.path = $$(PREFIX)/doc
documentation.files=docs/*
# documentation.extra=create_docs; mv master.doc toc.doc
target.files= out/$$BinFolderPattern \
out/$$LibFolderPattern \
out/$$LibIncludeFolderPattern \
out/$$PluginFolderPattern \
out/$$PluginInterfaceFolderPattern
target.path = $$(PREFIX)/
target.extra= rm -f $$(PREFIX)/lib/lib
INSTALLS += documentation \
target
system("ls $$BaseOutput")
unix {
DependencySearchPaths += $$(PREFIX)/lib \
$$(PREFIX)/lib/lib
FullDependencySearchPaths= /usr/lib \
/usr/lib64 \
/usr/local/lib \
/usr/local/lib64
PostQMakeScript = $$BasePath/postqmake.unix.sh
system("mkdir -p $$BaseOutput/out/$$LibFolderPattern")
system("mkdir -p $$BaseOutput/out/$$LibIncludeFolderPattern")
system("mkdir -p $$BaseOutput/out/$$BinFolderPattern")
system("mkdir -p $$BaseOutput/out/$$PluginFolderPattern")
system("mkdir -p $$BaseOutput/out/$$PluginInterfaceFolderPattern")
}