Giter VIP home page Giter VIP logo

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.

Getting Started

Docker

If you have docker installed, the following should get you started with a sample environment

$ docker build -t swig-example .
$ docker run --name swig-example -it swig-example
$ # Now in container
# python swig/python/test.py

Local Build

To build locally, the following should be installed:

  • cmake
  • swig
  • python Headers (python-dev for debian-based systems)

It can then be built and run with

$ # Build libraries
$ mkdir build && cd build
$ cmake ..
$ make -j4
$ # Note that this currently installs in /usr/lib, which isn't ideal
$ make install
$ make install-python
$ # Go back to root dir to run
$ cd ..
$ python swig/python/test.sh

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.

swig-example's People

Contributors

danielunderwood avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar

swig-example's Issues

How to use

Hello,

I'm trying to use cmake, swig and python with c++... And i don't kno how to run your example.
¿Can you explain me please?

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.