From 1b2bcd38dc06a39a9800e904677d91ca16083f5b Mon Sep 17 00:00:00 2001 From: Greg Landrum Date: Tue, 8 Jan 2013 20:14:58 +0000 Subject: [PATCH] get draw demo working when cairo is not installed --- Code/Demos/RDKit/Draw/demo.cpp | 13 ++++++++++++- 1 file changed, 12 insertions(+), 1 deletion(-) diff --git a/Code/Demos/RDKit/Draw/demo.cpp b/Code/Demos/RDKit/Draw/demo.cpp index e1614353f..35300bf9c 100644 --- a/Code/Demos/RDKit/Draw/demo.cpp +++ b/Code/Demos/RDKit/Draw/demo.cpp @@ -12,7 +12,9 @@ #include #include #include +#ifdef USE_CAIRO #include +#endif #include #include @@ -29,6 +31,7 @@ std::string MolToSVG(const ROMol &mol){ } +#ifdef USE_CAIRO void MolToCairo(const ROMol &mol,cairo_t *cr,int width,int height, int fontSize=14,int maxDotsPerAngstrom=30){ PRECONDITION(cr,"no context"); @@ -36,6 +39,7 @@ void MolToCairo(const ROMol &mol,cairo_t *cr,int width,int height, std::vector drawing=RDKit::Drawing::MolToDrawing(mol); RDKit::Drawing::DrawingToCairo(drawing,cr,width,height,fontSize,maxDotsPerAngstrom); } +#endif void DrawDemo(){ @@ -47,8 +51,15 @@ void DrawDemo(){ ostr<