Giter Site home page Giter Site logo

donghalcyon / swig-example Goto Github PK

View Code? Open in Web Editor NEW

This project forked from danielunderwood/swig-example

0.0 0.0 0.0 53 KB

An example for using CMake with the SWIG code generator

License: Apache License 2.0

CMake 81.39% C++ 15.25% Python 3.36%

swig-example's Introduction

SWIG Example

This is an example of how to use CMake with the SWIG interface generator. It is meant for those interested to use as a guide to setting up a project built by CMake with interfaces in other languages generated by SWIG.

Languages

This example currently generates interfaces for the following languages:

  • Python

I will add languages as I need to use them. Anyone that wishes to add another language, feel free to open a pull request and let me know if there are any issues with using the installation procedure described below with your language.

Installation

A large part of this example is how to install both the C/C++ libraries that SWIG is wrapping as well as the generated wrappers. After a good bit of trying different approaches, the following is the current approach:


C/C++ Libraries

C/C++ libraries are installed with the standard make install command with install targets in the CMake configuration.

Wrapper Libraries

Wrapper library installation of both the C libraries and target language libraries generated by SWIG are handled by the target language's packaging system. In addition, a target make install-<LANGUAGE> is added to the CMake configuration to run anything that needs to be run in the target language.


It is planned to have make install-<LANGUAGE> install the C/C++ libraries in a language-specific directory, but that functionality has not yet been added.

swig-example's People

Contributors

danielunderwood avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.