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
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
DEPENDS ${LIBRARY_OUTPUT_PATH}/openjpeg.jar
COMMENT "building openjpeg.jar"
)
+
+install(FILES ${LIBRARY_OUTPUT_PATH}/openjpeg.jar
+ DESTINATION ${OPENJPEG_INSTALL_SHARE_DIR} COMPONENT JavaModule
+)