fix undefined-behavior src/pid_fuzzy.c:119:25
[liba.git] / cmake / FindJava.cmake
blob57dc2c46f9f27cde29e2daf41931c8ca23f13cd9
1 #.rst:
2 # FindJava
3 # --------
5 # https://cmake.org/cmake/help/latest/module/FindJava.html
7 # Result Variables
8 # ^^^^^^^^^^^^^^^^
10 # This module defines the following variables:
12 # ``JAVA_EXECUTABLE``
14 # ``JAVA_BINDIR``
16 # ``JAVA_LIBDIR``
18 # ``JAVA_HOME``
20 include(${CMAKE_ROOT}/Modules/FindJava.cmake)
21 if(EXISTS "${Java_JAVAC_EXECUTABLE}" AND Java_JAVAH_EXECUTABLE STREQUAL "Java_JAVAH_EXECUTABLE-NOTFOUND")
22   set(Java_JAVAH_EXECUTABLE "${Java_JAVAC_EXECUTABLE} -h" CACHE FILEPATH "Path to a program." FORCE)
23 endif()
24 if(EXISTS "${Java_JAVA_EXECUTABLE}")
25   get_filename_component(JAVA_EXECUTABLE "${Java_JAVA_EXECUTABLE}" REALPATH)
26   get_filename_component(JAVA_BINDIR "${JAVA_EXECUTABLE}" DIRECTORY)
27   get_filename_component(JAVA_HOME "${JAVA_BINDIR}" DIRECTORY)
28   set(JAVA_LIBDIR "${JAVA_HMOE}/lib")
29   if(NOT DEFINED ENV{JAVA_HOME})
30     set(ENV{JAVA_HOME} "${JAVA_HOME}")
31   endif()
32 endif()