Files
Brian Kelley cf269aa813 Expose CDX support to FileParsers and ChemDraw to SWIG (#8681)
* Fist pass at CDX support

* Enable CDX support for reading (also) in the CDXMLParser API

* Add cdxml test files

* Update swig wrappers for CDXMLFormat and Parameters

* Add constructor to ChemDrawParserParams

* Add Java SWIG support for ChemDraw

* Add chemdraw define to rdconfig

* Add missing chemdraw deps

* Remove direct expat link

* Fix Java linkages for ChemDraw

* Remove bad merge code

* Remove bad merge code

* Fix csharp builds

* Add sniffer for the ChemDraw DataStream

* Include filesystem

* Fix test on windows

* Add more CDX tests

* Ensure streams are open in binary mode to support CDX on windows

* Fix text to show that a Block is the text input, not a file

* Fix CSharp test

* Disable CDX tests when not building chemdraw

* Turn back on chemdraw

* Response to review

* Turn off chemdraw support for the limited external test

---------

Co-authored-by: Brian Kelley <bkelley@glysade.com>
2025-08-29 04:39:22 +02:00
..
2019-10-10 20:18:43 +09:00
2024-11-20 09:09:56 +01:00
2019-10-10 20:18:43 +09:00
2012-11-22 04:26:11 +00:00

To build on Windows:
====================

Since cmake doesn't know anything about C#, there's an unfortunate
manual step involved in this. 

  - Make sure that the cmake configuration variable
    RDK_BUILD_SWIG_CSHARP_WRAPPER is set to ON. 
  - Run cmake to generate the solution file and open it in Visual
    Studio. 
  - Select the option to add an existing project and add
    $RDBASE/Code/JavaWrappers/csharp_wrapper/RDKit2DotNet.csproj 
  - Right click on the added project (named RDKit2DotNet) and add a
    dependency to RDKFuncs (this is the project that creates the C++
    dll that the C# project needs) 
  - Build the RDKit2DotNet project.

Your bin directory
($RDBASE/Code/JavaWrappers/csharp_wrapper/bin/Release if you did a
release build) now contains two DLLs: 
  - RDKFuncs.dll is the C++ dll containing the RDKit functionality 
  - RDKit2DotNet.dll contains the C# wrapper. 
To use the wrappers in your own projects, you should copy both dlls
into your project directory and add a reference to RDKit2DotNet.dll 

The directory RDKitCSharpTest contains a sample test project and some
code that makes very basic use of the wrapper functionality. 


To build on a linux system with mono installed:
==============================================

  - Make sure that the cmake configuration variable
    RDK_BUILD_SWIG_CSHARP_WRAPPER is set to ON. 
  - Run cmake and then do "make install"

This will create, in this directory, two files:
  - libRDKFuncs.{so,dynlib} (name depends on OS): the C++ dll
    containing the RDKit functionality
  - RDKit2DotNet.dll contains the C# wrapper.
  
Build and run the test code:
-------------------------------
gmcs -out:test.exe -addmodule:./RDKit2DotNet.dll test.cs
mono test.exe