Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
VTK
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Deploy
Releases
Container registry
Model registry
Monitor
Incidents
Service Desk
Analyze
Value stream analytics
Contributor analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Juan Antonio Zaratiegui Vallecillo
VTK
Commits
4dbd4455
Commit
4dbd4455
authored
4 years ago
by
Ben Boeckel
Browse files
Options
Downloads
Patches
Plain Diff
Java: allow configuring the java destinations
Some Linux distros need this to be configurable. Fixes: #17888
parent
eca1e99e
Branches
Branches containing commit
No related tags found
No related merge requests found
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
Wrapping/Java/CMakeLists.txt
+47
-4
47 additions, 4 deletions
Wrapping/Java/CMakeLists.txt
Wrapping/Java/vtk/vtkSettings.java.in
+2
-3
2 additions, 3 deletions
Wrapping/Java/vtk/vtkSettings.java.in
with
49 additions
and
7 deletions
Wrapping/Java/CMakeLists.txt
+
47
−
4
View file @
4dbd4455
set
(
CMAKE_INSTALL_JNILIBDIR
""
CACHE PATH
"JNI libraries (LIBDIR/java/vtk-
${
CMAKE_SYSTEM_NAME
}
-
${
CMAKE_SYSTEM_PROCESSOR
}
"
)
mark_as_advanced
(
CMAKE_INSTALL_JNILIBDIR
)
if
(
NOT CMAKE_INSTALL_JNILIBDIR
)
set
(
CMAKE_INSTALL_JNILIBDIR
"
${
CMAKE_INSTALL_LIBDIR
}
/java/vtk-
${
CMAKE_SYSTEM_NAME
}
-
${
CMAKE_SYSTEM_PROCESSOR
}
"
)
endif
()
if
(
IS_ABSOLUTE
"
${
CMAKE_INSTALL_JNILIBDIR
}
"
)
message
(
FATAL_ERROR
"The `CMAKE_INSTALL_JNILIBDIR` must not be an absolute path."
)
endif
()
include
(
vtkModuleWrapJava
)
vtk_module_wrap_java
(
JAVA_OUTPUT
"
${
CMAKE_CURRENT_BINARY_DIR
}
/vtk"
...
...
@@ -5,7 +17,7 @@ vtk_module_wrap_java(
WRAPPED_MODULES vtk_java_wrapped_modules
LIBRARY_DESTINATION
"
${
CMAKE_INSTALL_LIBDIR
}
"
# Update vtkSettings.java.in if this changes.
JNILIB_DESTINATION
"
${
CMAKE_INSTALL_LIBDIR
}
/java/vtk-
${
CMAKE_SYSTEM_NAME
}
-
${
CMAKE_SYSTEM_PROCESSOR
}
"
)
JNILIB_DESTINATION
"
${
CMAKE_INSTALL_
JNI
LIBDIR
}
"
)
# TODO: Make FindJava.cmake use imported targets.
find_package
(
Java REQUIRED COMPONENTS Development
)
...
...
@@ -132,10 +144,44 @@ endforeach ()
# Replace the last comma with a semicolon.
string
(
REGEX REPLACE
",
\n
$"
";
\n
"
vtk_java_native_libraries
"
${
vtk_java_native_libraries
}
"
)
set
(
CMAKE_INSTALL_JARDIR
""
CACHE STRING
"Java jar files (LIBDIR/java)"
)
mark_as_advanced
(
CMAKE_INSTALL_JARDIR
)
# XXX: Handle any cache entries which use `<LIBDIR>` replacements.
if
(
CMAKE_INSTALL_JARDIR STREQUAL
"<LIBDIR>/java"
)
# If using the default, blow it away.
set_property
(
CACHE CMAKE_INSTALL_JARDIR
PROPERTY VALUE
""
)
endif
()
if
(
CMAKE_INSTALL_JARDIR MATCHES
"<LIBDIR>"
)
# Replace it in any other usage.
string
(
REPLACE
"<LIBDIR>"
"
${
CMAKE_INSTALL_LIBDIR
}
"
CMAKE_INSTALL_JARDIR
"
${
CMAKE_INSTALL_JARDIR
}
"
)
set_property
(
CACHE CMAKE_INSTALL_JARDIR
PROPERTY VALUE
""
)
endif
()
# XXX: See above
if
(
NOT CMAKE_INSTALL_JARDIR
)
set
(
CMAKE_INSTALL_JARDIR
"
${
CMAKE_INSTALL_LIBDIR
}
/java"
)
endif
()
if
(
IS_ABSOLUTE
"
${
CMAKE_INSTALL_JARDIR
}
"
)
message
(
FATAL_ERROR
"The `CMAKE_INSTALL_JARDIR` must not be an absolute path."
)
endif
()
file
(
RELATIVE_PATH jnilib_relative_path
"/prefix/
${
CMAKE_INSTALL_JARDIR
}
"
"/prefix/
${
CMAKE_INSTALL_JNILIBDIR
}
"
)
set
(
java_configure_sources
vtk/vtkNativeLibrary
vtk/vtkSettings
)
file
(
RELATIVE_PATH _vtk_add_executable_relpath
"/prefix/
${
_vtk_build_RUNTIME_DESTINATION
}
"
"/prefix/
${
_vtk_build_LIBRARY_DESTINATION
}
"
)
foreach
(
java_file IN LISTS java_configure_sources
)
set
(
output_file
"
${
CMAKE_CURRENT_BINARY_DIR
}
/
${
java_file
}
.java"
)
configure_file
(
...
...
@@ -160,9 +206,6 @@ if (VTK_JAVA_TARGET_VERSION STREQUAL "<DEFAULT>")
set
(
VTK_JAVA_TARGET_VERSION
"1.6"
)
endif
()
set
(
CMAKE_INSTALL_JARDIR
"<LIBDIR>/java"
CACHE STRING
"Java jar files (LIBDIR/java)"
)
string
(
REPLACE
"<LIBDIR>"
"
${
CMAKE_INSTALL_LIBDIR
}
"
CMAKE_INSTALL_JARDIR
"
${
CMAKE_INSTALL_JARDIR
}
"
)
set
(
CMAKE_LIBRARY_OUTPUT_DIRECTORY
"
${
CMAKE_BINARY_DIR
}
/
${
CMAKE_INSTALL_JARDIR
}
"
)
set
(
CMAKE_ARCHIVE_OUTPUT_DIRECTORY
"
${
CMAKE_BINARY_DIR
}
/
${
CMAKE_INSTALL_JARDIR
}
"
)
...
...
This diff is collapsed.
Click to expand it.
Wrapping/Java/vtk/vtkSettings.java.in
+
2
−
3
View file @
4dbd4455
...
...
@@ -34,9 +34,8 @@ public class vtkSettings
{
if ( paths[cc].endsWith("vtk.jar") )
{
String sep = System.getProperty("file.separator");
lpath = paths[cc].substring(0, paths[cc].length()-"vtk.jar".length()-1);
lpath = lpath + sep + "vtk-@CMAKE_SYSTEM_NAME@-@CMAKE_SYSTEM_PROCESSOR@";
lpath = paths[cc].substring(0, paths[cc].length()-"vtk.jar".length());
lpath = lpath + "@jnilib_relative_path@";
}
}
if ( lpath == null )
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment