summaryrefslogtreecommitdiffstats
path: root/config/cmake/FindHDFJAVA.cmake.in
diff options
context:
space:
mode:
authorAllen Byrne <byrn@hdfgroup.org>2016-02-29 02:43:00 (GMT)
committerAllen Byrne <byrn@hdfgroup.org>2016-02-29 02:43:00 (GMT)
commit63249be0e10a8726acb5a7cf64491319eaa46227 (patch)
treeebb2b75ece8852e8a58804631c0004f06a9bba9f /config/cmake/FindHDFJAVA.cmake.in
parenta1617b7cdbe14173fcf690b4627059fa4528c19b (diff)
downloadhdf5-63249be0e10a8726acb5a7cf64491319eaa46227.zip
hdf5-63249be0e10a8726acb5a7cf64491319eaa46227.tar.gz
hdf5-63249be0e10a8726acb5a7cf64491319eaa46227.tar.bz2
[svn-r29226] HDFFV-9552: merge in java code.
Diffstat (limited to 'config/cmake/FindHDFJAVA.cmake.in')
-rw-r--r--config/cmake/FindHDFJAVA.cmake.in68
1 files changed, 68 insertions, 0 deletions
diff --git a/config/cmake/FindHDFJAVA.cmake.in b/config/cmake/FindHDFJAVA.cmake.in
new file mode 100644
index 0000000..b822280
--- /dev/null
+++ b/config/cmake/FindHDFJAVA.cmake.in
@@ -0,0 +1,68 @@
+#
+# To be used by projects that make use of CMakeified hdf-java
+#
+
+#
+# Find the HDFJAVA includes and get all installed hdf-java library settings from
+# HDFJAVA-config.cmake file : Requires a CMake compatible hdf-java-@HDFJAVA_PACKAGE_VERSION@ or later
+# for this feature to work. The following vars are set if hdf-java is found.
+#
+# HDFJAVA_FOUND - True if found, otherwise all other vars are undefined
+# HDFJAVA_VERSION_STRING - full version (e.g. @HDFJAVA_PACKAGE_VERSION@)
+# HDFJAVA_VERSION_MAJOR - major part of version (e.g. @HDFJAVA_PACKAGE_VERSION_MAJOR@)
+# HDFJAVA_VERSION_MINOR - minor part (e.g. @HDFJAVA_PACKAGE_VERSION_MINOR@)
+#
+# Target names that are valid (depending on enabled options)
+# will be the following
+#
+#
+# To aid in finding HDFJAVA as part of a subproject set
+# HDFJAVA_ROOT_DIR_HINT to the location where @HDFJAVA_PACKAGE@@HDF_PACKAGE_EXT@-config.cmake lies
+
+INCLUDE (SelectLibraryConfigurations)
+INCLUDE (FindPackageHandleStandardArgs)
+
+# The HINTS option should only be used for values computed from the system.
+set (_HDFJAVA_HINTS
+ $ENV{HOME}/.local
+ $ENV{HDFJAVA_ROOT}
+ $ENV{HDFJAVA_ROOT_DIR_HINT}
+)
+# Hard-coded guesses should still go in PATHS. This ensures that the user
+# environment can always override hard guesses.
+set (_HDFJAVA_PATHS
+ $ENV{HOME}/.local
+ $ENV{HDFJAVA_ROOT}
+ $ENV{HDFJAVA_ROOT_DIR_HINT}
+ /usr/lib/@HDFJAVA_PACKAGE@
+ /usr/share/@HDFJAVA_PACKAGE@
+ /usr/local/@HDFJAVA_PACKAGE@
+ /usr/local/@HDFJAVA_PACKAGE@/share
+)
+
+FIND_PATH (HDFJAVA_ROOT_DIR "@HDFJAVA_PACKAGE@@HDF_PACKAGE_EXT@-config.cmake"
+ HINTS ${_HDFJAVA_HINTS}
+ PATHS ${_HDFJAVA_PATHS}
+ PATH_SUFFIXES
+ cmake/@HDFJAVA_PACKAGE@
+ lib/cmake/@HDFJAVA_PACKAGE@
+ share/cmake/@HDFJAVA_PACKAGE@
+)
+
+FIND_PATH (HDFJAVA_LIBRARY "jarhdf5-@HDFJAVA_PACKAGE_VERSION@.jar"
+ HINTS ${_HDFJAVA_HINTS}
+ PATHS ${_HDFJAVA_PATHS}
+ PATH_SUFFIXES
+ lib
+)
+
+if (HDFJAVA_ROOT_DIR)
+ set (HDFJAVA_FOUND "YES")
+ INCLUDE (${HDFJAVA_ROOT_DIR}/@HDFJAVA_PACKAGE@@HDF_PACKAGE_EXT@-config.cmake)
+ set (HDFJAVA_LIBRARIES "${HDFJAVA_LIBRARY}")
+ set (HDFJAVA_INCLUDE_DIRS
+ ${HDFJAVA_LIBRARY}/jarhdf-@HDFJAVA_PACKAGE_VERSION@.jar
+ ${HDFJAVA_LIBRARY}/jarhdf5-@HDFJAVA_PACKAGE_VERSION@.jar
+ )
+
+endif (HDFJAVA_ROOT_DIR)