]> granicus.if.org Git - openjpeg/commitdiff
[trunk] Fix java binding installation
authorMathieu Malaterre <mathieu.malaterre@gmail.com>
Mon, 22 Oct 2012 10:41:44 +0000 (10:41 +0000)
committerMathieu Malaterre <mathieu.malaterre@gmail.com>
Mon, 22 Oct 2012 10:41:44 +0000 (10:41 +0000)
CMakeLists.txt
wrapping/java/openjp2/CMakeLists.txt

index be5a6ae06f44f4b172dce836cba198be6c77f017..a6a7e03e5cfab39e7430b78958b19c776f34d36f 100644 (file)
@@ -125,6 +125,14 @@ if(NOT OPENJPEG_INSTALL_DOC_DIR)
   set(OPENJPEG_INSTALL_DOC_DIR "share/doc/${OPENJPEG_INSTALL_SUBDIR}")
 endif()
 
+if(NOT OPENJPEG_INSTALL_JNI_DIR)
+  if(WIN32)
+    set(OPENJPEG_INSTALL_JNI_DIR ${OPENJPEG_INSTALL_BIN_DIR})
+  else()
+    set(OPENJPEG_INSTALL_JNI_DIR ${OPENJPEG_INSTALL_LIB_DIR})
+  endif()
+endif()
+
 if(NOT OPENJPEG_INSTALL_PACKAGE_DIR)
   # We could install *.cmake files in share/ however those files contains
   # hardcoded path to libraries on a multi-arch system (fedora/debian) those
index e4d3a4076cf8a1456bf9d6683bfe50fab07de516..a0271a1d2539f49e1985fbdd43ad9a7596dd209c 100644 (file)
@@ -35,6 +35,11 @@ if(UNIX)
   target_link_libraries(openjpegjni m)
 endif()
 
+install(TARGETS openjpegjni
+  EXPORT OpenJPEGTargets
+  LIBRARY DESTINATION ${OPENJPEG_INSTALL_JNI_DIR} COMPONENT Libraries
+)
+
 # build jar:
 find_package(Java 1.5 REQUIRED) # javac, jar
 
@@ -59,3 +64,7 @@ add_custom_target(OpenJPEGJavaJar ALL
   DEPENDS ${LIBRARY_OUTPUT_PATH}/openjpeg.jar
   COMMENT "building openjpeg.jar"
 )
+
+install(FILES ${LIBRARY_OUTPUT_PATH}/openjpeg.jar
+  DESTINATION ${OPENJPEG_INSTALL_SHARE_DIR} COMPONENT JavaModule
+)