#!/usr/bin/python import sys Import ('env') sources = [] defs = [] incs = '' incs += '../blenkernel ../blenlib ../imbuf ../makesdna ../python ' incs += '../render/extern/include ../render/intern/include ../include ../src' incs += ' #/extern/freestyle/lib3ds' incs += ' ' + env['BF_PYTHON_INC'] incs += ' ' + env['BF_LIB3DS_INC'] incs += ' ' + env['BF_PNG_INC'] ######################################################## # folders sources ######################################################## # system prefix = 'intern/system' system_sources = env.Glob(prefix + '/*.cpp') # image prefix = 'intern/image' image_sources = env.Glob(prefix + '/*.cpp') # geometry prefix = 'intern/geometry' geometry_sources = env.Glob(prefix + '/*.cpp') # scene_graph prefix = 'intern/scene_graph' scene_graph_sources = env.Glob(prefix + '/*.cpp') # winged_edge prefix = 'intern/winged_edge' winged_edge_sources = env.Glob(prefix + '/*.cpp') # view_map prefix = 'intern/view_map' view_map_sources = env.Glob(prefix + '/*.cpp') # stroke prefix = 'intern/stroke' stroke_sources = env.Glob(prefix + '/*.cpp') # rendering prefix = 'intern/rendering' rendering_sources = env.Glob(prefix + '/GL*.cpp') if env['OURPLATFORM'] in ('win32-vc', 'win32-mingw'): rendering_sources = env.Glob(prefix + '/extgl.cpp') # app / app_blender prefix = 'intern/app_blender' app_sources = env.Glob(prefix + '/*.cpp') # Python prefix = 'intern/python' # python_sources = env.Glob(prefix + '/*.cpp') python_sources = [ prefix + '/BPy_Freestyle.cpp', prefix + '/BPy_Convert.cpp', prefix + '/BPy_BBox.cpp', prefix + '/BPy_BinaryPredicate0D.cpp', prefix + '/BPy_BinaryPredicate1D.cpp', prefix + '/BPy_FrsMaterial.cpp', prefix + '/BPy_Id.cpp', prefix + '/BPy_IntegrationType.cpp', prefix + '/BPy_Interface0D.cpp', prefix + '/Interface0D/BPy_CurvePoint.cpp', prefix + '/Interface0D/CurvePoint/BPy_StrokeVertex.cpp', prefix + '/Interface0D/BPy_SVertex.cpp', prefix + '/Interface0D/BPy_ViewVertex.cpp', prefix + '/Interface0D/ViewVertex/BPy_NonTVertex.cpp', prefix + '/Interface0D/ViewVertex/BPy_TVertex.cpp', prefix + '/BPy_Interface1D.cpp', prefix + '/Interface1D/BPy_Curve.cpp', prefix + '/Interface1D/Curve/BPy_Chain.cpp', prefix + '/Interface1D/BPy_FEdge.cpp', prefix + '/Interface1D/FEdge/BPy_FEdgeSharp.cpp', prefix + '/Interface1D/FEdge/BPy_FEdgeSmooth.cpp', prefix + '/Interface1D/BPy_Stroke.cpp', prefix + '/Interface1D/BPy_ViewEdge.cpp', prefix + '/BPy_Iterator.cpp', prefix + '/Iterator/BPy_AdjacencyIterator.cpp', prefix + '/Iterator/BPy_Interface0DIterator.cpp', prefix + '/Iterator/BPy_CurvePointIterator.cpp', prefix + '/Iterator/BPy_StrokeVertexIterator.cpp', prefix + '/Iterator/BPy_SVertexIterator.cpp', prefix + '/Iterator/BPy_orientedViewEdgeIterator.cpp', prefix + '/Iterator/BPy_ViewEdgeIterator.cpp', prefix + '/Iterator/BPy_ChainingIterator.cpp', prefix + '/Iterator/BPy_ChainPredicateIterator.cpp', prefix + '/Iterator/BPy_ChainSilhouetteIterator.cpp', prefix + '/BPy_MediumType.cpp', prefix + '/BPy_Nature.cpp', prefix + '/BPy_Noise.cpp', prefix + '/BPy_SShape.cpp', prefix + '/BPy_StrokeAttribute.cpp', prefix + '/BPy_StrokeShader.cpp', prefix + '/StrokeShader/BPy_BackboneStretcherShader.cpp', prefix + '/StrokeShader/BPy_BezierCurveShader.cpp', prefix + '/StrokeShader/BPy_CalligraphicShader.cpp', prefix + '/StrokeShader/BPy_ColorNoiseShader.cpp', prefix + '/StrokeShader/BPy_ColorVariationPatternShader.cpp', prefix + '/StrokeShader/BPy_ConstantColorShader.cpp', prefix + '/StrokeShader/BPy_ConstantThicknessShader.cpp', prefix + '/StrokeShader/BPy_ConstrainedIncreasingThicknessShader.cpp', prefix + '/StrokeShader/BPy_fstreamShader.cpp', prefix + '/StrokeShader/BPy_GuidingLinesShader.cpp', prefix + '/StrokeShader/BPy_IncreasingColorShader.cpp', prefix + '/StrokeShader/BPy_IncreasingThicknessShader.cpp', prefix + '/StrokeShader/BPy_PolygonalizationShader.cpp', prefix + '/StrokeShader/BPy_SamplingShader.cpp', prefix + '/StrokeShader/BPy_SpatialNoiseShader.cpp', prefix + '/StrokeShader/BPy_streamShader.cpp', prefix + '/StrokeShader/BPy_StrokeTextureShader.cpp', prefix + '/StrokeShader/BPy_TextureAssignerShader.cpp', prefix + '/StrokeShader/BPy_ThicknessNoiseShader.cpp', prefix + '/StrokeShader/BPy_ThicknessVariationPatternShader.cpp', prefix + '/StrokeShader/BPy_TipRemoverShader.cpp', prefix + '/BPy_UnaryFunction0D.cpp', prefix + '/UnaryFunction0D/BPy_UnaryFunction0DDouble.cpp', prefix + '/UnaryFunction0D/UnaryFunction0D_double/BPy_Curvature2DAngleF0D.cpp', prefix + '/UnaryFunction0D/UnaryFunction0D_double/BPy_DensityF0D.cpp', prefix + '/UnaryFunction0D/UnaryFunction0D_double/BPy_GetProjectedXF0D.cpp', prefix + '/UnaryFunction0D/UnaryFunction0D_double/BPy_GetProjectedYF0D.cpp', prefix + '/UnaryFunction0D/UnaryFunction0D_double/BPy_GetProjectedZF0D.cpp', prefix + '/UnaryFunction0D/UnaryFunction0D_double/BPy_GetXF0D.cpp', prefix + '/UnaryFunction0D/UnaryFunction0D_double/BPy_GetYF0D.cpp', prefix + '/UnaryFunction0D/UnaryFunction0D_double/BPy_GetZF0D.cpp', prefix + '/UnaryFunction0D/UnaryFunction0D_double/BPy_LocalAverageDepthF0D.cpp', prefix + '/UnaryFunction0D/UnaryFunction0D_double/BPy_ZDiscontinuityF0D.cpp', prefix + '/UnaryFunction0D/BPy_UnaryFunction0DEdgeNature.cpp', prefix + '/UnaryFunction0D/UnaryFunction0D_Nature_EdgeNature/BPy_CurveNatureF0D.cpp', prefix + '/UnaryFunction0D/BPy_UnaryFunction0DFloat.cpp', prefix + '/UnaryFunction0D/UnaryFunction0D_float/BPy_GetCurvilinearAbscissaF0D.cpp', prefix + '/UnaryFunction0D/UnaryFunction0D_float/BPy_GetParameterF0D.cpp', prefix + '/UnaryFunction0D/UnaryFunction0D_float/BPy_GetViewMapGradientNormF0D.cpp', prefix + '/UnaryFunction0D/UnaryFunction0D_float/BPy_ReadCompleteViewMapPixelF0D.cpp', prefix + '/UnaryFunction0D/UnaryFunction0D_float/BPy_ReadMapPixelF0D.cpp', prefix + '/UnaryFunction0D/UnaryFunction0D_float/BPy_ReadSteerableViewMapPixelF0D.cpp', prefix + '/UnaryFunction0D/BPy_UnaryFunction0DId.cpp', prefix + '/UnaryFunction0D/UnaryFunction0D_Id/BPy_ShapeIdF0D.cpp', prefix + '/UnaryFunction0D/BPy_UnaryFunction0DMaterial.cpp', prefix + '/UnaryFunction0D/UnaryFunction0D_Material/BPy_MaterialF0D.cpp', prefix + '/UnaryFunction0D/BPy_UnaryFunction0DUnsigned.cpp', prefix + '/UnaryFunction0D/UnaryFunction0D_unsigned_int/BPy_QuantitativeInvisibilityF0D.cpp', prefix + '/UnaryFunction0D/BPy_UnaryFunction0DVec2f.cpp', prefix + '/UnaryFunction0D/UnaryFunction0D_Vec2f/BPy_Normal2DF0D.cpp', prefix + '/UnaryFunction0D/UnaryFunction0D_Vec2f/BPy_VertexOrientation2DF0D.cpp', prefix + '/UnaryFunction0D/BPy_UnaryFunction0DVec3f.cpp', prefix + '/UnaryFunction0D/UnaryFunction0D_Vec3f/BPy_VertexOrientation3DF0D.cpp', prefix + '/UnaryFunction0D/BPy_UnaryFunction0DVectorViewShape.cpp', prefix + '/UnaryFunction0D/UnaryFunction0D_vector_ViewShape/BPy_GetOccludersF0D.cpp', prefix + '/UnaryFunction0D/BPy_UnaryFunction0DViewShape.cpp', prefix + '/UnaryFunction0D/UnaryFunction0D_ViewShape/BPy_GetOccludeeF0D.cpp', prefix + '/UnaryFunction0D/UnaryFunction0D_ViewShape/BPy_GetShapeF0D.cpp', prefix + '/BPy_UnaryFunction1D.cpp', prefix + '/UnaryFunction1D/BPy_UnaryFunction1DDouble.cpp', prefix + '/UnaryFunction1D/UnaryFunction1D_double/BPy_Curvature2DAngleF1D.cpp', prefix + '/UnaryFunction1D/UnaryFunction1D_double/BPy_DensityF1D.cpp', prefix + '/UnaryFunction1D/UnaryFunction1D_double/BPy_GetCompleteViewMapDensityF1D.cpp', prefix + '/UnaryFunction1D/UnaryFunction1D_double/BPy_GetDirectionalViewMapDensityF1D.cpp', prefix + '/UnaryFunction1D/UnaryFunction1D_double/BPy_GetProjectedXF1D.cpp', prefix + '/UnaryFunction1D/UnaryFunction1D_double/BPy_GetProjectedYF1D.cpp', prefix + '/UnaryFunction1D/UnaryFunction1D_double/BPy_GetProjectedZF1D.cpp', prefix + '/UnaryFunction1D/UnaryFunction1D_double/BPy_GetSteerableViewMapDensityF1D.cpp', prefix + '/UnaryFunction1D/UnaryFunction1D_double/BPy_GetViewMapGradientNormF1D.cpp', prefix + '/UnaryFunction1D/UnaryFunction1D_double/BPy_GetXF1D.cpp', prefix + '/UnaryFunction1D/UnaryFunction1D_double/BPy_GetYF1D.cpp', prefix + '/UnaryFunction1D/UnaryFunction1D_double/BPy_GetZF1D.cpp', prefix + '/UnaryFunction1D/UnaryFunction1D_double/BPy_LocalAverageDepthF1D.cpp', prefix + '/UnaryFunction1D/UnaryFunction1D_double/BPy_ZDiscontinuityF1D.cpp', prefix + '/UnaryFunction1D/BPy_UnaryFunction1DEdgeNature.cpp', prefix + '/UnaryFunction1D/UnaryFunction1D_Nature_EdgeNature/BPy_CurveNatureF1D.cpp', prefix + '/UnaryFunction1D/BPy_UnaryFunction1DFloat.cpp', prefix + '/UnaryFunction1D/BPy_UnaryFunction1DUnsigned.cpp', prefix + '/UnaryFunction1D/UnaryFunction1D_unsigned_int/BPy_QuantitativeInvisibilityF1D.cpp', prefix + '/UnaryFunction1D/BPy_UnaryFunction1DVec2f.cpp', prefix + '/UnaryFunction1D/UnaryFunction1D_Vec2f/BPy_Normal2DF1D.cpp', prefix + '/UnaryFunction1D/UnaryFunction1D_Vec2f/BPy_Orientation2DF1D.cpp', prefix + '/UnaryFunction1D/BPy_UnaryFunction1DVec3f.cpp', prefix + '/UnaryFunction1D/UnaryFunction1D_Vec3f/BPy_Orientation3DF1D.cpp', prefix + '/UnaryFunction1D/BPy_UnaryFunction1DVectorViewShape.cpp', prefix + '/UnaryFunction1D/UnaryFunction1D_vector_ViewShape/BPy_GetOccludeeF1D.cpp', prefix + '/UnaryFunction1D/UnaryFunction1D_vector_ViewShape/BPy_GetOccludersF1D.cpp', prefix + '/UnaryFunction1D/UnaryFunction1D_vector_ViewShape/BPy_GetShapeF1D.cpp', prefix + '/UnaryFunction1D/BPy_UnaryFunction1DVoid.cpp', prefix + '/UnaryFunction1D/UnaryFunction1D_void/BPy_ChainingTimeStampF1D.cpp', prefix + '/UnaryFunction1D/UnaryFunction1D_void/BPy_IncrementChainingTimeStampF1D.cpp', prefix + '/UnaryFunction1D/UnaryFunction1D_void/BPy_TimeStampF1D.cpp', prefix + '/BPy_UnaryPredicate0D.cpp', prefix + '/BPy_UnaryPredicate1D.cpp', prefix + '/BPy_ViewMap.cpp', prefix + '/BPy_ViewShape.cpp' ] sources = system_sources + image_sources + geometry_sources + scene_graph_sources \ + winged_edge_sources + view_map_sources + stroke_sources + rendering_sources \ + app_sources + python_sources env.BlenderLib (libname="bf_freestyle", sources=sources, includes=Split(incs), defines=defs, libtype=['blender'], priority = [25] ) ######################################################## # SWIG ######################################################## # swig # # 1] Run the following three commands in the source/blender/freestyle/intern/swig directory. # # 2] Replace /Users/mx/Documents/work/GSoC_2008/bf-blender/branches/build/darwin/lib to the path # of your library directory (used to locate libbf_freestyle.a) # # 3] Replace the python directories to suit your config # export SWIG_LIB=/Users/mx/Documents/work/GSoC_2008/bf-blender/branches/soc-2008-mxcurioni/extern/freestyle/swig/Lib # cd /Users/mx/Documents/work/GSoC_2008/bf-blender/branches/soc-2008-mxcurioni/source/blender/freestyle/intern/swig # /Users/mx/Documents/work/GSoC_2008/bf-blender/branches/build/darwin/bin/swig -c++ -python -o ModuleWrapper.cpp Freestyle.i # mv ./Freestyle.py ../../python/ # g++ -w -I../geometry -I../image -I../scene_graph -I../stroke -I../system -I../view_map -I../winged_edge -I/usr/include/python2.5 -I../../../blenlib -I../../../blenkernel -I../../../imbuf -I../../../makesdna -c ModuleWrapper.cpp -o ModuleWrapper.o ########### Mac OS X ########### # g++ -bundle -flat_namespace -undefined suppress -w -L/usr/lib/python2.5/config -L/Users/mx/Documents/work/GSoC_2008/bf-blender/branches/build/darwin/lib -lpython2.5 -lbf_freestyle -o ../../python/_Freestyle.so ModuleWrapper.o ########### Linux ########### # g++ -shared -w -L/usr/lib/python2.5/config -L/home/joe/bf_blender_freestyle/build/linux2/lib -lpython2.5 -lbf_freestyle -o ../../python/_Freestyle.so ModuleWrapper.o