← Back to team overview

sikuli-driver team mailing list archive

Re: [Question #237489]: How are the java files in package org.sikuli.basics.proxies generated from C/C++ code using SWIG ?

 

Question #237489 on Sikuli changed:
https://answers.launchpad.net/sikuli/+question/237489

    Status: Open => Answered

RaiMan proposed the following answer:
LOL, I am new to SWIG too ;-)

Your big advantage (which is my hope on getting further) is your much
deeper knowledge about C/C++ (I can "read" C++ stuff, but until know I
did not dare to make substantial changes to the native level))

This is the command file I once used to produce the "swigged" stuff on Windows (until I found out, that I only need to swig on my Mac and the generated stuff will be sufficient for building on Windows and Linux).
So this script might not exactly fit to the current source structure.

@echo off
setlocal
set BASE=%SIKDEVELOP%
set ODIR=%BASE%\Script-Java\org\sikuli\script\natives 
set ICV=c:\opencv\build\include
set IVISION=%BASE%\Resources\natives\Vision
set J1=%JDKHOME%\include
set J2=%JDKHOME%\include\win32
set LOCAL=c:\MinGW\msys\1.0\local
set SWIGEXE=c:\swigwin\swig.exe
echo on
%SWIGEXE% -java -package org.sikuli.script.natives -outdir "%ODIR%" -c++ "-I%J1%" "-I%J2%" "-I%ICV%" "-I%IVISION%" -I%LOCAL%\include -o "%IVISION%/visionJAVA_wrap.cxx" "%IVISION%/vision.swig"
endlocal

ODIR - where the generated java goes
IVISION - the native sources

- this is the actual productive script I use on Mac
#!/bin/sh
odir=$DEVSRC/VisionJava
icv=/usr/local/include/opencv
ivision=$DEVSRC/Vision
sysJava=/System/Library/Frameworks/JavaVM.framework/Headers

/usr/local/bin/swig -java -package org.sikuli.basics.proxies -outdir
$odir -c++ -I$sysJava -I$icv/opencv -I$icv -I$ivision
-I/usr/local/include -o $ivision/visionJAVA_wrap.cxx
$ivision/vision.swig

-- 
You received this question notification because you are a member of
Sikuli Drivers, which is an answer contact for Sikuli.