aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--CMakeLists.txt2
-rw-r--r--cmake/modules/version.c.in1
-rw-r--r--include/version.h1
-rw-r--r--java/CMakeLists.txt6
-rw-r--r--java/manifest.txt.in9
5 files changed, 17 insertions, 2 deletions
diff --git a/CMakeLists.txt b/CMakeLists.txt
index ab9cba47..65c64524 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -36,6 +36,7 @@ string (REGEX REPLACE "^v[0-9]+\\.[0-9]+\\.([0-9]+).*" "\\1" VERSION_PATCH "${VE
string (REGEX REPLACE "^v[0-9]+\\.[0-9]+\\.[0-9]+\\-([0-9]+).*" "\\1" VERSION_COMMIT "${VERSION}")
string (REGEX REPLACE "^v[0-9]+\\.[0-9]+\\.[0-9]+-[0-9]+\\-(.*)" "\\1" VERSION_SHA1 "${VERSION}")
set (VERSION_SHORT "${VERSION_MAJOR}.${VERSION_MINOR}.${VERSION_PATCH}")
+set (VERSION_API "${VERSION_MAJOR}.${VERSION_MINOR}")
if ("${VERSION_COMMIT}" MATCHES "^v.*")
set (VERSION_COMMIT "")
@@ -76,6 +77,7 @@ include_directories (${SYSTEM_USR_DIR})
option (BUILDJAVA "Build Java API." OFF)
IF(BUILDJAVA)
+ configure_file (${CMAKE_CURRENT_SOURCE_DIR}/java/manifest.txt.in ${CMAKE_CURRENT_BINARY_DIR}/java/manifest.txt)
add_subdirectory (java)
add_subdirectory (examples/java)
ENDIF(BUILDJAVA)
diff --git a/cmake/modules/version.c.in b/cmake/modules/version.c.in
index 0fdf8534..81c07e18 100644
--- a/cmake/modules/version.c.in
+++ b/cmake/modules/version.c.in
@@ -2,3 +2,4 @@
const char* gVERSION = "@VERSION@";
const char* gVERSION_SHORT = "@VERSION_SHORT@";
+const char* gVERSION_API = "@VERSION_API@";
diff --git a/include/version.h b/include/version.h
index 5dbf12e0..7a8a67c9 100644
--- a/include/version.h
+++ b/include/version.h
@@ -2,3 +2,4 @@
extern const char* gVERSION;
extern const char* gVERSION_SHORT;
+extern const char* gVERSION_API;
diff --git a/java/CMakeLists.txt b/java/CMakeLists.txt
index 9aeda922..d7c8183b 100644
--- a/java/CMakeLists.txt
+++ b/java/CMakeLists.txt
@@ -16,8 +16,11 @@ if(NOT Java_JAVAH_EXECUTABLE)
message(FATAL_ERROR "Cannot locate javah executable.")
endif(NOT Java_JAVAH_EXECUTABLE)
+set(CMAKE_JNI_TARGET TRUE)
file(GLOB JAVA_SOURCES "*.java")
add_jar(tinybjar ${JAVA_SOURCES}
+ MANIFEST ${CMAKE_CURRENT_BINARY_DIR}/manifest.txt
+ VERSION ${VERSION}
OUTPUT_NAME tinyb
)
@@ -41,7 +44,6 @@ add_custom_command (TARGET tinybjar
)
set(JNI_HEADER_PATH "${CMAKE_CURRENT_BINARY_DIR}/${CMAKE_FILES_DIRECTORY}/tinybjar.dir/jni")
-
-install (FILES ${CMAKE_CURRENT_BINARY_DIR}/tinyb.jar DESTINATION ${CMAKE_INSTALL_LIBDIR}/java)
+install_jar (tinybjar DESTINATION ${CMAKE_INSTALL_LIBDIR}/java)
add_subdirectory (jni)
diff --git a/java/manifest.txt.in b/java/manifest.txt.in
new file mode 100644
index 00000000..d6e768f3
--- /dev/null
+++ b/java/manifest.txt.in
@@ -0,0 +1,9 @@
+Manifest-version: 1.0
+
+Name: tinyb/
+Specification-Title: "TinyB"
+Specification-Version: "@VERSION_API@"
+Specification-Vendor: "Intel Corp."
+Package-Title: "tinyb"
+Package-Version: "@VERSION_SHORT@"
+Package-Vendor: "Intel Corp."