need to look for Java Development components, not just JNI parts

This commit is contained in:
Axel Kohlmeyer 2020-10-22 01:55:42 -04:00
parent a14b38ce21
commit bc43865f45
No known key found for this signature in database
GPG Key ID: D9B44E93BF0C375A
1 changed files with 1 additions and 0 deletions

View File

@ -43,6 +43,7 @@ if(BUILD_SWIG_JAVA)
set_property(SOURCE lammps.i PROPERTY SWIG_MODULE_NAME javalammps)
swig_add_library(javalammps TYPE MODULE LANGUAGE java SOURCES lammps.i)
find_package(JNI REQUIRED)
find_package(Java COMPONENTS Development REQUIRED)
target_include_directories(javalammps PRIVATE ${JNI_INCLUDE_DIRS})
swig_link_libraries(javalammps PRIVATE lammps ${JNI_LIBRARIES})
configure_file(run_java_example.sh run_java_example.sh COPYONLY)