-
Notifications
You must be signed in to change notification settings - Fork 5
/
wscript
47 lines (40 loc) · 1.58 KB
/
wscript
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
import os
APPNAME = 'numerical and temporal expression normalizer'
VERSION = '0.5.0'
def options(opt):
opt.load('compiler_cxx')
opt.load('unittest_gtest')
def configure(conf):
conf.env.CXXFLAGS += ['-O2', '-Wall', '-g', '-pipe']
conf.load('compiler_cxx')
conf.load('unittest_gtest')
conf.check_cfg(package = 'pficommon', args = '--cflags --libs')
conf.check_cfg(package = 'ux', args = '--cflags --libs')
#conf.check_cxx(lib='re2', libpath=conf.env.LIBDIR)
#conf.check_cfg(package = 'boost', args = '--cflags --libs')
#conf.check_cxx(lib='libname', header_name = 'header.h')
pass
def build(bld):
create_dic_file(bld)
bld.recurse('src')
# bld.install_files('${PREFIX}/include', 'src/*.hpp') #cannot install
for dpath, dnames, fnames in os.walk("src") :
for fname in fnames :
if not fname.endswith(".hpp") : continue
bld.install_files('${PREFIX}/include/normalizeNumexp/', [dpath+"/"+fname])
for dpath, dnames, fnames in os.walk("src/dic") :
for fname in fnames :
if not fname.endswith(".txt") : continue
bld.install_files('${PREFIX}/lib/normalizeNumexp/'+dpath[4:], [dpath+"/"+fname])
def create_dic_file(bld) :
#辞書ファイルの場所を指定
dictionary_dirpath = str(bld.env.PREFIX) + "/lib/normalizeNumexp/dic/"
# dictionary_dirpath = "/home/katsuma/usr/local/lib/normalizeNumexp/dic/"
source = """
#include "dictionary_dirpath.hpp"
namespace dictionary_dirpath {
std::string get_dictionary_dirpath(){
return \"%s\";}}"""
source = source % dictionary_dirpath
fout = open("./src/dictionary_dirpath.cpp", "w")
fout.write(source)