zoneminder/plugins/libzm_plugin_face_haar/SConstruct

79 lines
2.3 KiB
Python

import os, glob, sys
env = Environment()
# Short messages while compiling and linking.
if ARGUMENTS.get('VERBOSE') != "1":
env.Append(CXXCOMSTR = "Compiling static object $TARGET")
env.Append(LINKCOMSTR = "Linking $TARGET")
env.Append(SHCXXCOMSTR = "Compiling shared object $TARGET")
env.Append(SHLINKCOMSTR = "Linking shared $TARGET" )
# CXXFLAGS
if ARGUMENTS.get('debug', 0):
env.Append(CXXFLAGS = ['-g'])
build_dir = 'debug/'
else:
build_dir = 'release/'
env.BuildDir(build_dir, 'src/', duplicate=0)
env.Append(CXXFLAGS=['-msse2', '-march=native','-Wno-write-strings','-D__STDC_CONSTANT_MACROS'])
env.Append(CXXFLAGS=['-DZM_FFMPEG_CVS','-DHAVE_LIBCRYPTO','-DJPEG_INCLUDE_DIR=../../../../../libjpeg-turbo-1.2.1/'])
env.Append(LINKFLAGS = ['-Wl,--no-undefined'])
env.Append(LDFLAGS = [" -L../../../../../libjpeg-turbo-1.2.1/.libs "])
# Headers and libs
env['CPPPATH'] = [ build_dir,
'src',
'../../src',
'../../',
'../../../../../libjpeg-turbo-1.2.1/',
'/usr/include/opencv', '/usr/local/include/opencv',
'/usr/local/include/boost',
'.'
]
env['LIBPATH'] = [
'../../../../../libjpeg-turbo-1.2.1/.libs/',
'/usr/local/lib',
'/usr/lib',
'./']
env['LIBS'] = [
'opencv_core',
'opencv_highgui',
'opencv_objdetect',
'opencv_imgproc',
'boost_program_options',
'mysqlclient',
'pthread',
'jpeg',
'z'
]
# Common sources.
# common_src = env.Glob( build_dir + '*.cpp')
zoneminder_src = env.Glob('../../src/' + 'zm_detector.cpp')
zoneminder_src += env.Glob('../../src/' + 'zm_config.cpp')
zoneminder_src += env.Glob('../../src/' + 'zm_poly.cpp')
zoneminder_src += env.Glob('../../src/' + 'zm_zone.cpp')
zoneminder_src += env.Glob('../../src/' + 'zm_image.cpp')
zoneminder_src += env.Glob('../../src/' + 'zm_db.cpp')
zoneminder_src += env.Glob('../../src/' + 'zm_jpeg.cpp')
zoneminder_src += env.Glob('../../src/' + 'zm_logger.cpp')
zoneminder_src += env.Glob('../../src/' + 'zm_utils.cpp')
zoneminder_src += env.Glob('../../src/' + 'zm_thread.cpp')
# Face detector sources.
face_haar_src = env.Glob( build_dir + 'face_detector_plugin.cpp')
# Shared lib
env.SharedLibrary(target = 'zm_plugin_face_haar', source = [face_haar_src, zoneminder_src])