Commit bca8ac0b authored by Florian Goth's avatar Florian Goth
Browse files

fix generation of bindings

parent 118aa3a8
......@@ -19,7 +19,7 @@ if(CMAKE_VERSION VERSION_GREATER_EQUAL 3.8.0)
INCLUDE_DIRECTORIES(${PYTHON_INCLUDE_PATH})
INCLUDE(${SWIG_USE_FILE})
swig_add_library(pyShowcase TYPE SHARED LANGUAGE python SOURCES libshowcase.i libshowcase.cpp)
swig_add_library(pyShowcase TYPE SHARED LANGUAGE python SOURCES bindings.i)
SWIG_LINK_LIBRARIES(pyShowcase libmy ${PYTHON_LIBRARIES})
endif()
FIND_PACKAGE(Lua)
......@@ -29,7 +29,7 @@ if(CMAKE_VERSION VERSION_GREATER_EQUAL 3.8.0)
INCLUDE_DIRECTORIES(${LUA_INCLUDE_DIR})
INCLUDE(${SWIG_USE_FILE})
swig_add_library(LuaShowcase TYPE SHARED LANGUAGE lua SOURCES libshowcase.i libshowcase.cpp)
swig_add_library(LuaShowcase TYPE SHARED LANGUAGE lua SOURCES bindings.i)
SWIG_LINK_LIBRARIES(LuaShowcase libmy ${LUA_LIBRARIES})
endif()
FIND_PACKAGE(JNI)
......@@ -39,7 +39,7 @@ if(CMAKE_VERSION VERSION_GREATER_EQUAL 3.8.0)
INCLUDE_DIRECTORIES(${JAVA_INCLUDE_PATH} ${JAVA_INCLUDE_PATH2})
INCLUDE(${SWIG_USE_FILE})
swig_add_library(JNIShowcase TYPE SHARED LANGUAGE java SOURCES libshowcase.i libshowcase.cpp)
swig_add_library(JNIShowcase TYPE SHARED LANGUAGE java SOURCES bindings.i)
SWIG_LINK_LIBRARIES(JNIShowcase libmy ${JNI_LIBRARIES})
endif()
......@@ -51,7 +51,7 @@ if(CMAKE_VERSION VERSION_GREATER_EQUAL 3.8.0)
INCLUDE_DIRECTORIES("/usr/share/R/include/") # Debian Bullseye path, could also carry over to Ubuntu
INCLUDE(${SWIG_USE_FILE})
swig_add_library(RShowcase TYPE SHARED LANGUAGE R SOURCES libshowcase.i libshowcase.cpp)
swig_add_library(RShowcase TYPE SHARED LANGUAGE R SOURCES bindings.i)
SWIG_LINK_LIBRARIES(RShowcase libMARQOV)
endif()
if(SWIG_ocaml_FOUND)
......@@ -59,7 +59,7 @@ if(CMAKE_VERSION VERSION_GREATER_EQUAL 3.8.0)
INCLUDE_DIRECTORIES(${CMAKE_CURRENT_SOURCE_DIR})
INCLUDE(${SWIG_USE_FILE})
swig_add_library(ocamlShowcase TYPE SHARED LANGUAGE ocaml SOURCES libshowcase.i libshowcase.cpp)
swig_add_library(ocamlShowcase TYPE SHARED LANGUAGE ocaml SOURCES bindings.i)
target_compile_options(ocamlShowcase PRIVATE "-fpermissive")# could work for gcc
SWIG_LINK_LIBRARIES(ocamlShowcase libmy)
endif()
......
/** @file bindings.h
* This file is for collecting the interfaces that will be used to generate
* foreign language interfaces by SWIG.
*/
#include <string>
int func(int);
%module template_bindings
/*SWIG has a library for doing the string mappings.*/
%include "std_string.i"
%{
#define SWIG_FILE_WITH_INIT
/* Includes the header in the wrapper code */
#include "bindings.h"
%}
/* Parse the header file to generate wrappers */
%include "bindings.h"
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment