import os
|
|
|
|
globalEnv = Environment()
|
|
|
|
globalEnv["ROOTPATH"] = os.path.abspath('.')
|
|
|
|
basicBuildPath = os.path.join(globalEnv['ROOTPATH'], 'build')
|
|
globalEnv['BUILDPATH'] = os.path.join(basicBuildPath, 'release')
|
|
|
|
globalEnv['CONTRIBPATH'] = os.path.join(globalEnv['ROOTPATH'], 'contrib')
|
|
globalEnv['MONGOCPATH'] = os.path.join(globalEnv['CONTRIBPATH'], 'mongoc')
|
|
globalEnv['MONGOCXXPATH'] = os.path.join(globalEnv['CONTRIBPATH'], 'mongocxx')
|
|
globalEnv['QBSCXXPATH'] = os.path.join(globalEnv['CONTRIBPATH'], 'qubosolver')
|
|
|
|
globalEnv["INIHSRC"] = os.path.join(
|
|
os.path.join(globalEnv["CONTRIBPATH"],
|
|
"iniParser"),
|
|
"inih")
|
|
globalEnv["INIHCPPSRC"] = os.path.join(globalEnv["INIHSRC"], "cpp")
|
|
globalEnv["MINISATSRC"] = os.path.join(
|
|
os.path.join(globalEnv["CONTRIBPATH"],
|
|
"minisat"),
|
|
"src")
|
|
globalEnv["QBSCXXSRC"] = os.path.join(
|
|
os.path.join(
|
|
os.path.join(globalEnv["CONTRIBPATH"],
|
|
"qubosolver"),
|
|
"qbscxx"),
|
|
"src")
|
|
globalEnv["QBSCXX_INCLUDE"] = os.path.join(
|
|
os.path.join(
|
|
os.path.join(globalEnv["CONTRIBPATH"],
|
|
"qubosolver"),
|
|
"qbscxx"),
|
|
"include")
|
|
|
|
|
|
#compiler option
|
|
AddOption('--dbg', action='store_true', dest='DEBUG')
|
|
|
|
globalEnv["BUILD_TYPE"] = "Release"
|
|
|
|
if GetOption('DEBUG'):
|
|
globalEnv["BUILD_TYPE"] = "Debug"
|
|
globalEnv.Append(CCFLAGS="-g")
|
|
globalEnv['BUILDPATH'] = os.path.join(basicBuildPath, 'debug')
|
|
|
|
globalEnv.Append(CXXFLAGS='-std=c++11')
|
|
AddOption("--init", action="store_true", dest="INIT")
|
|
|
|
#build libs
|
|
#
|
|
|
|
globalEnv['LIB_BUILD_PATH'] = os.path.join(globalEnv['BUILDPATH'], 'libs')
|
|
|
|
#build mongoc
|
|
globalEnv['MONGOC_LIB_PATH'] = os.path.join(globalEnv['LIB_BUILD_PATH'], 'mongoc')
|
|
|
|
if GetOption("INIT"):
|
|
globalEnv.SConscript(os.path.join(
|
|
os.path.join(globalEnv['CONTRIBPATH'],
|
|
'mongoc'),
|
|
'SConscript'),
|
|
variant_dir=globalEnv['MONGOC_LIB_PATH'],
|
|
duplicate=0,
|
|
exports='globalEnv')
|
|
|
|
#build mongocxx
|
|
globalEnv["MONGOCXX_LIB_PATH"] = os.path.join(globalEnv["LIB_BUILD_PATH"], "mongocxx")
|
|
|
|
if GetOption("INIT"):
|
|
globalEnv.SConscript(os.path.join(
|
|
os.path.join(globalEnv["CONTRIBPATH"],
|
|
"mongocxx"),
|
|
"SConscript"),
|
|
variant_dir=globalEnv["MONGOCXX_LIB_PATH"],
|
|
duplicate=0,
|
|
exports="globalEnv")
|
|
|
|
#build qbscxx
|
|
globalEnv["QBSCXX_LIB_PATH"] = os.path.join(globalEnv["LIB_BUILD_PATH"], "qbscxx")
|
|
|
|
if GetOption("INIT"):
|
|
globalEnv.SConscript(os.path.join(
|
|
os.path.join(globalEnv["CONTRIBPATH"],
|
|
"qubosolver"),
|
|
"SConscript"),
|
|
variant_dir=globalEnv["QBSCXX_LIB_PATH"],
|
|
duplicate=0,
|
|
exports="globalEnv")
|
|
|
|
#build inih
|
|
globalEnv["INIH_LIB_PATH"] = os.path.join(globalEnv["LIB_BUILD_PATH"], "inih")
|
|
|
|
globalEnv.SConscript(os.path.join(
|
|
os.path.join(globalEnv["CONTRIBPATH"],
|
|
"iniParser"),
|
|
"SConscript"),
|
|
variant_dir=globalEnv["INIH_LIB_PATH"],
|
|
duplicate=0,
|
|
exports="globalEnv")
|
|
|
|
#build minisat
|
|
globalEnv["MINISAT_LIB_PATH"] = os.path.join(globalEnv["LIB_BUILD_PATH"], "minisat")
|
|
|
|
globalEnv.SConscript(os.path.join(
|
|
os.path.join(globalEnv["CONTRIBPATH"],
|
|
"minisat"),
|
|
"SConscript"),
|
|
variant_dir=globalEnv["MINISAT_LIB_PATH"],
|
|
duplicate=0,
|
|
exports="globalEnv")
|
|
|
|
|
|
mongocxxIncludeDir = os.path.join(
|
|
os.path.join(
|
|
os.path.join(globalEnv["MONGOCXX_LIB_PATH"],
|
|
"include"),
|
|
"mongocxx"),
|
|
"v_noabi")
|
|
|
|
bsoncxxIncludeDir = os.path.join(
|
|
os.path.join(
|
|
os.path.join(globalEnv["MONGOCXX_LIB_PATH"],
|
|
"include"),
|
|
"bsoncxx"),
|
|
"v_noabi")
|
|
|
|
inihIncludeDir = globalEnv["INIHSRC"]
|
|
inihcppIncludeDir = globalEnv["INIHCPPSRC"]
|
|
|
|
minisatIncludeDir = globalEnv["MINISATSRC"]
|
|
|
|
globalEnv.Append(CPPPATH=[mongocxxIncludeDir,
|
|
bsoncxxIncludeDir,
|
|
inihIncludeDir,
|
|
inihcppIncludeDir,
|
|
minisatIncludeDir,
|
|
globalEnv["QBSCXXSRC"],
|
|
globalEnv["QBSCXX_INCLUDE"]])
|
|
|
|
|
|
globalEnv.Append(LIBPATH=[os.path.join(globalEnv["MONGOCXX_LIB_PATH"], "lib"),
|
|
globalEnv["INIH_LIB_PATH"],
|
|
globalEnv["MINISAT_LIB_PATH"],
|
|
globalEnv["QBSCXX_LIB_PATH"]])
|
|
|
|
|
|
#build runMinisat
|
|
globalEnv.SConscript(os.path.join(
|
|
os.path.join(globalEnv['ROOTPATH'],
|
|
'src'),
|
|
'SConscript'),
|
|
variant_dir=globalEnv['BUILDPATH'],
|
|
duplicate=0,
|
|
exports='globalEnv')
|
|
|