File tree Expand file tree Collapse file tree 3 files changed +15
-14
lines changed
src/main/java/edu/wpi/first/wpilib/opencv/installer Expand file tree Collapse file tree 3 files changed +15
-14
lines changed Original file line number Diff line number Diff line change @@ -106,13 +106,14 @@ Then to make sure that OpenCV is installed prior to using any OpenCV code:
106
106
107
107
``` java
108
108
import edu.wpi.first.wpilib.opencv.installer.Installer ;
109
+ import edu.wpi.first.wpilib.opencv.installer.PlatformDetector ;
109
110
import org.opencv.core.Core ;
110
111
111
112
class Main {
112
113
113
114
static {
114
115
Installer . setOpenCvVersion(Core . VERSION );
115
- Installer . installJni();
116
+ Installer . installJni(PlatformDetector . getPlatform() . getDefaultJniInstallLocation() );
116
117
System . loadLibrary(Core . NATIVE_LIBRARY_NAME );
117
118
}
118
119
Original file line number Diff line number Diff line change @@ -113,28 +113,28 @@ public static void main(String[] args) throws ParseException {
113
113
System .out .println ("Installing specified OpenCV components" );
114
114
if (parsedArgs .hasOption ("java" ) || parsedArgs .hasOption ("all" )) {
115
115
try {
116
- installJava (parsedArgs .getOptionValue ("java" , platform .getJavaInstallLocation ()));
116
+ installJava (parsedArgs .getOptionValue ("java" , platform .getDefaultJavaInstallLocation ()));
117
117
} catch (IOException e ) {
118
118
e .printStackTrace ();
119
119
}
120
120
}
121
121
if (parsedArgs .hasOption ("jni" ) || parsedArgs .hasOption ("all" )) {
122
122
try {
123
- installJni (parsedArgs .getOptionValue ("jni" , platform .getJniInstallLocation ()));
123
+ installJni (parsedArgs .getOptionValue ("jni" , platform .getDefaultJniInstallLocation ()));
124
124
} catch (IOException e ) {
125
125
e .printStackTrace ();
126
126
}
127
127
}
128
128
if (parsedArgs .hasOption ("headers" ) || parsedArgs .hasOption ("all" )) {
129
129
try {
130
- installHeaders (parsedArgs .getOptionValue ("headers" , platform .getHeadersInstallLocation ()));
130
+ installHeaders (parsedArgs .getOptionValue ("headers" , platform .getDefaultHeadersInstallLocation ()));
131
131
} catch (IOException e ) {
132
132
e .printStackTrace ();
133
133
}
134
134
}
135
135
if (parsedArgs .hasOption ("natives" ) || parsedArgs .hasOption ("all" )) {
136
136
try {
137
- installNatives (parsedArgs .getOptionValue ("natives" , platform .getNativesInstallLocation ()));
137
+ installNatives (parsedArgs .getOptionValue ("natives" , platform .getDefaultNativesInstallLocation ()));
138
138
} catch (IOException e ) {
139
139
e .printStackTrace ();
140
140
}
Original file line number Diff line number Diff line change @@ -63,25 +63,25 @@ private static final class UserHomeHolder {
63
63
}
64
64
65
65
/**
66
- * The location of installs for the Java library.
66
+ * The default location of installs for the Java library.
67
67
*/
68
- private final String javaInstallLocation ;
68
+ private final String defaultJavaInstallLocation ;
69
69
70
70
/**
71
- * The location of installs for the JNI bindings. This should be in a location that is on {@code java.library.path}
72
- * by default.
71
+ * The default location of installs for the JNI bindings. This should be in a location that is on
72
+ * {@code java.library.path} by default.
73
73
*/
74
- private final String jniInstallLocation ;
74
+ private final String defaultJniInstallLocation ;
75
75
76
76
/**
77
- * The location of installs for the C++ header files.
77
+ * The default location of installs for the C++ header files.
78
78
*/
79
- private final String headersInstallLocation ;
79
+ private final String defaultHeadersInstallLocation ;
80
80
81
81
/**
82
- * The location of installs for the native C++ libraries. This should be a default location on the path
82
+ * The default location of installs for the native C++ libraries. This should be a default location on the path
83
83
* (e.g. {@code /usr/local/}).
84
84
*/
85
- private final String nativesInstallLocation ;
85
+ private final String defaultNativesInstallLocation ;
86
86
87
87
}
You can’t perform that action at this time.
0 commit comments