Skip to content

Commit

Permalink
new library path for mac, v1 and v2 are working on mac
Browse files Browse the repository at this point in the history
  • Loading branch information
ThomasLengeling committed Aug 13, 2015
1 parent 4715ba5 commit 38ead3a
Show file tree
Hide file tree
Showing 2 changed files with 18 additions and 6 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -59,16 +59,17 @@ public class Freenect implements Library {
}
else if(osName.indexOf("mac") >= 0){
try {

// Added by Daniel Shiffman
// For loading libfreenect.dylib
LibraryPath libPath = new LibraryPath();
String path = libPath.get();
String path = libPath.get()+"v1/mac/";
// When testing from Eclipse
// path = "lib";
// System.out.println("Found path: " + path);
System.out.println("Found path: " + path);

NativeLibrary.addSearchPath("v1/mac/freenect", path);
NativeLibrary.addSearchPath("freenect", path);

System.load(path+"libusb-1.0.0.dylib");
NativeLibrary instance = NativeLibrary.getInstance("freenect");
System.err.println("Loaded " + instance.getName() + " from " + instance.getFile().getCanonicalPath());
Native.register(instance);
Expand Down
15 changes: 13 additions & 2 deletions OpenKinect-Processing/src/org/openkinect/freenect2/Device.java
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,8 @@
import java.nio.FloatBuffer;
import java.nio.IntBuffer;

import org.openkinect.processing.LibraryPath;

import com.jogamp.common.nio.Buffers;
/*
openKinect2 library for Processing
Expand Down Expand Up @@ -54,8 +56,17 @@ public class Device {
System.loadLibrary("v2/msvc/libJNILibfreenect2");
}else if(osName.indexOf("mac") >= 0){
System.out.println(arch + " mac");
System.loadLibrary("v2/mac/turbojpeg");
System.loadLibrary("v2/mac/JNILibfreenect2");
System.setProperty("java.library.path", System.getProperty("java.library.path")+"/v2/mac" );
System.out.println(System.getProperty("java.library.path"));

LibraryPath libPath = new LibraryPath();
String path = libPath.get()+"v2/mac/"; //System.getProperty("java.library.path")+
// When testing from Eclipse
// path = "lib";
System.out.println("Found path: " + path);

System.load(path+"libturbojpeg.dylib");
System.load(path+"libJNILibfreenect2.dylib");
}else{
System.err.println("not compatible with the current OS or is a 32 bit system");
}
Expand Down

0 comments on commit 38ead3a

Please sign in to comment.