summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMichal Cmarada <mcmarada@cisco.com>2019-02-12 19:31:25 +0100
committerMichal Cmarada <mcmarada@cisco.com>2019-02-12 19:31:51 +0100
commit340d4109389e7d6e2b5dc85c114bf07650c2bc34 (patch)
tree59d5a68f062a918edd615d7f633dccffb6774689
parent6e15d1ea806ea40ba6183c9ff57f58d8675df3c3 (diff)
fix set jni path automatically for JAVA
Change-Id: I525e7004eecfd21d597f0bf6fbc968f4c1a6faa8 Signed-off-by: Michal Cmarada <mcmarada@cisco.com>
-rw-r--r--CMakeLists.txt16
1 files changed, 8 insertions, 8 deletions
diff --git a/CMakeLists.txt b/CMakeLists.txt
index de66d85..a58d788 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -97,14 +97,14 @@ list(APPEND dirlist $ENV{JAVA_HOME})
subdirlist(dirlist /usr/lib/jvm)
subdirlist(dirlist /usr/lib64/jvm)
-#unset(JAVA_HOME_SET)
-#find_path(JAVA_HOME_SET NAMES include/jni.h PATHS ${dirlist})
-#if (NOT JAVA_HOME_SET)
-# message("JAVA_HOME is not found")
-#else()
-# message("JAVA HOME: ${JAVA_HOME}")
-# set(ENV{JAVA_HOME} "${JAVA_HOME_SET}")
-#endif()
+unset(JAVA_HOME_SET)
+find_path(JAVA_HOME_SET NAMES include/jni.h PATHS ${dirlist})
+if (NOT JAVA_HOME_SET)
+ message("JAVA_HOME is not found")
+else()
+ message("JAVA HOME: ${JAVA_HOME}")
+ set(ENV{JAVA_HOME} "${JAVA_HOME_SET}")
+endif()
message("\nJAVA:")
message(" JAVA_HOME: $ENV{JAVA_HOME}")