cmake: Install JAR and JNI files for Java bindings. (#3002)
authorMathias Preiner <mathias.preiner@gmail.com>
Wed, 15 May 2019 23:26:06 +0000 (16:26 -0700)
committerAndres Noetzli <andres.noetzli@gmail.com>
Wed, 15 May 2019 23:26:06 +0000 (23:26 +0000)
Default install paths are:
  - libcvc4jni.so in /usr/lib/
  - CVC4.jar in /usr/share/java/cvc4

Fixes #2990.

src/bindings/java/CMakeLists.txt

index 3423a3e1b0b6717aa34e25962b63ced3c4d0cd87..573c2ee91ce4ac0dbe4a64c733cd9d614b7b3250 100644 (file)
@@ -241,5 +241,12 @@ set(gen_java_files
   ${CMAKE_CURRENT_BINARY_DIR}/vectorVectorExpr.java
 )
 
-add_jar(cvc4jar SOURCES ${gen_java_files} OUTPUT_NAME CVC4)
+set(CMAKE_JNI_TARGET TRUE)
+add_jar(cvc4jar
+        SOURCES ${gen_java_files}
+        VERSION ${CVC4_MAJOR}.${CVC4_MINOR}.${CVC4_RELEASE}
+        OUTPUT_NAME CVC4)
 add_dependencies(cvc4jar cvc4jni)
+install_jar(cvc4jar DESTINATION share/java/cvc4)
+install_jni_symlink(cvc4jar DESTINATION share/java/cvc4)
+install(TARGETS cvc4jni DESTINATION lib)